2 rpwt1122 rpwt1122 于 2014.05.24 11:37 提问

awk过滤nmap扫描结果.求大神解答

nmap扫描结果
Interesting ports on 172.22.43.251:
PORT STATE SERVICE
23/tcp open telnet
80/tcp open http
135/tcp filtered msrpc
139/tcp filtered netbios-ssn
445/tcp filtered microsoft-ds
514/tcp filtered shell
1025/tcp filtered NFS-or-IIS
1720/tcp filtered H.323/Q.931
1723/tcp open pptp
3128/tcp filtered squid-http

Interesting ports on 172.22.43.252:
PORT STATE SERVICE
7/tcp closed echo
80/tcp open http
84/tcp closed ctf
85/tcp open mit-ml-dev
161/tcp closed snmp
443/tcp open https
1002/tcp closed windows-icfw
1062/tcp closed veracity
1130/tcp closed casp
1236/tcp closed bvcontrol
1641/tcp closed invision
1812/tcp closed radius
2045/tcp closed cdfunc
2323/tcp closed 3d-nfsd
3905/tcp closed mupdate
3971/tcp closed lanrevserver
3986/tcp closed mapper-ws_ethd
4000/tcp closed remoteanything

Nmap done: 2 IP addresses (2 hosts up) scanned in 319.92 seconds

我在扫描 1-65535 所有端口时只要有一个端口为open,就打印这样的信息
(如:
Interesting ports on 172.22.43.251:
PORT STATE SERVICE
23/tcp open telnet
80/tcp open http
135/tcp filtered msrpc
139/tcp filtered netbios-ssn
445/tcp filtered microsoft-ds
514/tcp filtered shell
1025/tcp filtered NFS-or-IIS
1720/tcp filtered H.323/Q.931
1723/tcp open pptp
3128/tcp filtered squid-http

就打印 172.22.43.254
23/tcp open telnet
80/tcp open http
1723/tcp open pptp

1个回答

oyljerry
oyljerry   Ds   Rxr 2015.01.24 14:35

awk '{if($2=="open") print $0 }'

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!