├── CustomRules.js ├── README.md ├── assets └── screenshot │ ├── screenshot01.png │ └── screenshot02.png └── doc ├── FiddlerScript_api_reference.md ├── Fiddler教程.md └── img ├── UI_base.png ├── downloadFiddler01.png ├── downloadFiddler_dec01.png ├── downloadFiddler_dec02.png ├── downloadFiddler_dec03.png └── pic001.png /CustomRules.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Fiddler CustomRules 3 | * @Version 2.2.2 4 | * @Author xxxily 5 | * @home https://github.com/xxxily/Fiddler-plus 6 | * @bugs https://github.com/xxxily/Fiddler-plus/issues 7 | */ 8 | 9 | /** 10 | * 全局配置项 11 | * 可配置链接类型的颜色,代理、替换地址等, 12 | * 默认对象的键【key】为要匹配的规则,值【key】为匹配后的配置 13 | */ 14 | var GLOBAL_SETTING: Object = { 15 | // 全局开启禁止缓存功能【不建议开启,严重影响上网体验】 16 | disableCaching: false, 17 | // 自定义禁止缓存列表【针对性禁止缓存,进行项目调试的时候不影响其它网站的上网体验】 18 | disableCachingList: [ 19 | "xxxily.com.cn|xxxily.net.cn", 20 | // 禁止本地所有连接的缓存,包括IP为192段或127段的所有地址 21 | // "http://localhost|http://192|http://127", 22 | // "https://localhost|https://192|https://127" 23 | ], 24 | // 过滤配置【用于过滤出哪些URL需要显示,哪些需要隐藏】 25 | Filter: { 26 | // 只显示URL包含以下字符的连接 27 | showLinks:[ 28 | // "qq.com", 29 | // "baidu.com" 30 | ], 31 | // 不能直接吧 :443规则写在 hideLinks 过滤项上,否则大部分的无关链接都会被间接隐藏 32 | // Tunnel To 影响前端审查,隐藏掉,目前无法彻底隐藏,逻辑待优化 33 | hideTunnelTo:true, 34 | // 隐藏URL包含以下字符串的连接 过滤 35 | hideLinks: [ 36 | /*隐藏静态资源*/ 37 | // ".jpg|.jpeg|.png|.gif", 38 | // "baidu.com|qzone.qq.com|qq.com", 39 | /*隐藏热更新时的请求*/ 40 | // "browser-sync|sockjs-node", 41 | // "192.168", 42 | // "hm.baidu.com", 43 | // "google.com|googleapis.com|mail.google|www.google", 44 | ], 45 | // 头部字段过滤器,除非您很熟悉或想测试下这部分功能,否则不建议您使用该过滤项 46 | headerFieldFilter: [ 47 | { 48 | //可选值 Referer Content-Type|Cookie|User-Agent|Accept-Language|Host 等,只要是头部支持的值都可以 49 | fieldName:'Referer', 50 | workAt:'request', // request|response 51 | display:true, 52 | filterList:[ 53 | 'xxxily.cc' 54 | ], 55 | enabled: false 56 | } 57 | ], 58 | // 只显示以下文件类型【注意:是根据header的 Content-Type字段进行匹配的,所以js文件直接写js是不行的,但支持模糊匹配 】 59 | // 附注:使用ContentType过滤的时候不一定准确,不带 ContentType的连接会被自动隐藏,该过滤选项的逻辑还有待优化和完善 60 | showContentType: [ 61 | // "image" 62 | // "css", 63 | // "html", 64 | // "javascript" 65 | ], 66 | // 隐藏以下文件类型 67 | hideContentType: [ 68 | // "image" 69 | // "css", 70 | // "html", 71 | // "javascript" 72 | ] 73 | }, 74 | // 替换URL【可用于多环境切换、解决跨域、快速调试线上脚本等】 75 | replace:{ 76 | "http://xxxily.com/":"http://xxxily.cc/", 77 | /*替换成本地某个对应目录下的文件*/ 78 | "http://xxxily.com/m":"D:\\work\\" 79 | }, 80 | // 替换URL的高级版,可以实现多个项目区分管理,进行二级匹配等 81 | replacePlus:[ 82 | { 83 | describe:"将【xxxily】服务器上的静态资源替换成本地服务器上的资源", 84 | source:[ 85 | "http://xxxily.net", 86 | "http://xxxily.org", 87 | "http://xxxily.ac.cn", 88 | "http://xxxily.cc" 89 | ], 90 | /*Referer限定,方便精确控制【注意:Referer限定会导致只能在当前限定页面下查看后续链接,否则会不能正常代理】*/ 91 | Referer:[ 92 | '\\w*.html' 93 | ], 94 | subRules:[ 95 | { 96 | describe:"subRules 字段跟父级字段完全一致,主要是方便对特殊情况进行单独处理" 97 | } 98 | ], 99 | urlContain:"\\.html|\\.css|\\.js|\\.jpeg|\\.jpg|\\.png|\\.gif|\\.mp4|\\.flv|\\.webp", 100 | replaceWith:"http://localhost:3000", 101 | enabled:false 102 | }, 103 | { 104 | describe:"将【本地】请求的接口替换成某个服务器上的接口内容", 105 | source:[ 106 | "http://localhost:3000/", 107 | "http://127.0.0.1:3000/", 108 | "http://192.168.0.101:3000/" 109 | ], 110 | urlContain:"", 111 | urlUnContain:"\\.html|\\.css|\\.js|\\.jpeg|\\.jpg|\\.png|\\.gif|\\.ico|\\.mp4|\\.flv|\\.webp|/browser-sync/", 112 | // bgColor:"#2c2c2c", 113 | color:"#FF0000", 114 | // bold:"true", 115 | replaceWith:"http://xxxily.cc/", 116 | enabled:false 117 | } 118 | ], 119 | 120 | // 脚本注入 121 | scriptInject:[ 122 | { 123 | describe:"脚本注入使用示例", 124 | // 要注入的脚本路径,可以是本地目录下的脚本,也可以是线上URL脚本 125 | scriptPath:"D:\\work\\debugTools\\commonInject.js", 126 | // 指定脚本要放置在哪个dom标签里面,默认html 可选值有:html,body,head,title 127 | tagName:"head", 128 | // 指定放置在标签的哪个位置,默认是before 可选值有 before,after 129 | // position:'after', 130 | /*禁止注入脚本的缓存,也就是为scriptPath增加时间戳参数,默认true*/ 131 | noCaching:true, 132 | /*条件限定*/ 133 | urlContain:[], 134 | urlUnContain:[], 135 | enabled: false 136 | } 137 | ], 138 | 139 | // callbackAcion 主要用于自由度更高得自定义操作,通常是为了实现某些特定的功能 140 | // 例如修改某个接口的数据,从而跳过界面的操作的设定值,进行某些功能的破解或自动化操作 141 | // 注意:如果匹配的链接过多,很容易导致:数组下标超限/未将对象应用设置到对象实例等错误弹窗提示 142 | callbackAcion:[ 143 | { 144 | describe: "回调操作示例代码", 145 | source:[ 146 | 'http://xxxily.cc/dispather-app/dispacher\\?method=dispacher' 147 | ], 148 | // exclude:[], 149 | include:[ 150 | '.html', 151 | '.jsp' 152 | ], 153 | // 可选值有:OnBeforeRequest OnPeekAtResponseHeaders OnBeforeResponse OnDone OnReturningError ,想匹配多个事件可以使用|进行分隔 154 | onEvent:'OnBeforeRequest', 155 | callback:function(oSession,eventName){ 156 | var t = this; 157 | console.log(eventName); 158 | 159 | if(eventName === 'OnBeforeRequest'){ 160 | var Cookie = oSession.oRequest['Cookie']; 161 | if(Cookie){ 162 | console.log(Cookie); 163 | }else { 164 | console.log('没找到对应的 Cookie'); 165 | } 166 | console.log('callbackTest:',oSession.fullUrl); 167 | oSession.oRequest['Cookie'] = "aaa"; 168 | } 169 | 170 | }, 171 | enabled: false 172 | }, 173 | { 174 | describe: "篡改登录信息示例", 175 | source:[ 176 | 'https://xxxily.cc/portal/userLoginAction!checkUser.action' 177 | ], 178 | onEvent:'OnBeforeRequest', 179 | callback:function(oSession,eventName){ 180 | var webForms = oSession.GetRequestBodyAsString(), 181 | strConv = coreApi.strConv, 182 | webFormsObj = strConv.parse(webForms); 183 | 184 | webFormsObj['username'] = "testUser"; 185 | webFormsObj['password'] = "testPw"; 186 | 187 | /*重设请求参数*/ 188 | oSession.utilSetRequestBody(strConv.stringify(webFormsObj)); 189 | }, 190 | enabled: false 191 | }, 192 | { 193 | describe: "本地脚本注入示例", 194 | source:[ 195 | "xxxily.net.cn", 196 | "xxxily.com.cn" 197 | ], 198 | include:[ 199 | '.html', 200 | '.jsp', 201 | 'vendor.js', 202 | 'commonInjectForDebug' 203 | ], 204 | onEvent:'OnBeforeResponse', 205 | callback:function(oSession,eventName){ 206 | 207 | /*给HTML页面注入调试脚本*/ 208 | if ( oSession.oResponse.headers.ExistsAndContains("Content-Type", "text/html") && oSession.utilFindInResponse("
", false)>-1 ){ 209 | 210 | oSession.utilDecodeResponse(); 211 | var oBody = System.Text.Encoding.UTF8.GetString(oSession.responseBodyBytes); 212 | 213 | /*注入到head标签之前*/ 214 | var oRegEx = /
/i, 215 | scriptList = [ 216 | '', 217 | '\n
'
218 | ];
219 | oBody = oBody.replace(oRegEx, scriptList.join(''));
220 |
221 | oSession.utilSetResponseBody(oBody);
222 | }
223 |
224 | /*将注入的脚本地址内容替换成本地文件,实现本地脚本内容注入*/
225 | if( oSession.fullUrl.indexOf('commonInjectForDebug') > -1 ){
226 | oSession["x-replywithfile"] ="D:\\work\\debugTools\\commonInject.js";
227 | }
228 |
229 | },
230 | enabled: true
231 | }
232 | ],
233 |
234 | // 进行字符串查找,如果查找到将在Log面板显示查找结果
235 | Search: {
236 | inRequestHeaders: [],
237 | inResponseHeaders: [],
238 | inResponseBody: []
239 | },
240 |
241 | // 界面显示配置【可以对不同链接进行颜色标识,以便快速定位相关链接】
242 | UI: {
243 | // 默认文本颜色
244 | color: "#c0c0c0",//灰白色
245 | // 默认背景颜色
246 | bgColor: "#2c2c2c",//浅黑
247 | bgColor_02: "#2f2f2f",//浅黑【用于做交替背景,可以不设置】
248 | // bgColor_02:"#4b4a4a",
249 | // 链接返回报错时的颜色
250 | onError: {
251 | // bgColor:"#2c2c2c",
252 | color: "#FF0000" //错误红
253 | // ,bold:"true"
254 | },
255 | // 不同关键词匹配对应的连接颜色,key 对应的是匹配的关键字,val对应的是匹配的颜色
256 | linkColor: {
257 | "^http": "#ccccff",
258 | "^https": "#ccffff",
259 | "\\.jpg|\\.png|\\.gif": "#ffccff", //粉紫色
260 | "\\.js": "#00ff00", //原谅色
261 | "\\.css": "#ffcc66", //米黄
262 | "\\.html": "#00d7ff", //蓝色
263 | "\\.php": "#fff32d", //大黄
264 | "\\.jsp": "#fd4107" //砖红
265 | },
266 | // 根据 contentType 匹配连接颜色
267 | contentTypeColor: {
268 | "image": "#ffccff",
269 | "css": "#ffcc66",
270 | // html 类型容易跟其他接口数据混淆,无特别明确情况下不建议对其进行特殊标识
271 | // "html":"#00d7ff",
272 | "javascript": "#00ff00"
273 | },
274 | // 可以为特殊状态码设置不同颜色,方便快速定位一些错误链接,例如404等
275 | // 注意:这个只是根据responseCode 来匹配的,一些不存在response的链接配置是无效的,例如 502,504状态,应该是在onError里配置的
276 | statusCode: {
277 | "404|408|500|502|504": "#FF0000", //错误红
278 | "304": "#5e5e5e" //浅灰色
279 | },
280 | // 高亮,对特殊的链接进行高亮设置,方便跟踪查看链接
281 | highlight: {
282 | /*
283 | ".action": {
284 | color: "#FF0000", //警告红
285 | describe: "标红接口,好快速定位接口连接"
286 | },
287 | */
288 | /*
289 | "positionAjax.json": {
290 | color: "#FF0000", //警告红
291 | describe: "标红接口,好快速定位接口连接"
292 | },
293 | */
294 | /*
295 | "http://localhost|192.168":{
296 | // bgColor:"#2c2c2c", //浅黑
297 | color:"#00ff00", //原谅色
298 | bold:"true",
299 | describe:"高亮测试"
300 | },
301 | "youdao.com":{
302 | bgColor:"#FF0000", //红色
303 | color:"#fdf404", //黄色
304 | bold:"true",
305 | describe:"高亮测试"
306 | },
307 | "google.com|googleapis.com":{
308 | bgColor:"#00ff00", //原谅色
309 | color:"#fdf404", //黄色
310 | bold:"true",
311 | describe:"高亮测试"
312 | },
313 | */
314 | "": ""
315 | }
316 | },
317 | // 一些实用工具集,先列个可能会开发的工具集,留个坑以后有时间再开发
318 | Tools: {
319 | // TODO API 测试工具
320 | apiTest: {},
321 | // TODO 重放攻击工具>
322 | replay: {},
323 | // TODO 内容注入工具
324 | contentInject: {},
325 | // TODO 类似 weinre 这样的注入调试工具
326 | weinre: {}
327 | },
328 | // 多项分隔符号【同一个配置需匹配多项规则时可以通过分隔符进行区分,这样就不用每个规则都要新开一份配置那么繁琐】
329 | splitStr: "|",
330 | // 正则匹配的修饰符:i,g,m 默认i,不区分大小写
331 | regAttr: "i"
332 | };
333 | //全局配置项 END
334 |
335 | // 调试方法 BEGIN
336 | if (!console) {
337 | var console = {};
338 | console.log = function (arg1, arg2, arg3, arg4, arg5, arg6) {
339 | // 不支持 arguments ,尴尬!
340 | var args = [arg1, arg2, arg3, arg4, arg5, arg6];
341 | var argsLen = 0;
342 | for (var i = 0; i < args.length; i++) {
343 | var arg = args[i];
344 | if (typeof arg === "undefined") {
345 | break;
346 | }
347 | argsLen += 1;
348 |
349 | var argType = typeof arg;
350 |
351 | if (argType === "string" || argType === "number") {
352 | FiddlerObject.log(arg);
353 | } else if (argType === "boolean") {
354 | FiddlerObject.log("boolean:" + arg);
355 | } else if (argType === "object" && arg.toString) {
356 | FiddlerObject.log(arg.toString());
357 | } else {
358 | try {
359 | FiddlerObject.log("尝试遍历输出:" + argType);
360 | for (var str = "" in arg) {
361 | FiddlerObject.log(str + ":" + arg[str]);
362 | }
363 | } catch (ex) {
364 | FiddlerObject.log("遍历输出失败:" + ex);
365 | FiddlerObject.log(arg);
366 | }
367 | }
368 | }
369 | if (argsLen > 1) {
370 | FiddlerObject.log("----------------------------------------------");
371 | }
372 | }
373 | }
374 | if (!alert) {
375 | var alert = FiddlerObject.alert;
376 | }
377 | // 调试方法 END
378 |
379 | /*核心API 内置一些常用的方法 BEGIN*/
380 | var coreApi: Object = {
381 | /*字符串转换器*/
382 | strConv:{
383 | /**
384 | * 把具有某些规则的字符串转换为对象字面量,例如:a=1&b=2&c=3
385 | * @param regularStr (String) -必选,某个规则的字符串
386 | * #param splitStr (String) -可选 分隔符,默认&
387 | */
388 | parse:function parse (regularStr,splitStr) {
389 | var str = regularStr || '',
390 | splitStr = splitStr || '&',
391 | obj = {},
392 | arr = str.split(splitStr),
393 | len = arr.length;
394 |
395 | for(var i = 0 ; i < len ; i++){
396 | var curArr = arr[i].split('=');
397 | obj[curArr[0]] = curArr[1];
398 | }
399 | if(!str){
400 | obj = {} ;
401 | }
402 | return obj ;
403 | },
404 | /**
405 | * 把使用上面的parse方法转换的对象,重新转换成字符串表达形式
406 | * @param obj (object) -必选,某个对象
407 | * #param splitStr (String) -可选 分隔符,默认&
408 | */
409 | stringify:function (obj,splitStr) {
410 | if(!obj){
411 | return ;
412 | }
413 | var splitStr = splitStr || '&',
414 | strArr = [] ;
415 | for (var key in obj) {
416 | var val = obj[key],
417 | valType = typeof val ;
418 | if( (valType === 'string' || valType === 'number') && val != "" ){
419 | strArr.push(key+'='+val);
420 | }else if(valType === 'object'){
421 | /*二级对象是不支持的,为了不报错,将二级对象使用[object]进行代替*/
422 | strArr.push(key+'='+'[object]');
423 | }
424 | }
425 | return strArr.join(splitStr);
426 | }
427 | }
428 | };
429 | /*核心常用API 内置一些常用的方法 END*/
430 |
431 | /**
432 | * 自动移除禁止项,减少后续逻辑不必要的循环消耗
433 | * @param obj 要操作的对象
434 | */
435 | function removeDisableItem(source) {
436 | var me = this,
437 | result = {}
438 | ;
439 | if(typeof source != 'object'){
440 | return source;
441 | }
442 | if (Object.prototype.toString.call(source) === '[object Array]') {
443 | result = [];
444 | }
445 | if (Object.prototype.toString.call(source) === '[object Null]') {
446 | result = null;
447 | }
448 | for (var key in source) {
449 | if(typeof source[key] === 'object'){
450 | /*跳过enabled为false的项目*/
451 | if(Object.prototype.toString.call(source[key]) === '[object Object]' && source[key]['enabled'] === false){
452 | continue;
453 | }else {
454 | result[key] = removeDisableItem(source[key])
455 | }
456 | }else{
457 | result[key] = source[key]
458 | }
459 | }
460 | return result;
461 | }
462 |
463 | // 实测 GLOBAL_SETTING 每个请求都要加载一次,所以此优化可能出现反效果,后续如果出现很多enabled为false的配置再开启实测下
464 | // GLOBAL_SETTING = removeDisableItem(GLOBAL_SETTING);
465 |
466 |
467 | // .NET Framework API document
468 | // https://docs.microsoft.com/zh-cn/dotnet/api/index?view=netframework-4.7.2
469 | import System;
470 | import System.Windows.Forms;
471 | import Fiddler;
472 | // INTRODUCTION
473 | //
474 | // Well, hello there!
475 | //
476 | // Don't be scared! :-)
477 | //
478 | // This is the FiddlerScript Rules file, which creates some of the menu commands and
479 | // other features of Fiddler. You can edit this file to modify or add new commands.
480 | //
481 | // The original version of this file is named SampleRules.js and it is in the
482 | // \Program Files\Fiddler\ folder. When Fiddler first runs, it creates a copy named
483 | // CustomRules.js inside your \Documents\Fiddler2\Scripts folder. If you make a
484 | // mistake in editing this file, simply delete the CustomRules.js file and restart
485 | // Fiddler. A fresh copy of the default rules will be created from the original
486 | // sample rules file.
487 |
488 | // The best way to edit this file is to install the FiddlerScript Editor, part of
489 | // the free SyntaxEditing addons. Get it here: http://fiddler2.com/r/?SYNTAXVIEWINSTALL
490 |
491 | // GLOBALIZATION NOTE: Save this file using UTF-8 Encoding.
492 |
493 | // JScript.NET Reference
494 | // http://fiddler2.com/r/?msdnjsnet
495 | //
496 | // FiddlerScript Reference
497 | // http://fiddler2.com/r/?fiddlerscriptcookbook
498 |
499 | class Handlers {
500 | // *****************
501 | //
502 | // This is the Handlers class. Pretty much everything you ever add to FiddlerScript
503 | // belongs right inside here, or inside one of the already-existing functions below.
504 | //
505 | // *****************
506 |
507 | // The following snippet demonstrates a custom-bound column for the Web Sessions list.
508 | // See http://fiddler2.com/r/?fiddlercolumns for more info
509 | /*
510 | public static BindUIColumn("Method", 60)
511 | function FillMethodColumn(oS: Session): String {
512 | return oS.RequestMethod;
513 | }
514 | */
515 |
516 | // The following snippet demonstrates how to create a custom tab that shows simple text
517 | /*
518 | public BindUITab("Flags")
519 | static function FlagsReport(arrSess: Session[]):String {
520 | var oSB: System.Text.StringBuilder = new System.Text.StringBuilder();
521 | for (var i:int = 0; i
9 | ~~ps:文档比代码难写多了!有木有。。。~~
10 |
11 |
12 | ## 特点
13 | * 自定义皮肤,通过简单配置即可拥有跟你喜爱的编辑器一样的界面风格
14 | * 高亮特殊链接,一眼便可定位后台接口、快速区分前端各类静态资源
15 | * 快速切换运行环境,无需重启、即刻生效,环境再多也不凌乱
16 | * 简单配置即可彻底解决跨域开发的窘境
17 | * 强大的过滤功能,轻松过滤无关链接
18 |
19 |
20 | ## 优点&目标
21 | 功能强大、配置简单
22 |
23 | ## 界面截图
24 | 
25 |
26 | 
27 |
28 | ## 使用方式
29 |
30 | 下载当前的 CustomRules.js ,替换掉Fiddler自带的 CustomRules.js 。
31 | 正常情况下文件的所在目录为:
32 |
33 | %USERPROFILE%\Documents\Fiddler2\Scripts
34 |
35 | 你也可以通过Fiddle菜单栏下的 Rules》Customize Rules... 即可打开编辑CustomRules
36 |
37 | ## 全局配置项一览
38 | ```javascript
39 | /**
40 | * 全局配置项
41 | * 可配置链接类型的颜色,代理、替换地址等,
42 | * 默认对象的键【key】为要匹配的规则,值【key】为匹配后的配置
43 | */
44 | var GLOBAL_SETTING:Object = {
45 | // 开启或禁止缓存
46 | disableCaching:true,
47 | // 过滤配置【用于过滤出哪些URL需要显示,哪些需要隐藏】
48 | Filter:{
49 | // 只显示URL包含以下字符的连接
50 | showLinks:[
51 | // "qq.com",
52 | // "baidu.com",
53 | // "youdao.com"
54 | ],
55 | // 不能直接吧 :443规则写在 hideLinks 过滤项上,否则大部分的无关链接都会被间接隐藏
56 | // Tunnel To 影响前端审查,隐藏掉,目前无法彻底隐藏,逻辑待优化
57 | hideTunnelTo:true,
58 | // 隐藏URL包含以下字符串的连接 过滤
59 | hideLinks:[
60 | // "baidu.com|qzone.qq.com|qq.com",
61 | "hm.baidu.com",
62 | "google.com|googleapis.com"
63 | ],
64 | // 只显示以下文件类型【注意:是根据header的 Content-Type字段进行匹配的,所以js文件直接写js是不行的,但支持模糊匹配 】
65 | // 附注:使用ContentType过滤的时候不一定准确,不带 ContentType的连接会被自动隐藏,该过滤选项的逻辑还有待优化和完善
66 | showContentType:[
67 | // "image"
68 | // "css",
69 | // "html",
70 | // "javascript"
71 | ],
72 | // 隐藏以下文件类型
73 | hideContentType:[]
74 | },
75 | // 替换URL【可用于多环境切换、解决跨域、快速调试线上脚本等】
76 | replace:{
77 | "http://xxxily.com/":"http://xxxily.cc/",
78 | /*替换成本地某个对应目录下的文件*/
79 | "http://xxxily.com/m":"D:\\work\\"
80 | },
81 | // 替换URL的高级版,可以实现多个项目区分管理,进行二级匹配等
82 | replacePlus:[
83 | {
84 | describe:"将【xxxily】服务器上的静态资源替换成本地服务器上的资源",
85 | source:[
86 | "http://xxxily.net",
87 | "http://xxxily.org",
88 | "http://xxxily.ac.cn",
89 | "http://xxxily.cc"
90 | ],
91 | /*Referer限定,方便精确控制*/
92 | Referer:[
93 | '\\w*.html'
94 | ],
95 | subRules:[
96 | {
97 | describe:"subRules 字段跟父级字段完全一致,主要是方便对特殊情况进行单独处理"
98 | }
99 | ],
100 | urlContain:"\\.html|\\.css|\\.js|\\.jpeg|\\.jpg|\\.png|\\.gif|\\.mp4|\\.flv|\\.webp",
101 | replaceWith:"http://localhost:3000",
102 | enabled:false
103 | },
104 | {
105 | describe:"将【本地】请求的接口替换成某个服务器上的接口内容",
106 | source:[
107 | "http://localhost:3000/",
108 | "http://127.0.0.1:3000/",
109 | "http://192.168.0.101:3000/"
110 | ],
111 | urlContain:"",
112 | urlUnContain:"\\.html|\\.css|\\.js|\\.jpeg|\\.jpg|\\.png|\\.gif|\\.ico|\\.mp4|\\.flv|\\.webp|/browser-sync/",
113 | // bgColor:"#2c2c2c",
114 | color:"#FF0000",
115 | // bold:"true",
116 | replaceWith:"http://xxxily.cc/",
117 | enabled:false
118 | }
119 | ],
120 |
121 | // 脚本注入
122 | scriptInject:[
123 | {
124 | describe:"脚本注入使用示例",
125 | // 要注入的脚本路径,可以是本地目录下的脚本,也可以是线上URL脚本
126 | scriptPath:"D:\\work\\debugTools\\commonInject.js",
127 | // 指定脚本要放置在哪个dom标签里面,默认html 可选值有:html,body,head,title
128 | tagName:"head",
129 | // 指定放置在标签的哪个位置,默认是before 可选值有 before,after
130 | position:'after',
131 | /*禁止注入脚本的缓存,也就是为scriptPath增加时间戳参数,默认true*/
132 | noCaching:true,
133 | /*条件限定*/
134 | urlContain:[],
135 | urlUnContain:[],
136 | enabled: false
137 | }
138 | ],
139 |
140 | // 注意:如果匹配的链接过多,很容易导致:数组下标超限/未将对象应用设置到对象实例等错误弹窗提示
141 | callbackAcion:[
142 | {
143 | describe: "回调操作示例代码",
144 | source:[
145 | 'http://xxxily.cc/dispather-app/dispacher\\?method=dispacher'
146 | ],
147 | // exclude:[],
148 | include:[
149 | '.html',
150 | '.jsp'
151 | ],
152 | // 可选值有:OnBeforeRequest OnPeekAtResponseHeaders OnBeforeResponse OnDone OnReturningError ,想匹配多个事件可以使用|进行分隔
153 | onEvent:'OnBeforeRequest',
154 | callback:function(oSession,eventName){
155 | var t = this;
156 | console.log(eventName);
157 |
158 | if(eventName === 'OnBeforeRequest'){
159 | var Cookie = oSession.oRequest['Cookie'];
160 | if(Cookie){
161 | console.log(Cookie);
162 | }else {
163 | console.log('没找到对应的 Cookie');
164 | }
165 | console.log('callbackTest:',oSession.fullUrl);
166 | oSession.oRequest['Cookie'] = "aaa";
167 | }
168 |
169 | },
170 | enabled: false
171 | },
172 | {
173 | describe: "篡改登录信息示例",
174 | source:[
175 | 'https://xxxily.cc/portal/userLoginAction!checkUser.action'
176 | ],
177 | onEvent:'OnBeforeRequest',
178 | callback:function(oSession,eventName){
179 | var webForms = oSession.GetRequestBodyAsString(),
180 | strConv = coreApi.strConv,
181 | webFormsObj = strConv.parse(webForms);
182 |
183 | webFormsObj['username'] = "testUser";
184 | webFormsObj['password'] = "testPw";
185 |
186 | /*重设请求参数*/
187 | oSession.utilSetRequestBody(strConv.stringify(webFormsObj));
188 | },
189 | enabled: false
190 | },
191 | {
192 | describe: "本地脚本注入示例",
193 | source:[
194 | "xxxily.net.cn",
195 | "xxxily.com.cn"
196 | ],
197 | include:[
198 | '.html',
199 | '.jsp',
200 | 'vendor.js',
201 | 'commonInjectForDebug'
202 | ],
203 | onEvent:'OnBeforeResponse',
204 | callback:function(oSession,eventName){
205 |
206 | /*给HTML页面注入调试脚本*/
207 | if ( oSession.oResponse.headers.ExistsAndContains("Content-Type", "text/html") && oSession.utilFindInResponse("", false)>-1 ){
208 |
209 | oSession.utilDecodeResponse();
210 | var oBody = System.Text.Encoding.UTF8.GetString(oSession.responseBodyBytes);
211 |
212 | /*注入到head标签之前*/
213 | var oRegEx = //i,
214 | scriptList = [
215 | '',
216 | '\n'
217 | ];
218 | oBody = oBody.replace(oRegEx, scriptList.join(''));
219 |
220 | oSession.utilSetResponseBody(oBody);
221 | }
222 |
223 | /*将注入的脚本地址内容替换成本地文件,实现本地脚本内容注入*/
224 | if( oSession.fullUrl.indexOf('commonInjectForDebug') > -1 ){
225 | oSession["x-replywithfile"] ="D:\\work\\debugTools\\commonInject.js";
226 | }
227 |
228 | },
229 | enabled: true
230 | }
231 | ],
232 |
233 | // 进行字符串查找,如果查找到将在Log面板显示查找结果
234 | Search: {
235 | inRequestHeaders: [],
236 | inResponseHeaders: [],
237 | inResponseBody: []
238 | },
239 |
240 | // 界面显示配置【可以对不同链接进行颜色标识,以便快速定位相关链接】
241 | UI:{
242 | // 默认文本颜色
243 | color:"#c0c0c0",//灰白色
244 | // 默认背景颜色
245 | bgColor:"#2c2c2c",//浅黑
246 | bgColor_02:"#2f2f2f",//浅黑【用于做交替背景,可以不设置】
247 | // bgColor_02:"#4b4a4a",
248 | // 链接返回报错时的颜色
249 | onError:{
250 | // bgColor:"#2c2c2c",
251 | color:"#FF0000" //错误红
252 | // ,bold:"true"
253 | },
254 | // 不同关键词匹配对应的连接颜色,key 对应的是匹配的关键字,val对应的是匹配的颜色
255 | linkColor:{
256 | "\\.jpg|\\.png|\\.gif":"#ffccff", //粉紫色
257 | "\\.js":"#00ff00", //原谅色
258 | "\\.css":"#ffcc66", //米黄
259 | "\\.html":"#00d7ff", //蓝色
260 | "\\.php":"#fff32d", //大黄
261 | "\\.jsp":"#fd4107" //砖红
262 | },
263 | // 可以为特殊状态码设置不同颜色,方便快速定位一些错误链接,例如404等
264 | // 注意:这个只是根据responseCode 来匹配的,一些不存在response的链接配置是无效的,例如 502,504状态,应该是在onError里配置的
265 | statusCode:{
266 | "404|408|500|502|504":"#FF0000", //错误红
267 | "304":"#5e5e5e" //浅灰色
268 | },
269 | // 高亮,对特殊的链接进行高亮设置,方便跟踪查看链接
270 | highlight:{
271 | "http://localhost|192.168":{
272 | // bgColor:"#2c2c2c", //浅黑
273 | color:"#00ff00", //原谅色
274 | bold:"true",
275 | describe:"高亮测试"
276 | },
277 | "hm.baidu.com":{
278 | bgColor:"#FF0000", //红色
279 | color:"#fdf404", //黄色
280 | bold:"true",
281 | describe:"高亮测试"
282 | },
283 | "":""
284 | }
285 | },
286 | // 一些实用工具集,先列个可能会开发的工具集,留个坑以后有时间再开发
287 | Tools:{
288 | // TODO API 测试工具
289 | apiTest:{},
290 | // TODO 重放攻击工具
291 | replay:{},
292 | // TODO 内容注入工具
293 | contentInject:{},
294 | // TODO 类似 weinre 这样的注入调试工具
295 | weinre:{}
296 | },
297 | // 多项分隔符号【同一个配置需匹配多项规则时可以通过分隔符进行区分,这样就不用每个规则都要新开一份配置那么繁琐】
298 | splitStr:"|",
299 | // 正则匹配的修饰符:i,g,m 默认i,不区分大小写
300 | regAttr:"i"
301 | };
302 | //全局配置项 END
303 | ```
304 |
305 | 如果需要进行要禁用某些规则,只需在菜单栏里面操作选择开启或禁用即可:Rules > Fiddler-plus
306 |
307 |
308 | 特别说明:Fiddler 的 CustomRules.js 修改配置保存后是会自动立即生效的,无需重启
309 | 所以做服务器代理转发、切换开发环境的时候,写好配置后,只需打开或注释掉某行配置,然后保存即可实现实时切换
310 |
311 |
312 | 目前主要实现了:代理、替换、过滤、UI(skin)等功能;已经可满足绝大部分开发需求了,后续将继续完善
313 |
314 | 暂时先这样,后续等代码完善好了再补充说明文档...
315 |
316 | ## 开发计划:
317 | 1、完善替换功能,实现替换本地文件
318 | 2、完善搜索查找功能
319 | 2、实现搜索替换和注入等功能
320 | ~~1、UI(skin)后续打算实现成多套可选的形式,然后可以针对域名指定不同的配色方案,这样就不用隐藏连接也可以快速区分哪些是当前需要关注的连接。~~
321 |
322 | ~~2、全局禁止缓存感觉很蠢,严重影响正常上网体验,所以缓存也计划加入到 replacePlus 配置项里,针对性禁止缓存~~
323 |
324 |
325 |
--------------------------------------------------------------------------------
/assets/screenshot/screenshot01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xxxily/Fiddler-plus/e5e430e0c27acf65e26fa37ee3b067201b78870e/assets/screenshot/screenshot01.png
--------------------------------------------------------------------------------
/assets/screenshot/screenshot02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xxxily/Fiddler-plus/e5e430e0c27acf65e26fa37ee3b067201b78870e/assets/screenshot/screenshot02.png
--------------------------------------------------------------------------------
/doc/FiddlerScript_api_reference.md:
--------------------------------------------------------------------------------
1 | # FiddlerScript api 参考文档
2 |
3 | 主要是修改CustomRules时个人摘抄自 Fiddler scriptEditor 里面的API说明
4 | 有些翻译不一定准确,请自行辨别
5 |
6 |
7 | ## Seesion对象
8 | * m_clientIP:System.String 当前连接使用客户机的IP
9 | * m_clientPort:System.Int32 当前连接使用客户机的端口
10 | * oFlags:System.Collections.Specialized.StringDictionary
11 | * oRequest:Fiddler.ClientChatter HTTP的Request对象
12 | * oResponse:Fiddler.ServerChatter HTTP的Response对象
13 | * requestBodyBytes:System.Byte[] request body 包含的字节内容
14 | * responseBodyBytes:System.Byte[] response body 包含的字节内容
15 | * ViewItem:System.Windows.Forms.ListViewItem ListViewItem object associated with this session in the Session list
16 | * bHasResponse:System.Boolean 如果存在response时则返回true
17 | * bHasWebSocketMessages:System.Boolean
18 | * BitFlags:Fiddler.SessionFlags
19 | * bypassGateway:System.Boolean 如果在OnBeforeRequest中将该参数设置为true,则请求将绕过网关
20 | * clientIP:System.String 返回客户端通过Fidder的地址
21 | * clientPort:System.Int32 返回客户端通过Fidder的端口
22 | * fullUrl:System.String 返回完整的URL地址
23 | * host:System.String 设置或返回请求的host,包括端口
24 | * hostname:System.String 设置或返回请求的host名称,不包括端口
25 | * id:System.Int32 返回请求的序号
26 | * isFTP:System.Boolean 返回使用的是否为ftp协议
27 | * isHTTPS:System.Boolean 返回使用的是否为https协议
28 | * isTunnel:System.Boolean 返回使用的是否为tunnel隧道协议
29 | * Item:System.String Indexer property into session flags, collection oSession["Flagname"] return string value (or null if missing)
30 | * Item:System.String Indexer property into SESSION flags,REQUEST headers.and RESPONSE headers e.g. oSession["Requst","Host"]
31 | * LocalProcess:System.String
32 | * LocalProcessID:System.Int32
33 | * PathAndQuery:System.String 返回url的路径以及查询部分字符串
34 | * port:System.Int32 返回请求的主机端口
35 | * RequestBody:System.Byte[] 以字节的形式设置或获取请求的内容
36 | * RequestHeaders:Fiddler.HTTPRequestHeaders 获取请求的头部信息,如果不存在则返回空
37 | * RequestMethod:System.String 设置或返回请求的方法,例如:get、post等
38 | * ResponseBody:System.Byte[] 以字节的形式设置或获取response的内容
39 | * responseCode:System.Int32 设置或获取response的状态码
40 | * ResponseHeaders:Fiddler.HTTPResponseHeaders 获取回应的头部信息,如果不存在则返回空 eg:oSession.ResponseHeaders.Item("Content-Type")
41 | * state:Fiddler.SessionStates 枚举当前session的状态
42 | * SuggestedFilename:System.String 建议使用的进行文件保存时的名称
43 | * TunnelEgressByteCount:System.Int64
44 | * TunnelIngressByteCount:System.Int64
45 | * TunnelIsOpen:System.Boolean
46 | * url:System.String 在请求之前获取或设置URL(不包括端口)
47 | * actInspectInNewWindow(sActiveTab ) 对当前session新开一个审计窗口,指定tab的title
48 | * GetRequestBodyAsString() 获取request body 的字符串
49 | * GetRequestBodyEncoding() 获取request body 编码形式
50 | * GetResponseBodyAsString() 获取response body 的字符串
51 | * GetResponseBodyEncoding() 获取response body 编码形式
52 | * GetResponseBodyHash(sHashAlg ) 获取ResponseBody内容的一个md5/sha1/sha256/sha384/sha512的hash值
53 | * GetResponseBodyHashAsBase64(sHashAlgorithm )
54 | * HostnameIs(sTestHost ) 判断是否存在某个host,不包含端口
55 | * HTTPMethodIs(sTestFor ) 判断HTTP请求使用的方法
56 | * Ignore() 忽略session
57 | * LoadRequestBodyFromFile(sFilename) 使用指定的文件替换掉当前session请求的headers和body内容
58 | * LoadResponseFromFile(sFilename) 使用指定的文件替换掉当前session返回的headers和body内容
59 | * RefreshUI() 更新当前session的显示界面
60 | * SaveRequestBody(sFilename ) 保存request body到本地
61 | * SaveResponseBody() 保存HTTP response body 到Fiddler 的捉包文件夹
62 | * SaveResponseBody(sFilename ) 保存HTTP response body 到本地
63 | * uriContains(sLookfor ) 当uri包含指定字符串时返回true
64 | * utilAssignResponse(oFromSession ) 绕开未就绪的连接请求,复制一个已存在的session response 到当前session
65 | * utilAssignResponse(oRH arrBody )
66 | * utilBZIP2Response() 使用BZIP2 对 response body进行压缩. 抛出异常到caller
67 | * utilChunkResponse(iSuggestedChunkCount )
68 | * utilCreateResponseAndBypassServer() call inside OnBeforeRequest to create a Response object an bypass the server
69 | * utilDecodeRequest() 移除当前请求的chunking 和 HTTP Compression ,添加或更新hader的Content-Length字段
70 | * utilDecodeResponse()
71 | * utilDeflateResponse() 使用DEFLATE 压缩response. 抛出异常到caller
72 | * utilFindInRequest(sSearchFor bCaseSensitive ) 在request body进行字符串搜索,返回当前索引或-1
73 | * utilFindInResponse(sSearchFor bCaseSensitive )
74 | * utilGZIPRequest() 使用GZIP压缩请求内容。抛出异常到caller
75 | * utilGZIPResponse() 使用GZIP压缩response。抛出异常到caller
76 | * utilPrependToResponseBody(sString ) 将字符串插入到response body 前,更新header的Content-Length字段.注意:utilDecodeResponse
77 | * utilReplaceInRequest(sSearchFor sReplaceWith ) 替换请求的内容【区分大小写】(不是url内容),并自动更新header的Content-Length字段,如果替换成功则返回true
78 | * utilReplaceInResponse(sSearchFor sReplaceWith ) 替换返回的内容【区分大小写】,并自动更新header的Content-Length字段,如果替换成功则返回true,注意:使用该方法前应先调用utilDecodeResponse
79 | * utilReplaceOnceInResponse(sSearchFor sReplaceWith bCaseSensitive )
80 | * utilReplaceRegexInResponse(sSearchForRegEx sReplaceWithExpression )
81 | * utilSetRequestBody(sString ) 用字符串替换掉原来的请求内容,并自动更新header的Content-Length字段,移除Transfer-Encoding/Content-Encoding
82 | * utilSetResponseBody(sString ) 用字符串替换掉原来的返回内容,并自动更新header的Content-Length字段,移除Transfer-Encoding/Content-Encoding
83 | * WriteToStream(oFS bHeadersOnly ) 将session或session的header写入指定流里
84 | * FiddlerObject.log( "当前测试字段:"+oSession.GetResponseBodyEncoding() );
85 |
86 |
87 |
88 | ## oSession.oRequest.headers 对象
89 | * HTTPMethod:System.String
90 | * HTTPVersion:System.String
91 | * Item:Fiddler.HTTPHeaderItem
92 | * Item:System.String
93 | * RawPath:System.Byte[]
94 | * RequestPath:System.String
95 | * UriScheme:System.String
96 | * UriUserInfo:System.String
97 | * Add(sHeaderName sValue )
98 | * AssignFromString(sHeaders )
99 | * Count()
100 | * Exists(sHeaderName )
101 | * ExistsAndContains(sHeaderName sHeaderValue )
102 | * ExistsAndEquals(sHeaderName sHeaderValue )
103 | * ExistsAny(sHeaderNames )
104 | * GetTokenValue(sHeaderName sTokenName )
105 | * Remove(sHeaderName )
106 | * RemoveRange(arrToRemove )
107 | * RenameHeaderItems(sOldHeaderName sNewHeaderName )
108 | * ToByteArray(prependVerbLine appendEmptyLine includeProtocolInPath )
109 | * ToByteArray(prependVerbLine appendEmptyLine includeProtocolInPath sVerbLineHost )
110 | * ToString()
111 | * ToString(prependVerbLine appendEmptyLine )
112 | * ToString(prependVerbLine appendEmptyLine includeProtocolAndHostInPath )
113 |
114 | ## oSession.oResponse.headers 对象
115 | * HTTPResponseCode:System.Int32
116 | * HTTPResponseStatus:System.String
117 | * HTTPVersion:System.String
118 | * Item:Fiddler.HTTPHeaderItem
119 | * Item:System.String
120 | * StatusDescription:System.String
121 | * Add(sHeaderName sValue )
122 | * AssignFromString(sHeaders )
123 | * Count()
124 | * Exists(sHeaderName )
125 | * ExistsAndContains(sHeaderName sHeaderValue )
126 | * ExistsAndEquals(sHeaderName sHeaderValue )
127 | * ExistsAny(sHeaderNames )
128 | * GetTokenValue(sHeaderName sTokenName )
129 | * Remove(sHeaderName )
130 | * RemoveRange(arrToRemove )
131 | * RenameHeaderItems(sOldHeaderName sNewHeaderName )
132 | * ToByteArray(prependStatusLine appendEmptyLine )
133 | * ToString()
134 | * ToString(prependStatusLine appendEmptyLine )
135 |
136 |
137 | ## FiddlerObject 对象
138 | * FileExtension:System.String
139 | * Language:Fiddler.ScriptLanguage
140 | * StatusText:System.String
141 | * UI:Fiddler.frmViewer
142 | * alert(sMessage )
143 | * createDictionary()
144 | * flashWindow()
145 | * log(sMessage )
146 | * playSound(sSoundname )
147 | * prompt(sMessage )
148 | * prompt(sMessage sDefaultValue )
149 | * prompt(sMessage sDefaultValue sWindowTitle )
150 | * ReloadScript()
151 | * uiInvoke(oMI )
152 | * uiInvokeAsync(oMI args )
153 | * utilIssueRequest(sRequest )
154 | * WatchPreference(sPref oFN )
155 |
156 |
--------------------------------------------------------------------------------
/doc/Fiddler教程.md:
--------------------------------------------------------------------------------
1 | # 目录
2 | * [Fiddler介绍](#Fiddler介绍)
3 | * [Fiddler是什么](#Fiddler是什么)
4 | * [Fiddler能做什么](#Fiddler能做什么)
5 | * [Fiddler的工作原理](#Fiddler的工作原理)
6 | * [为什么选择Fiddler](#为什么选择Fiddler)
7 | * [Fiddler初级教程](#更多教程内容还在编写中...)
8 | * [完全的新手教程、主要讲解下载、安装、界面、选项等](#更多教程内容还在编写中...)
9 | * [Fiddler中级教程](#Fiddler中级教程)
10 | * [主要讲解通过Fiddler提供的各种界面选项,命令选项等进行抓包调试、技巧等](#更多教程内容还在编写中...)
11 | * [Fiddler高级教程](#更多教程内容还在编写中...)
12 | * [FiddlerScript 系统讲解,进行个性化定制、Fiddler plus 使用教程等](#更多教程内容还在编写中...)
13 |
14 | ## Fiddler是什么
15 | Fiddler是位于客户端和服务器端的HTTP(s)代理,也是目前最常用的http(s)抓包工具之一 。
16 | 它能够记录客户端和服务器之间的所有 HTTP请求,可以针对特定的HTTP请求,分析请求数据、设置断点、调试web应用、修改请求的数据,甚至可以修改服务器返回的数据,功能非常强大,是web调试的利器。
17 |
18 | ## Fiddler能做什么
19 |
20 | * 进行任意平台(PC端、移动端等)、任意应用的抓包分析与开发调试
21 | * 解决跨域开发时的接口、资源访问限制问题
22 | * 进行多环境快速切换调试
23 | * 快速调试线上脚本,排除故障
24 | * 进行弱网络环境模拟测试,暴露应用在弱网下的用户体验
25 | * 进行接口性能测试
26 | * 自动化接口测试
27 | * 模拟各种网络攻击
28 | * 还有各种不可描述的功能...
29 |
30 | ## Fiddler的工作原理
31 | Fiddler的本质是一个代理,既然是代理,也就是说:客户端的所有请求都要先经过Fiddler,然后转发到相应的服务器,反之,服务器端的所有响应,也都会先经过Fiddler然后发送到客户端。
32 | 当我们启用Fiddler之后,IE的http(s)代理会自动被设置为127.0.0.1:8888(之所以这么设置是因为Fiddler默认监听的是8888端口), 所有http(s)会话的都会被Fiddler拦截,web客户端和服务器的请求如下所示:
33 | 
34 |
35 | 至于Fiddler为啥可以抓https包,其实是利用了类似`中间人攻击`的技术,所以开启https抓包的时候需要安装个证书。
36 |
37 | ## 为什么选择Fiddler
38 | 说到抓包工具,稍微了解的都知道有很多类似的工具可用,例如:Wireshark、BurpSuite、Fiddler、Charles、HTTP Analyzer、HTTP Watch等,新兴的基于nodejs的还有:anyproxy、whistle等
39 | 那么多抓包工具,为什么偏偏要选择Fiddler呢?
40 | 原则上青菜萝卜各有所爱,每个人选择适合自己,能满足自己需求的即可。
41 | 但对于不熟悉各个工具特点的人,该如何选择适合自己的抓包软件,却是十分头痛的一件事,所以下面简单谈谈这些不同抓包工具的特点和适用范围:
42 | * [Wireshark](https://www.wireshark.org/) 是一款免费开源的网络封包分析软件,属于比较底层的抓包软件,需要比较专业的人员才能驾驭,主要面向网络管理员,网络安全工程师,普通人一般用它来学习网络协议等知识。
43 | * [BurpSuite](https://portswigger.net/burp/) 虽然也可以抓包分析,但它是用于攻击web应用程序的集成平台,包含了很多工具集,可以对web应用进行安全评估,漏洞挖掘等。 如果你是个网络安全人员,或打算往网络安全方面发展,可以学习使用。ps:这是收费产品
44 | * [HTTP Analyzer](http://www.ieinspector.com/)、[HTTP Watch](http://www.httpwatch.com/)都是是比较老牌的HTTP抓包工具了,且都属收费产品,不能进行个性化定制或个性化定制功能较弱,从搜索结果和文章更新度来看已经比较少人使用了,所以个人也不推荐使用。
45 | * [Charles](https://www.charlesproxy.com/) 界面简洁,功能强大,且同时支持Mac平台和Win平台,是不错的HTTP(s)捉包分析软件,但属于收费产品,个性化定制方面也比较弱,不喜欢折腾、且有点小钱的可以考虑。ps:什么?你有破解版?
46 | * [Fiddler](http://www.telerik.com/fiddler) 功能强大,HTTP(s)类抓包软件应有的功能都有,而且是免费,但界面一般,配置界面繁杂(这也是功能强大的一个体现吧...)~好在拥有FiddlerScript,支持个性化定制,插件开发等,你完全可以通过它打造出一个属于自己的调试工具,当然前提是你要有一定的折腾精神。本文后面的高级教程将教你如何定制自己的Fiddler,打造一个高逼格且高效的Fiddler
47 | * [anyproxy](https://github.com/alibaba/anyproxy)、[whistle](https://github.com/avwo/whistle) 是基于nodejs开发,具有良好的跨平台特性,而且源码开放,有很强的可定制性!非常适合喜欢折腾的极客“把玩”!当然目前也有不少缺点,例如进行https抓包时卡顿,存在一定的不稳定情况,anyproxy已经很久没人更新维护等。总的来说类免费、开源、跨平台的产品可以还需继续努力完善!希望有一天可以完全取代Fiddler吧!
48 |
49 | ## Fiddler初级教程
50 |
51 | 该部分纯粹为新手教程,主要讲解Fiddler的下载安装、界面、选项等,如果你不是新手,请跳过本章内容。
52 | ## 下载
53 | Fiddler的官网地址为:http://www.telerik.com/fiddler
54 | 下载地址:https://www.telerik.com/download/fiddler
55 | 进入下载页面后你将看到如下界面:
56 |
57 | 
58 |
59 | 可以看到Fiddler要求你选择一个使用它的用途,随便选择一个选项即可,
60 | 下面还有两个下载链接,一个是下载OS X(Mac)版本的Fiddler,另外一个是Linux版本的Fiddler,如果你有需要,可以点击下载安装,具体安装步骤和过程这里不介绍~
61 |
62 | 选择用途后出现如下界面:
63 |
64 | 
65 |
66 | 出现了是否同意使用的用户协议选项,选择Yes即可,然后又出现如下的填写用户邮箱界面:
67 |
68 | 
69 |
70 | 随便填写一个格式正确的邮箱地址即可点击下载按钮Z进行下载了,跳到下载页面,等待一段时间就会开始下载。
71 | 下载好后双击即可开始安装了。。。
72 |
73 | 如果你觉得以上步骤打开太慢,操作繁琐,可以到百度软件中心下载,详细地址请自行百度搜索:Fiddler 。
74 |
75 | ## 安装
76 |
77 | ## 基本界面和功能介绍
78 | 打开Fiddler,Fiddler主界面的布局如下:
79 |
80 | 
81 |
82 | 主界面中包括六打常用的模块,其中:
83 |
84 | 1、Fiddler的菜单栏包含了大量的功能操作项和设置项
85 | 2、Fiddler的工具栏,也就是菜单栏下面的一栏,包含了常用的快捷操作按钮,如清除会话信息、开启/禁止解码功能、设置sessions面板(URL面板)最大显示条数、保存会话信息、重放操作等。
86 |
87 | 3、web Session面板,主要是Fiddler抓取到的每一条http请求(每一条称为一个session),主要包含了请求的url,协议,状态码,body等信息,详细的字段含义如下:
88 |
89 | 1.[#] -- HTTP 请求的链接类型图标和请求的顺序
90 | 2.[Result] -- HTTP 响应的状态码,相关状态码信息可以参考 [这里](https://segmentfault.com/a/1190000012282437) 和 [这里](http://tool.oschina.net/commons?type=5)
91 | 3.[Protocol] -- 请求使用的协议(如 HTTP/HTTPS/WS )
92 | 4.[Host] -- 请求地址的域名
93 | 5.[URL] -- 请求的服务器路径和文件名,也包括GET参数
94 | 6.[Body] -- 请求的大小,以byte为单位
95 | 7.[Caching] -- 请求的缓存过期时间或缓存控制的 header 值
96 | 8.[Content-Type] -- 请求响应的类型([Content-Type](http://tool.oschina.net/commons))
97 | 9.[Process] -- 发出此请求的 window 进程名称或进程ID
98 | 10.[Comments] -- 用户给此 session 增加的备注信息
99 | 11.[Custom] -- 用户可以通过脚本设置的自定义值
100 |
101 |
102 |
103 |
104 | ## 更多教程内容还在编写中...
105 | 太懒了,什么时候有冲动了再继续编写。。
106 | ~~更多教程内容还在编写中,如果你急不可耐,可以阅看下面的参考资料,教程将根据这些参考资料以及个人的经验进行编写~~
107 |
108 | ## 参考资料
109 | https://www.qcloud.com/community/article/115124?fromSource=gwzcw.93596.93596.93596
110 | http://blog.csdn.net/ohmygirl/article/details/17846199
111 | [Fiddler调试权威指南 Debugging with Fiddle](https://item.jd.com/11398605.html)
--------------------------------------------------------------------------------
/doc/img/UI_base.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xxxily/Fiddler-plus/e5e430e0c27acf65e26fa37ee3b067201b78870e/doc/img/UI_base.png
--------------------------------------------------------------------------------
/doc/img/downloadFiddler01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xxxily/Fiddler-plus/e5e430e0c27acf65e26fa37ee3b067201b78870e/doc/img/downloadFiddler01.png
--------------------------------------------------------------------------------
/doc/img/downloadFiddler_dec01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xxxily/Fiddler-plus/e5e430e0c27acf65e26fa37ee3b067201b78870e/doc/img/downloadFiddler_dec01.png
--------------------------------------------------------------------------------
/doc/img/downloadFiddler_dec02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xxxily/Fiddler-plus/e5e430e0c27acf65e26fa37ee3b067201b78870e/doc/img/downloadFiddler_dec02.png
--------------------------------------------------------------------------------
/doc/img/downloadFiddler_dec03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xxxily/Fiddler-plus/e5e430e0c27acf65e26fa37ee3b067201b78870e/doc/img/downloadFiddler_dec03.png
--------------------------------------------------------------------------------
/doc/img/pic001.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xxxily/Fiddler-plus/e5e430e0c27acf65e26fa37ee3b067201b78870e/doc/img/pic001.png
--------------------------------------------------------------------------------