Fiddler2成了網頁調試必備的工具,抓包看數據。Fiddler2自帶命令行控制,並提供如下用法。php
Fiddler的快捷命令框讓你快速的輸入腳本命令。css
按ALT+Q課迅速將焦點定位到快捷命令框。若Fiddler不在活躍狀態(後臺運行),可按Ctrl+Alt+F先行激活Fiddler(切換至Fiddler面板)
在QuickExec框,按CTRL + I插入會話列表中當前選定的會話的URLhtml
當您鍵入一些字符串,如sometext ,Fiddler將突出會話所在的URL中包含sometext的請求 。此時按Enter鍵將高亮選中全部匹配的會話java
1
|
?searchtext
|
選擇請求響應大小大於size字節的會話安全
1
|
>40000 //選擇大小超過40kb的響應
|
選擇請求響應大小小於size字節的會話session
1
|
<5k //選擇小於5kb的響應
|
選擇響應狀態=status 或請求方法=method的會話app
1
2
|
=301 //選擇301重定向響應
=POST //選擇POST方式的請求
|
選擇會話中域名包含host的會話,此時按Enter鍵可高亮全部匹配的結果less
1
|
@baidu.com //選擇 www.baidu.com, map.baidu.com, 等等
|
預先設置會話加粗:標記任何URL包含了目標字符串的後續請求
tip:再次輸入bold取消設置dom
1
2
|
bold /index.php
bold //調用不帶任何參數的命令來清除上一設置
|
設置中斷RequestURI中包含指定字符串的任何響應
tip:再次輸入bpafter取消設置ide
1
2
|
bpafter /favicon.ico
bpafter //取消設置
|
中斷與設置的狀態代碼匹配的響應
1
2
|
bps 404
bps //取消設置
|
對指定的HTTP方法建立請求斷點。設置此命令將清除該命令的任何之前的值,不帶參數調用它會禁用斷點
1
2
|
bpv POST
bpv //取消設置
|
對包含指定字符串的URI建立請求斷點。設置此命令將清除該命令的任何之前的值,不帶參數調用它會禁用斷點
1
2
|
bpu /index.php
bpu //取消設置
|
清空會話列表
1
|
cls
|
打包全部會話成zip歸檔文件並轉存在C:\
1
|
dump
|
恢復全部設置斷點的會話
1
|
g
|
打開幫助頁面(即本文英文版)
1
|
help
|
隱藏Fiddler界面,系統後臺運行
1
|
hide
|
以一個不一樣的字符串替換URL中任何字符串。設置此命令將清除該命令的任何之前的值,不帶參數調用它,將取消更換
1
2
|
urlreplace SeekStr ReplaceWithStr
urlreplace //取消設置
|
註冊成爲系統代理
1
|
start
|
取消註冊爲系統代理
1
|
stop
|
將Fiddler從系統托盤中恢復,從ExecAction.exe獲取更多有用的觸發規則
1
|
show
|
選擇Content- Type頭中包含指定字符串的響應,可用於選擇文件格式等
1
2
3
|
select image
select css
select htm
|
選擇已命名的header或SessionFlag包含指定字符串的響應
1
2
3
4
5
|
select ui-comments slow
select ui-bold * <-- unless preceded by a slash, * 表示任意值
select ui-comments \* <-- Find comments with a *
select @Request.Accept html <-- Find requests with Accept: html
select @Response.Set-Cookie domain <- Find responses that Set-Cookie on a domain
|
隱藏Content-Type頭中除了包含指定字符串的全部會話,用於篩選
1
2
|
allbut html
allbut java
|
退出Fiddler
1
|
quit
|
進行目標域名的DNS查找,並將結果顯示在LOG選項卡上
1
2
|
!dns www.baidu.com
!nslookup www.baidu.com
|
在另外一個端口增設一個監聽器,選擇安全的HTTPS證書
1
2
3
|
!listen 8889
!listen 4443 localhost
!listen 444 secure.example.com
|
附:
Command | Action | Sample usage |
---|---|---|
?sometext | As you typesometext, Fiddler will highlight sessions where the URL containssometext. Hit Enter to set focus to the selected matches. | ?searchtext |
>size | Select sessions where response size is greater thansize bytes. | >40000 <-- Select responses over 40kb |
<size | Select sessions where response size is less thansize bytes. | <5k <-- Select responses under 5kb |
=status =method |
Select sessions whereresponse status =status orrequest method =method. | =301 <-- Select 301 redirect responses =POST <-- Select POST requests |
@host | Select sessions where the request host contains host. Hit Enter to set focus to the selected matches. | @msn.com <-- Select www.msn.com, login.msn.com, etc |
bold | Mark any future sessions in bold if the url contains the target string | bold /bar.aspx bold <-- Call with no parameter to clear |
bpafter | Break any response where the RequestURI contains the specified string | bpafter /favicon.ico bpafter <-- Call with no parameter to clear |
bps | Break any response where the status code matches | bps 404 bps <-- Call with no parameter to clear |
bpv or bpm | Create a request breakpoint for the specified HTTP method. Setting this command will clear any previous value for the command; calling it with no parameter will disable the breakpoint. | bpv POST bpv <-- Call with no parameter to clear |
bpu | Create a request breakpoint for URIs containing the specified string. Setting this command will clear any previous value for the command; calling it with no parameter will disable the breakpoint. | bpu /myservice.asmx bpu <-- Call with no parameter to clear |
cls or clear | clear the session list | cls |
dump | dump all sessions to a zip archive in C:\ | dump |
g or go | Resume all breakpointed sessions | g |
help | show this page | help |
hide | Hide Fiddler in System tray | hide |
urlreplace | Replace any string in URLs with a different string. Setting this command will clear any previous value for the command; calling it with no parameter will cancel the replacement. | urlreplace SeekStr ReplaceWithStr urlreplace <-- Call with no parameters to clear |
start | Register as the system proxy | start |
stop | Unregister as the system proxy | stop |
show | Restore Fiddler from system tray -- more useful when triggering rules from ExecAction.exe (see below) | show |
select MIME | Select any session where the response Content-Type header contains the specified string. | select image select css select htm |
selectHeaderOrFlagPartialValue | Select any session where the named Header or SessionFlag contains the specified string. | select ui-comments slow select ui-bold * <-- unless preceded by a slash, * means any value select ui-comments \* <-- Find comments with a * select @Request.Accept html <-- Find requests with Accept: html select @Response.Set-Cookie domain <- Find responses that Set-Cookie on a domain |
allbut or keeponly | Hide all sessions except those where Content-Type header contains the specified string. | allbut xml allbut java |
quit | Shutdown Fiddler. | quit |
!dns hostname | Perform a DNS lookup of the target host and show the results on the LOG tab | !dns www.example.com !nslookup www.example.com |
!listen PORT [CERTHOSTNAME] | Set up an additional listener on another port, optionally secured by a HTTPS certificate | !listen 8889 !listen 4443 localhost !listen 444 secure.example.com |
附: Fiddler 系列教程, (連載中, 敬請期待)