在网络工具中有“瑞士军刀”美誉的NetCat, 在我们用了N年了至今仍是爱不释手。因为它短小精悍(这个用在它身上很适合,现在有人已经将其修改成大约10K左右,而且功能不减少)。现在就我的一些使用心得和一些帮助文档中,做一些介绍与大家共勉。 FS"Ja`>j~
1、 了解NC的用法 2c Xae
命令:nc –h eCI'<^
技巧:win98用户可以在autoexec.bat加入path=nc的路径,win2000用户在环境变量中加入path中,linux含有这个命令(redhat) t!\aDkxo %
1、基本使用 *B&P[n
想要连接到某处: nc [-options] hostname port[s] [ports] ... 'dj3y/
k%
绑定端口等待连接: nc -l -p port [-options] [hostname] [port] J`5VE$2M
参数: (U'n1s/X
-e prog 程序重定向,一旦连接,就执行 [危险!!] 12^uu)6Xm,
-g gateway source-routing hop point[s], up to 8 <Y)14w%
-G num source-routing pointer: 4, 8, 12, ... oywPPVxj
-h 帮助信息 v/ry" W
-i secs 延时的间隔 7@{%S~TN
-l 监听模式,用于入站连接 ^JY {<
-n 指定数字的IP地址,不能用hostname DGJ:#UE
-o file 记录16进制的传输 U.TZd"
-p port 本地端口号 f,ro1Nke
-r 任意指定本地及远程端口 VESvCei
-s addr 本地源地址 xC<