日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ngrep使用方法

發(fā)布時間:2024/4/18 编程问答 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ngrep使用方法 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

ngrep 是grep(在文本中搜索字符串的工具)的網(wǎng)絡版,他力求更多的grep特征,
用于搜尋指定的數(shù)據(jù)包。正由于安裝ngrep需用到libpcap庫, 所以支持大量的
操作系統(tǒng)和網(wǎng)絡協(xié)議。能識別TCP、UDP和ICMP包,理解bpf的過濾機制。

ngrep搜尋數(shù)據(jù)包
ngrep 是grep(在文本中搜索字符串的工具)的網(wǎng)絡版,他力求更多的grep特征,
用于搜尋指定的數(shù)據(jù)包。正由于安裝ngrep需用到libpcap庫, 所以支持大量的
操作系統(tǒng)和網(wǎng)絡協(xié)議。能識別TCP、UDP和ICMP包,理解bpf的過濾機制。
ngrep下載地址:http://ngrep.sourceforge.net/;
libpcap下載地址:http://www.tcpdump.org/。

使用方法:()

usage: ngrep <-LhNXViwqpevxlDtTRM> <-IO pcap_dump> <-n num> <-d dev> <-A num>
???????????? <-s snaplen> <-S limitlen> <-W normal|byline|single|none> <-c cols>?

???????????? <-P char> <-F file> <match expression> <bpf filter>
?? -h? is help/usage
?? -V? is version information
?? -q? is be quiet (don't print packet reception hash marks)靜默模式,如果沒有此開關,未匹配的數(shù)據(jù)包都以“#”顯示

?? -e? is show empty packets 顯示空數(shù)據(jù)包
?? -i? is ignore case??? 忽略大小寫
?? -v? is invert match 反轉匹配
?? -R? is don't do privilege revocation logic
?? -x? is print in alternate hexdump format 以16進制格式顯示
?? -X? is interpret match expression as hexadecimal? 以16進制格式匹配
?? -w? is word-regex (expression must match as a word) 整字匹配
?? -p? is don't go into promiscuous mode 不使用混雜模式
?? -l? is make stdout line buffered
?? -D? is replay pcap_dumps with their recorded time intervals
?? -t? is print timestamp every time a packet is matched在每個匹配的包之前顯示時間戳
?? -T? is print delta timestamp every time a packet is matched顯示上一個匹配的數(shù)據(jù)包之間的時間間隔
?? -M? is don't do multi-line match (do single-line match instead)僅進行單行匹配
?? -I? is read packet stream from pcap format file pcap_dump 從文件中讀取數(shù)據(jù)進行匹配
?? -O? is dump matched packets in pcap format to pcap_dump 將匹配的數(shù)據(jù)保存到文件
?? -n? is look at only num packets 僅捕獲指定數(shù)目的數(shù)據(jù)包進行查看
?? -A? is dump num packets after a match匹配到數(shù)據(jù)包后Dump隨后的指定數(shù)目的數(shù)據(jù)包
?? -s? is set the bpf caplen
?? -S? is set the limitlen on matched packets
?? -W? is set the dump format (normal, byline, single, none) 設置顯示格式byline將解析包中的換行符
?? -c? is force the column width to the specified size 強制顯示列的寬度
?? -P? is set the non-printable display char to what is specified
?? -F? is read the bpf filter from the specified file 使用文件中定義的bpf(Berkeley Packet Filter)
?? -N? is show sub protocol number 顯示由IANA定義的子協(xié)議號
?? -d? is use specified device (index) instead of the pcap default 使用哪個網(wǎng)卡,可以用-L選項查詢
?? -L? is show the winpcap device list index 查詢網(wǎng)卡接口

舉例:

C:\ngrep>ngrep.exe -d2 -N -q PASS
interface: \Device\NPF_{ADAAEBF4-46FA-485E-B3EB-4ACB56285D80} (192.168.1.0/255.2
55.255.0)
match: PASS

T(6) 192.168.1.111:1717 -> 123.125.50.29:110 [AP]
? PASS 123456..

?

?

?

與50位技術專家面對面20年技術見證,附贈技術全景圖

總結

以上是生活随笔為你收集整理的ngrep使用方法的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內容還不錯,歡迎將生活随笔推薦給好友。