netcat被称为网络工具中的瑞士×××,最初由Hobbit <hobbit@avian.org>开发,并且在多年来一直被认为是网络安全领域最有用工具的前几名。
A (BackTrack 5, 10.200.21.232)
B (CentOS release 5.5, 10.200.21.235)
root@bt:~# netcat -h
connect to somewhere: nc [-options] hostname port[s] [ports] ...
listen for inbound: nc -l -p port [-options] [hostname] [port]
-c shell commands as `-e'; use /bin/sh to exec [dangerous!!]
-e filename program to exec after connect [dangerous!!]
-g gateway source-routing hop point[s], up to 8
-G num source-routing pointer: 4, 8, 12, ...
-i secs delay interval for lines sent, ports scanned
-k set keepalive option on socket
-l listen mode, for inbound connects
-n numeric-only IP addresses, no DNS
-r randomize local and remote ports
-q secs quit after EOF on stdin and delay of secs
-v verbose [use twice to be more verbose]
-w secs timeout for connects and final net reads
-z zero-I/O mode [used for scanning]
port numbers can be individual or ranges: lo-hi [inclusive];
hyphens in port names must be backslash escaped (e.g. 'ftp\-data').
root@bt:~# nc -v 10.200.21.235 21
10.200.21.235: inverse host lookup failed: Unknown server error : Connection timed out
(UNKNOWN) [10.200.21.235] 21 (ftp) open
220 (vsFTPd 2.0.5)
root@bt:~# nc 10.200.21.235 80
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
06:04:12.633407 IP 10.200.21.232.33987 > 10.200.21.235.http: S 4117132960:4117132960(0) win 14600 <mss 1460,sackOK,timestamp 155677271 0,nop,wscale 6>
06:04:12.746654 IP 10.200.21.235.http > 10.200.21.232.33987: S 757606161:757606161(0) ack 4117132961 win 5792 <mss 1460,sackOK,timestamp 610759967 155677271,nop,wscale 7>
06:04:12.634408 IP 10.200.21.232.33987 > 10.200.21.235.http: . ack 1 win 229 <nop,nop,timestamp 155677275 610759967>
06:0