ngrep – http://ngrep.sourceforge.net/

在 Linux 系統上,如果沒有安裝 GUI介面,就無法使用 wireshark,在純文字介面的環境下怎麼看細一點的封包資訊,

比方說存取 80 服務時,這個封包是在抓那個檔案作什麼動作,是 GET 還是 POST,

用 tcpdump 只看的懂來源、目的、服務port,其它沒了。

這時後我們就用 ngrep 吧,且只要你熟 tcpdump 其實參數用法大同小異,你可以把 ngrep 想成 network + grep 它也確實是如此,

指令1: ngrep port 80

這樣子是不是好看多了

安裝: 有 yum 安裝就用 yum 安裝吧,除非舊的系統,只好 tarball 編譯

編譯時遇到的問題

CentOS release 3.7

ngrep-1.45.tar.bz2

libpcap-1.0.0.tar.gz

Q: ngrep-1.45]# ./configure

creating Makefile
creating doc/Makefile
creating test/Makefile

Configuring Network Grep (ngrep) …

checking for a broken redhat glibc udphdr declaration… no
checking for a complete set of pcap headers…

more than one set found in:
/usr/local/include
/usr/local/include/pcap

please wipe out all unused pcap installations

A: 這是因為有兩個 pcap.h,一個在 /usr/local/include/pcap/pcap.h,一個在  /usr/local/include/pcap.h
解決方法有兩個,

把 /usr/local/include/pcap.h 移掉,mv /usr/local/include/pcap.h /usr/local/include/pcap.h_

或者

./configure –with-pcap-include=/usr/local/include/pcap/pcap.h

Related posts 相關文章
使用 Grafana 與 Prometheus 監控主機
More...
cloudshark 就像是 wireshark 的 web 版
More...
我們一步一步的被監控著,IPHONE 5S的指紋是否會被 NSA 用去
More...
Linux 以 top 為名稱的監控觀查工具
More...

作者

留言

作者

找封包同時為目的ip 1.1.1.1 及目的port 25,注意要兩個單引號 '' ngrep '' dst host 1.1.1.1 and dst port 25

撰寫回覆或留言

發佈留言必須填寫的電子郵件地址不會公開。