Quantcast
Channel: support.portswigger.net :: Burp Extensions
Viewing all articles
Browse latest Browse all 115

Output in the UI

$
0
0
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.....

Viewing all articles
Browse latest Browse all 115

Trending Articles