Linux study notes 3: nc command

nc -vn 123.125.50.138 25
nc -vn 192.168.87.133 80
head/ see code

text transfer

nc -l -p 333 open port 333
nc -vn 0.0.0.0 333 open port 333, chat

Process information

nc -l -p 333> ps.txt
ps aux | nc -nv 0.0.0.0 333 -q 1

Open file information

nc -l -p 333 > lsof.txt
lsof |nc -nv 0.0.0.0 333 -q 1

transfer files

1
nc -lp 333 > 2.txt
nc -nv 0.0.0.0 333 < 1.txt –q 1

2
nc -lp 333 < 1.txt -q 1
nc -vn 0.0.0.0 333 > 2.txt

Transfer directory:

tar -cvf - music/ | nc -lp 333 –q 1
nc -nv 0.0.0.0 333 | tar -xvf –

Scanner (not strong):
nc -nvz 39.106.125.199 1-65535
nc -nvzu 39.106.125.199 1-65535 UDP port

ncat -c bash --allow 1.1.1.1 -vnl 333 --ssl
ncat -nv 1.1.1.1 333 --ssl

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325975606&siteId=291194637