For better Interface

After we login or reverse shell, when we will use

  1. echo os.system(’/bin/bash’) this cmd

and when we will use

  1. python -c ‘import pty; pty.spawn("/bin/bash")’ this one, please explain in detail

Both are valid to be used on any Linux system. The second one will work only if the linux machine has Python preinstalled. The first one will work most of the time. There are other methods also that you can try which you can find it here: Spawning Shells · Total OSCP Guide

1 Like