oSession.responseCode === 200
oSession.uriContains("xieboke.net")
oSession.fullUrl.Contains("xieboke.net")
oSession.GetResponseBodyAsString();
var response_string = oSession.GetResponseBodyAsString();
// 字符串 转成可以操作的 json 格式
var response_json = Fiddler.WebFormats.JSON.JsonDecode(response_string);
var is_double = response_json.JSONObject["isDouble"]
oSession["ui-backcolor"] = "yellow"; // 背景色 - yellow 黄色,red 红色,green 绿色,Lavender 淡紫色
oSession["ui-color"] = "red"; // 字体颜色
oSession["ui-hide"] = "true"; // 不显示
oSession["ui-bold"]="true"; // 字体加粗
oSession["ui-italic"] = "yup"; //设置字体斜体,字符串无所谓
oSession["ui-customcolumn"] = '高佣api'; //设置Custom一列显示文案
FiddlerObject.playSound("C:\windows\media\tada.wav"); //设置请求时播放的声音
oSession.oRequest.headers; // 获取整个请求头
oSession.oRequest.headers["token"]; // 获取 请求头 token 的值
oSession.oRequest.headers.Exists("Authorization"); // 判断请求头 Authorization 是否存在
oSession.Hostname; // 获取请求的域名
oSession.port; // 获取请求的端口
oSession.RequestHeaders.Remove("User-Agent"); // 删除 User-Agent 传参
oSession.RequestHeaders["uid"] = "0"; //修改请求头
oSession.oResponse["Cache-Control"] = "no-cache";
FiddlerApplication.Log.LogString("xieboke_net_log: " + "test");
FiddlerObject.alert("弹个对话框");
MessageBox.Show("弹个框");
if (oSession.HostnameIs('baidu.com')){
oSession.hostname = '=xieboke.net';
}
if(oSession.hostname.Contains("xieboke.net") || oSession.hostname.Contains("zhuoqun.info") ){
var key="";
var request_body = oSession.GetRequestBodyAsString().replace(/"/g,"'");
var response_body = oSession.GetResponseBodyAsString().replace(/"/g,"'");
var content = "[" + oSession.responseCode + "] " + oSession.oRequest.headers + "\r\nRequests:\r\n" + request_body + "\r\nResponse:\r\n" + response_body;
//MessageBox.Show(content)
//var content="test"
var dingding_hook = "https://oapi.dingtalk.com/robot/send?access_token=xxx"
var user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"
var body = '{"msgtype": "text","text": {"content": "' + content + '"}}'
var body_length = body.toString().length;
var method = "POST";
var myUrl = dingding_hook;
var url = myUrl;
var protocol = "HTTP/1.1";
var raw="";
raw += method + " " + url + " " + protocol + "\r\n";
raw += "User-Agent:" + user_agent + "\r\n";
raw += "Content-Length:" + body_length + "\r\n";
raw += "Content-Type:application/json; charset=utf-8" + "\r\n\r\n";
raw += body + "\r\n\\r\n";
//MessageBox.Show(raw)
try{
// Make a recursive HTTP request for the next item.
FiddlerObject.utilIssueRequest(raw);
}
catch(e){
MessageBox.Show(e.ToString());
}
}
//文件保存路径,可自定义
file = fso.OpenTextFile("E:\\zhuoyuebiji\\fiddler_session\\convert.log",8 ,true, true);
file.writeLine("Response code: " + oSession.responseCode + " [" + curDate.toLocaleString() + "]");
//file.writeLine("Response body: " + oSession.GetResponseBodyAsString());
//file.writeLine("Test: " + typeof(resultToJson));
file.writeLine("tbkConvertURL:[" + tbkConvertURL + "]");
file.writeLine("\n");
file.close();
var now = new Date();
var ts = now.getFullYear()+now.getMonth()+now.getDate()+now.getDay()+now.getHours()+now.getMinutes()+now.getSeconds()+now.getMilliseconds();
var timeString = now.getFullYear() + now.getMonth()+ now.getDate() + now.getDay();