
修改该文件,找到 OnBeforeResponse 方法并修改
import System;
import System.Windows.Forms;
import Fiddler;
import System.Security.Cryptography;
static function OnBeforeResponse(oSession: Session) {
if (m_Hide304s && oSession.responseCode == 304) {
oSession["ui-hide"] = "true";
}
if(oSession.host == "xxx.cn"){
var responseStringOriginal = oSession.GetResponseBodyAsString();
var responseJSON = Fiddler.WebFormats.JSON.JsonDecode(responseStringOriginal);
if (responseJSON.JSONObject['data'] != "") {
var data = AesDecrypt(responseJSON.JSONObject['data'], "key", "iv");
responseJSON.JSONObject['ecrypt_data'] = Fiddler.WebFormats.JSON.JsonDecode(data).JSONObject;
var result = Fiddler.WebFormats.JSON.JsonEncode(responseJSON.JSONObject)
oSession.utilSetResponseB

该代码段展示了在Fiddler中如何使用OnBeforeResponse方法处理特定主机的响应。它首先隐藏了304响应,然后对来自xxx.cn的响应进行AES解密,将解密后的数据添加到新的键ecrypt_data中,并更新响应体。如果主机仍是xxx.cn,则将响应体从Base64解码并设置回去。

4万+

被折叠的 条评论
为什么被折叠?



