Python 100 project #25: Remote Command Execution

I like TV shows, especially SciFi genre. In those dramas, hackers uses some special tools to take control of someone’s PCs. It’s very scary, and I’m really worried when I saw the “Shut up and Dance (Black Mirror)“. I’m not worried about something I watch on my PCs, but it’s very uncomfortable if anyone can look at my house through those cameras.

This project is a starting point to know how these attacks can be made. Still it’s very simple, but quite effective.

 

Diagram:

 

Output Example:

On the display, it looks like it’s not doing anything noteworthy. But it makes a connection to the external server and it allows someone to control your PC. Only the thing you need to do on the victim PC is just a click of exe. file. With some more effort, you can hide this command prompt, or you can also make more sophisticated image of (dummy) application to trick the victim.

[ on Victim PC ]

[ on the server ]

 

Here is the code:

[ on victim PC ]

[ on the server ]