2017-08-20 41 views
0

内容是加密与CUSTOM加密解码定制加密体。捕获的内容主体提琴手为明文的base64编码串 enter image description here小提琴手 - 在检查通过C#的飞行

的应用业务流:

请求:

base64Encode(customEncryptFromStringTobytes(jsonString)) -> application -> http server

响应:

customDecryptFrombytesToString(base64Decode(jsonString)) <- application <- http server

我有加密/解密类我NC#: string EncryptToBase64(string plainText); string DecryptFromBase64(string plainText);

我建立一个exe做变换,我不知道如何在飞行中

我想在检查提琴手节目解密内容作出提琴手解码请求/ respose体通过此exe,并再次加密每次我[再颁和编辑(E)]该请求。

我发现一些接近但不知道如何调用一个exe做解码。 http://docs.telerik.com/fiddler/KnowledgeBase/FiddlerScript/ModifyRequestOrResponse

更新: 我已经为Fiddler实现了自定义检查器。请参阅下面的答案。

+2

我想尝试实施一个提琴手[自定义检查(http://docs.telerik.com/fiddler/Extend-Fiddler/CustomInspector)“C1”。 – Robert

回答

0

采取我创建一个扩展自定义督察

完整的例子https://github.com/chouex/FiddlerExtensionExample

你将建立一个DLL和文件复制到督察和脚本在小提琴手文件夹中。重新启动fiddler将加载展开。

注: 我用前/后生成的脚本复制DLL和VS的项目重新启动小提琴手。

定制检查: 此例只是美化JSON体。

public class ResponseInspector : Inspector2, IResponseInspector2 
{ 
    TextBox myControl; 
    private byte[] m_entityBody; 
    private bool m_bDirty; 

private bool m_bReadOnly; 

public bool bReadOnly 
{ 
    get { return m_bReadOnly; } 
    set 
    { 
     m_bReadOnly = value; 
     // TODO: You probably also want to turn your visible control CONFIG.colorDisabledEdit (false) or WHITE (true) here depending on the value being passed in. 
    } 
} 

public void Clear() 
{ 
    m_entityBody = null; 
    m_bDirty = false; 
    myControl.Text = ""; 
} 

public ResponseInspector() 
{ 
    // TODO: Add constructor logic here 
} 

public HTTPResponseHeaders headers 
{ 
    get { return null; // Return null if your control doesn't allow header editing. 
    } 
    set { } 
} 

public byte[] body 
{ 
    get { return m_entityBody; } 
    set 
    { 
     // Here's where the action is. It's time to update the visible display of the text 
     m_entityBody = value; 

     if (null != m_entityBody) 
     { 
      var text = System.Text.Encoding.UTF8.GetString(m_entityBody); 

       if (!String.IsNullOrEmpty(text) && text.StartsWith("{")) 
       { 
        text = JsonConvert.SerializeObject(JsonConvert.DeserializeObject(text), Formatting.Indented); 
       } 

      myControl.Text = text; 
      // TODO: Use correct encoding based on content header. 
     } 
     else 
     { 
      myControl.Text = ""; 
     } 

     m_bDirty = false; 
     // Note: Be sure to have an OnTextChanged handler for the textbox which sets m_bDirty to true! 
    } 
} 

public bool bDirty 
{ 
    get { return m_bDirty; } 
} 

public override int GetOrder() 
{ 
    return 0; 
} 

public override void AddToTab(System.Windows.Forms.TabPage o) 
{ 
    myControl = new TextBox(); // Essentially the TextView class is simply a usercontrol containing a textbox. 
    myControl.Height = o.Height; 
    myControl.Multiline = true; 
    myControl.ScrollBars = ScrollBars.Vertical; 
    o.Text = "TextViewExample"; 
    o.Controls.Add(myControl); 
    o.Controls[0].Dock = DockStyle.Fill; 
} 
} 

交通篡改(在问题没有提及,但我认为这是非常有用的):

在IAutoTamper2

实施AutoTamperResponseBefore()

本例只需更换任何文字从 “XT” 来在每一个请求主体

0

添加一个虚拟头

Fiddler-Encoding: base64 

和使用Base64它是否包含任何二进制数据编码你的身体。在将数据传送到服务器之前,提琴手将解码数据。

http://www.fiddlerbook.com/fiddler/help/composer.asp

+0

不,我不是要求解码SSL,内容是使用CUSTOM加密器进行加密。 fiddler捕获的内容主体是以纯文本形式的base64编码字符串。 –

+0

更改答案@CharlesChou – twoleggedhorse

+0

不,我不是从base64-> binrary转换数据然后发送到服务器。我需要SHOWING IN INSPECTOR使用base64解码的数据,然后通过我的定制解密器进行解码。请注意,服务器必须准确接收客户端发送的内容。 –