本文檔以實戰的形式介紹tcpdump抓包分析三次握手四次揮手的過程。 |
執行tcpdump命令html
tcpdump -n -i ens32 host 192.168.10.10 and 42.186.113.26 >> /tmp/tcpdump.txt ping game.campus.163.com
curl http://game.campus.163.com
curl http://game.campus.163.com結束後,中止ping game.campus.163.com,查看/tmp/tcpdump.txt分析抓包結果
三次握手linux
20:23:04.393437 IP 192.168.10.10.53250 > 42.186.113.26.http: Flags [S], seq 4039900133, win 29200, options [mss 1460,sackOK,TS val 304628816 ecr 0,nop,wscale 7], length 0 20:23:04.421269 IP 42.186.113.26.http > 192.168.10.10.53250: Flags [S.], seq 874076341, ack 4039900134, win 64240, options [mss 1460], length 0 20:23:04.421355 IP 192.168.10.10.53250 > 42.186.113.26.http: Flags [.], ack 1, win 29200, length 0 TCP報文格式中的控制位由6個標誌比特構成,其中一個就是ACK,ACK爲1表示確認號有效,爲0表示報文中不包含確認信息,忽略確認號字段。
四次揮手curl
20:23:05.560319 IP 192.168.10.10.53250 > 42.186.113.26.http: Flags [F.], seq 84, ack 364592, win 64240, length 0 20:23:05.560487 IP 42.186.113.26.http > 192.168.10.10.53250: Flags [.], ack 85, win 64239, length 0 20:23:05.586700 IP 42.186.113.26.http > 192.168.10.10.53250: Flags [FP.], seq 364592, ack 85, win 64239, length 0 20:23:05.586735 IP 192.168.10.10.53250 > 42.186.113.26.http: Flags [.], ack 364593, win 64240, length
總結tcp
至此,本文檔詳細展現了tcpdump的抓包實戰操做並分析了三次握手四次揮手的過程,但願能幫助到各位。ide
本文原創地址:https://www.linuxprobe.com/three-handshakes-four-waves.html編輯:傳棋,審覈員:逄增寶url