Run commands from another terminal over netcat connection (reverse shell)

24 Views Asked by At

I am currently trying to automate some privilege escalation tasks from CTFs. The goal is to write a python script that can execute commands on a target machine and then process them locally. It should be possible to execute these commands at any time.

Scenario: I have a Kali with an active reverse shell to the target in terminal A.

But I want to run the python script (which send the commands) from a second kali terminal B. And terminal A should execute the commands. For example, I want to send the command "ls" from terminal B to terminal A and then receive the results in terminal B.

Is this even possible? Or are there better ways

0

There are 0 best solutions below