本文檔以實戰的形式介紹tcpdump抓包分析三次握手四次揮手的過程。
執行tcpdump指令
tcpdump -n -i ens32 host 192.168.10.10 and 42.186.113.26 >> /tmp/tcpdump.txt
ping game.campus.163.com
實戰:tcpdump抓包分析三次握手四次揮手實戰:tcpdump抓包分析三次握手四次揮手
curl
http://game.campus.163.com結束後,停止ping game.campus.163.com,檢視/tmp/tcpdump.txt分析抓包結果
三次握手
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表示封包中不包含确認資訊,忽略确認号字段。
四次揮手
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
總結
至此,本文檔詳細展示了tcpdump的抓包實戰操作并分析了三次握手四次揮手的過程,希望能幫助到各位。
本文原創位址:
https://www.linuxprobe.com/three-handshakes-four-waves.html編輯:傳棋,稽核員:逄增寶