Estimated reading time: 1 minute
This article is about creating a reverse shell session over TCP using Python Sockets. Let me explain what happens in a general sense.First, the server binds its IP address and a PORT to a socket [note that I implemented a fixed solution for other people whose routers change IPs whenever they restart them]. Second, the client initiates a TCP connection to the client on that socket. This clearly doesn't generate any alert, except a simple connection to a remote server using TCP. After the client(s) connects, we select a target and basically, everything that you write (Server Side) is sent over the socket. Then the client executes it in a subprocess like a command, but it still doesn't trigger any alert for antivirus or firewall. The result of the execution is sent back to the server so you can read the result.I put two versions, one encrypted and the other one clear text, with various function implementations. If you are interested in my code, please visit: https://github.com/chmodxxx/tcp_reverse_shell
Any remarks on things I can improve are welcome. Thank you.