righettod / log-requests-to-sqlite

BURP extension to record every HTTP request send via BURP and create an audit trail log of an assessment.
https://portswigger.net/bappstore/d916d94506734f3490e49391595d8747
GNU General Public License v3.0
61 stars 16 forks source link

Can't log HTTP response #26

Closed pwnedDesal closed 3 years ago

pwnedDesal commented 3 years ago

I am trying to log the HTTP response as well using messageInfo.getResponse(). I did some modification on the source code such as the SQL statements and on the logEvent method of ActivityLogger.java. The source code successfully compiled, but at the time the log-request-to-sqlite logs the HTTP request and response I always get this error.

    at java.base/java.lang.Thread.run(Thread.java:832)
java.lang.NullPointerException: Data cannot be null
    at burp.en1.bytesToString(Unknown Source)
    at burp.drp.bytesToString(Unknown Source)
    at burp.ActivityLogger.logEvent(ActivityLogger.java:114)
    at burp.ActivityHttpListener.processHttpMessage(ActivityHttpListener.java:47)

looks like the HTTP response is not available yet at the time of logging. is there a way to detect when the HTTP response is available? P.S. Sorry, This 🥔 is not good at Java. 1 2

righettod commented 3 years ago

Hi,

In fact you need to log the response only when the following flag is false because it indicate if the current object is a request (see pink rectangle):

image

Class javadoc documentation:

image

pwnedDesal commented 3 years ago

lol I did see that hahahaha 🤦thank you

righettod commented 3 years ago

You can also look at the piper burp extension if you need to work with request/response for processing that burp do not support out of the box.