proxy - Work with deobfuscated data in Burp while forwarding obfuscated data - Stack Overflow

I am trying to analyze HTTP traffic between an application and a server using Burp Suite.The traffic i

I am trying to analyze HTTP traffic between an application and a server using Burp Suite. The traffic is routed through Burp, but the request and response bodies are obfuscated. Ideally I want to be able to inspect/modify the deobfuscated request/repsponse bodies in Burp's proxy history and Repeater.

For simplicity, assume the data in the bodies is base64 encoded for obfuscation and each obfuscated request/response has the string <!-- obfuscated in them.

What I have tried

I modified the HTTP Handler Example Extension such that responses are intercepted and deobfuscated:

@Override 
public ResponseReceivedAction handleHttpResponseReceived(HttpResponseReceived responseReceived) {
    if (!responseReceived.bodyToString().contains("<!-- obfuscated")) {
        return continueWith(responseReceived);
    }
    String body = deobfuscate(responseReceived.bodyToString()); 
    return continueWith(responseReceived.withBody(body), annotations);
}

public static String deobfuscate(String encodedString) { 
    byte[] decodedBytes = Base64.getDecoder().decode(encodedString);
    return new String(decodedBytes);
}

The problem is that the application can't handle the deobfuscated response, which means I need to forward the obfuscated response to the application.

The same goes for requests to the server. The application obfuscates the data, I want Burp to deobfuscate it, be able to modify it and then Burp should obfuscate the data again and send it to the server.

Is there a practical way to work with the deobfuscated data in Burp while forwarding the obfuscated data?

I am trying to analyze HTTP traffic between an application and a server using Burp Suite. The traffic is routed through Burp, but the request and response bodies are obfuscated. Ideally I want to be able to inspect/modify the deobfuscated request/repsponse bodies in Burp's proxy history and Repeater.

For simplicity, assume the data in the bodies is base64 encoded for obfuscation and each obfuscated request/response has the string <!-- obfuscated in them.

What I have tried

I modified the HTTP Handler Example Extension such that responses are intercepted and deobfuscated:

@Override 
public ResponseReceivedAction handleHttpResponseReceived(HttpResponseReceived responseReceived) {
    if (!responseReceived.bodyToString().contains("<!-- obfuscated")) {
        return continueWith(responseReceived);
    }
    String body = deobfuscate(responseReceived.bodyToString()); 
    return continueWith(responseReceived.withBody(body), annotations);
}

public static String deobfuscate(String encodedString) { 
    byte[] decodedBytes = Base64.getDecoder().decode(encodedString);
    return new String(decodedBytes);
}

The problem is that the application can't handle the deobfuscated response, which means I need to forward the obfuscated response to the application.

The same goes for requests to the server. The application obfuscates the data, I want Burp to deobfuscate it, be able to modify it and then Burp should obfuscate the data again and send it to the server.

Is there a practical way to work with the deobfuscated data in Burp while forwarding the obfuscated data?

Share asked Mar 6 at 19:25 upeupe 2,1641 gold badge26 silver badges38 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

Actually, Burp's Montoya API provides everything needed. One just has to implement the following methods of the 3 interfaces HttpHandler, ProxyRequestHandler, and ProxyResponseHandler:

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744954102a4603092.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信