1.tcpdump
看linux大棚就明白了,http://roclinux.cn/?cat=3
如果抓本地的包,要用lo,而非eth1. eg:sudo tcpdump -i lo port 9999
抓到的流显示的是tcp连接,可以清晰的看出三次握手协议
2. ngrep
在stackoverfow中看到的,http://stackoverflow.com/questions/9241391/how-to-capture-all-the-http-packets-using-tcpdump
抓到的流显示的是http协议,eg:sudo ngrep -q -d lo -W byline host localhost and port 9999