藍森林首頁 | 返回主頁 | 本站地圖 | 站內搜索 | 聯繫信箱 |
 您目前的位置:首頁 > 自由軟件 > 技術交流 > 應用編程


    

藍森林 http://www.lslnet.com 2006年6月26日 11:18


請教關於使用固定條件查找IP的方法

Interesting ports on 192.168.21.200:
PORT    STATE SERVICE
139/tcp open  netbios-ssn
MAC Address: 00:11:2F:9F:C1:C7 (Unknown)

Interesting ports on 192.168.21.201:
PORT    STATE SERVICE
139/tcp open  netbios-ssn
MAC Address: 00:11:D8:4E:12:0A (Unknown)

Interesting ports on 192.168.21.220:
PORT    STATE  SERVICE
139/tcp closed netbios-ssn
MAC Address: 00:0E:A9:30:02:33 (Shanghai Xun Shi Communications Equipment Co.)

Interesting ports on 192.168.21.224:
PORT    STATE SERVICE
139/tcp open  netbios-ssn
MAC Address: 00:40:D0:5F:EE:EE (Mitac International)

我要根據  139/tcp open 這個條件顯示IP....請教一下!

請教關於使用固定條件查找IP的方法

awk '/Interesting ports on /{a=$4;sub(/:/,"",a)}
/139\/tcp open/{print a}' ur-file

請教關於使用固定條件查找IP的方法

[code]awk 'BEGIN {
    FS="\n"
    RS=""
}
{if($3~/139\/tcp open/) print $1}' u-file|sed -e 's/Interesting ports on//' -e 's/://'[/code]

請教關於使用固定條件查找IP的方法

十分感謝樓上的兄弟。研讀學習ing



Copyright © 1999-2000 LSLNET.COM. All rights reserved. 藍森林網站 版權所有。 E-mail : webmaster@lslnet.com