原文位址:http://blog.csdn.net/vah101/article/details/44102501
首先使用wireshark啟動抓包,然後以百度為例,通路百度的首頁,之後停止抓包,wireshark的fiter框中輸入:
http && http.host matches "baidu"
顯示出所有針對百度的get請求,在某一條get請求上右鍵點選“follow tcp stream”,會彈出一個“follow tcp stream”對話框,顯示所有與百度互動的http流,其中注意到百度的應答http頭如下:
![](https://img.laitimes.com/img/_0nNw4CM6IyYiwiM6ICdiwiIn5GcucTM2EWN4MzNwIDMxIGZ2IDZwIDNzE2NkZjZiNWYzEmYfdWbp9CXt92Yu4GZjlGbh5SZslmZxl3Lc9CX6MHc0RHaiojIsJye.png)
HTTP/1.1 200 OK
Date: Fri, 06 Mar 2015 09:34:02 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: Keep-Alive
Cache-Control: private
Expires: Fri, 06 Mar 2015 09:34:02 GMT
<span style="background-color: rgb(255, 0, 0);">Content-Encoding: gzip</span>
Server: BWS/1.1
BDPAGETYPE: 2
BDQID: 0xaba126000003d5cb
BDUSERID: 44636996
Set-Cookie: BDSVRTM=138; path=/
Set-Cookie: BD_HOME=1; path=/
Set-Cookie: H_PS_PSSID=12633_12749_11076_1457_12692_12694_12716_12721_12729_12736_12738_12743_11089_10633; path=/; domain=.baidu.com
其中說明了http的payload已經使用了gzip進行壓縮,是以在“follow tcp stream”對話框中顯示的http payload是亂碼。
此時,需要會退到wireshark的主視窗,選擇file菜單下的export objects->html,這時會顯示http objects對話框,如下所示:
根據hostname、filename選擇一條,點選save as即可儲存成html檔案