fiddler 調試器註冊到操做系統因特網服務中,系統全部的網絡請求都會走fiddler的代理,因此fiddler才能抓包。web
Debug traffic from any client and browser
Fiddler helps you debug traffic from any browser: Internet Explorer, Chrome, Firefox, Safari, Opera, and more. Once you start Fiddler, the web debugger registers itself as the system proxy for Microsoft Windows Internet Services (WinINet), the HTTP layer used by Internet Explorer, Microsoft Office, and many other products. As the system proxy, all HTTP requests from WinINet flow through Fiddler before reaching the target web servers. Similarly, all HTTP responses flow through Fiddler before being returned to the client application.
Additionally, most devices that support Wi-Fi or Ethernet can be configured to send their traffic to Fiddler; this includes iOS, Android, Windows Phone and Windows RT devices.windows
其實fiddler就是中間人攻擊,依次通過以下過程瀏覽器
以上是fiddler抓包解密的原理,這個原理是創建在https創建鏈接的基礎上的,請參考https創建鏈接過程服務器
下面開始抓包設置教程微信
File—–>capture traffic網絡
Tools—–>fiddler options—–>https—–>capture https traffic—->decrypt https traffic—>Ignore server certificate errors—->Actions—–>Trust root certificate—->以後都是肯定app
安裝根證書後,能夠點擊Actions—–>open windows certificate manager查看安裝到系統的根證書
ide
根證書的做用:fiddler對每一個域名都會生成公鑰證書,瀏覽器會用根證書驗證公鑰證書的合法性,因此,根證書是https 抓包必不可少的部分測試
咱們那支付寶登錄界面作測試,支付寶登錄頁面
this
有一種狀況,host都是tunnel to, url 後邊都帶着443,這是什麼意思呢?
查看,請求頭會發現使用了Connect方法,Connect方法一般會建議代理(fiddler)與目標服務器創建http tunnel;儘管Connect也能夠用於http,可是通常是用於SSL通訊;
CONNECT www.google.com:443
這句話表示,代理與服務器的443端口創建了http tunnel,在此以後,全部由客戶端發送的內容,都會經由http 代理,轉發給www.google.com:443端口;更多http tunnel&http connect資料能夠參考http tunnel&connect
有的時候,發現解密失敗,這是能夠查看connect的log。如圖
經過查看響應,咱們看到,是因爲沒有設置解密緻使的,
This is a CONNECT tunnel, through which encrypted HTTPS traffic flows.
Fiddler’s HTTPS Decryption feature is enabled, but this specific tunnel was configured not to be decrypted. Settings can be found inside Tools > Fiddler Options > HTTPS.
A SSLv3-compatible ServerHello handshake was found. Fiddler extracted the parameters below.
Tools > Fiddler Options > HTTPS,選中解密https,選擇正確的來源,解密成功。
固然,若是不想顯示Connect,你也能夠設置rules----->hide connects
隱藏connect;
若是仍是解密失敗,能夠查看Log標籤頁,錯誤信息都會在這裏邊顯示。
有網友跟我說,抓不到手機微信的數據,這是由於,微信走的http2協議,fiddler不支持http2協議,因此用wireshark抓,但http2也是加密的,因此抓到的數據看不懂。
若是是抓手機 https,請參考這篇文章fiddler 手機 https 抓包 ,對於手機 https抓包作了更有針對性的解釋。