Burp Suite User Forum

Create new post

NullPointerException while attempting passive or active scan from extension

Carol | Last updated: Feb 02, 2016 04:44PM UTC

Hi Team - I am using Burp Suite Pro v1.6.36 and trying to automate passive and active scanning on incoming requests via Burp proxy. I get a NullPointerException while attempting to perform a passive or active scan and further processing seems to get skipped (i.e. adding to active scan queue, in case of active scan). However, in Burp suite UI, I see some issues getting captured as part of the passive scan (I guess) mainly Information and Low severity stuff. java.lang.NullPointerException at burp.BurpExtender.processHttpMessage(BurpExtender.java:265) at burp.c3c.run(Unknown Source) at java.lang.Thread.run(Thread.java:745) Here is the structure of my processHttpMessage function: public void processHttpMessage(int toolFlag, boolean messageIsRequest, IHttpRequestResponse messageInfo) :: IHttpService httpService = messageInfo.getHttpService(); String protocol = httpService.getProtocol(); String host = httpService.getHost(); int port = httpService.getPort(); byte[] request = messageInfo.getRequest(); byte[] response = messageInfo.getResponse(); callback.doPassiveScan(host, port, false, request, response); ///NULLPTREXCEPTION LINE #265 (for a incoming http request example) My BurpExtender class also has implemented the following: public void newScanIssue(IScanIssue issue) //Getting issue details to a log public void registerExtenderCallbacks(IBurpExtenderCallbacks callback) //processing CLI arguments, registering listeners, waiting for requests and generating report Am I missing any pre-requisite to be done before calling the doPassiveScan or doActiveScan? Any pointers would be appreciated. Thank you.

PortSwigger Agent | Last updated: Feb 03, 2016 08:46AM UTC

If the NPE is happening on the line that you have commented then it can only be because the callback variable is null. You need to assign it within the registerExtenderCallbacks method.

Burp User | Last updated: Feb 03, 2016 05:59PM UTC

Thanks for the quick response, Dafydd. That resolved it! I had used the same name callback for both my instance and local variables which made me overlook the assignment part as I was playing around with the registerExtenderCallbacks callback.

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