Netcat:網(wǎng)絡(luò)瑞士軍刀
在網(wǎng)絡(luò)工具中有“瑞士軍刀”美譽(yù)的NetCat, 在我們用了N年了至今仍是愛不釋手。因?yàn)樗绦【罚ㄟ@個(gè)用在它身上很適合,現(xiàn)在有人已經(jīng)將其修改成大約10K左右,而且功能不減少)。現(xiàn)在就我的一些使用心得和一些幫助文檔中,做一些介紹與大家共勉。
下載鏈接:http://down.51cto.com/data/146141
>>去網(wǎng)絡(luò)安全工具百寶箱看看其它安全工具
了解NC的用法
命令:nc –h
技巧:win98用戶可以在autoexec.bat加入path=nc的路徑,win2000用戶在環(huán)境變量中加入path中,linux含有這個(gè)命令(redhat)
基本使用
- 想要連接到某處: nc 【-options】 hostname port【s】 【ports】 ...
- 綁定端口等待連接: nc -l -p port 【-options】 【hostname】 【port】
參數(shù):
- -e prog 程序重定向,一旦連接,就執(zhí)行 【危險(xiǎn)!!】
- -g gateway source-routing hop point【s】, up to 8
- -G num source-routing pointer: 4, 8, 12, ...
- -h 幫助信息
- -i secs 延時(shí)的間隔
- -l 監(jiān)聽模式,用于入站連接
- -n 指定數(shù)字的IP地址,不能用hostname
- -o file 記錄16進(jìn)制的傳輸
- -p port 本地端口號
- -r 任意指定本地及遠(yuǎn)程端口
- -s addr 本地源地址
- -u UDP模式
- -v 詳細(xì)輸出——用兩個(gè)-v可得到更詳細(xì)的內(nèi)容
- -w secs timeout的時(shí)間
- -z 將輸入輸出關(guān)掉——用于掃描時(shí)
其中端口號可以指定一個(gè)或者用lo-hi式的指定范圍。
例如:掃描端口
tcp掃描
- C:\nc>nc -v -z -w2 192.168.0.80 1-140
- net 【192.168.0.80】 140 (?)
- net 【192.168.0.80】 139 (netbios-ssn) open
- net 【192.168.0.80】 138 (?)
- net 【192.168.0.80】 137 (netbios-ns)
- net 【192.168.0.80】 136 (?)
- net 【192.168.0.80】 135 (epmap) open
- net 【192.168.0.80】 81 (?) open
- net 【192.168.0.80】 80 (http) open
- net 【192.168.0.80】 79 (finger)
- net 【192.168.0.80】 25 (smtp) open
- net 【192.168.0.80】 24 (?)
- net 【192.168.0.80】 23 (telnet)
- net 【192.168.0.80】 21 (ftp)
udp掃描
- C:\nc>nc -u -v -z -w2 192.168.0.80 1-140
- net 【192.168.0.80】 140 (?) open
- net 【192.168.0.80】 139 (?) open
- net 【192.168.0.80】 138 (netbios-dgm) open
- net 【192.168.0.80】 137 (netbios-ns) open
- net 【192.168.0.80】 54 (?) open
- net 【192.168.0.80】 53 (domain) open
- net 【192.168.0.80】 38 (?) open
- net 【192.168.0.80】 37 (time) open
- net 【192.168.0.80】 7 (echo) open