Burp Suite User Forum

Create new post

Output in the UI

Syed | Last updated: Jun 25, 2019 01:10PM UTC

This is my code: package burp; import java.io.PrintWriter; import java.util.List; public class BurpExtender implements IBurpExtender, IHttpListener, IProxyListener { // // implement IBurpExtender // private IExtensionHelpers helpers; PrintWriter stdout; @Override public void registerExtenderCallbacks(IBurpExtenderCallbacks callbacks) { stdout = new PrintWriter(callbacks.getStdout(), true); helpers = callbacks.getHelpers(); callbacks.setExtensionName("Seccasts"); callbacks.registerHttpListener(this); } public void processHttpMessage(int toolFlag, boolean messageIsRequest, IHttpRequestResponse messageInfo) { if(messageIsRequest) { IHttpService httpService = messageInfo.getHttpService(); String host = httpService.getHost(); if(host != null) { stdout.println(host); } } } @Override public void processProxyMessage(boolean messageIsRequest, IInterceptedProxyMessage message) { if(messageIsRequest) { IHttpRequestResponse messageInfo = message.getMessageInfo(); IRequestInfo rqInfo = helpers.analyzeRequest(messageInfo); String complete = rqInfo.toString(); stdout.println(complete); List headers = rqInfo.getHeaders(); String headermeers = headers.toString(); stdout.println(headermeers); headers.add("Meer: This is the test"); String request = new String(messageInfo.getRequest()); stdout.println(request); String messageBody = request.substring(rqInfo.getBodyOffset()); stdout.println(messageBody); byte[] updateMessage = helpers.buildHttpMessage(headers, messageBody.getBytes()); String meer56 = updateMessage.toString(); stdout.println(meer56); messageInfo.setRequest(updateMessage); } } I am able to print only the host onto the output UI, why is that I am not able to print the other information such as: stdout.println(complete); which prints the request.....

PortSwigger Agent | Last updated: Jun 25, 2019 02:20PM UTC

processProxyMessage is never called. You need to use callbacks.registerProxyListener() so that it is called.

You must be an existing, logged-in customer to reply to a thread. Please email us for additional support.