On PC, you have tools like MMOViper [1] and ISBoxer [2]. For console...all I could really find is this blog post on intercepting PS4 remote play and simulating controller inputs [3].
I imagine console hackers are remiss to give up their secrets, for fear of quick patching, but I'm just interested in the basic concept of console modding/botting/scripting.
[0]: https://youtu.be/SOYWLQdl6Fw
[1]: http://www.mmoviper.com
[2]: https://isboxer.com
[3]: http://blog.komefai.com/2017/08/15/Creating-a-PS4-bot-in-C-Part-1/