2017-08-20 46 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解碼的數據,然後通過我的定製解密器進行解碼。請注意,服務器必須準確接收客戶端發送的內容。 –