Replies: 1 comment
-
Hi Could you provide some more information on your code? If you want to add a highlight to traffic passing through Burp's network stack, we recommend doing this as part of an HttpHandler. You can find a brief example below. import burp.api.montoya.BurpExtension;
import burp.api.montoya.MontoyaApi;
import burp.api.montoya.core.HighlightColor;
import burp.api.montoya.http.handler.*;
import burp.api.montoya.http.message.requests.HttpRequest;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
public class SendRequest implements BurpExtension
{
@Override
public void initialize(MontoyaApi api)
{
api.http().registerHttpHandler(new HttpHandler()
{
@Override
public RequestToBeSentAction handleHttpRequestToBeSent(HttpRequestToBeSent requestToBeSent)
{
return RequestToBeSentAction.continueWith(requestToBeSent);
}
@Override
public ResponseReceivedAction handleHttpResponseReceived(HttpResponseReceived responseReceived)
{
responseReceived.annotations().setHighlightColor(HighlightColor.BLUE);
return ResponseReceivedAction.continueWith(responseReceived);
}
});
HttpRequest request = HttpRequest.httpRequestFromUrl("https://portswigger-labs.net");
ScheduledExecutorService ses = Executors.newSingleThreadScheduledExecutor();
ses.scheduleWithFixedDelay(
() -> api.http().sendRequest(request),
5, 5,
TimeUnit.SECONDS
);
api.extension().registerUnloadingHandler(ses::shutdownNow);
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I have the above code in a my method of the extender.I can see the request in the
Logger
, but it is not highlighted.how should i make it highlighted.Thanks
Beta Was this translation helpful? Give feedback.
All reactions