Burp Suite User Forum

Create new post

Importing and Using Arbitrary Java Classes

Richard | Last updated: Jun 03, 2024 07:42PM UTC

Is it possible to make use of arbitrary classes imported from external modules in Java, e.g. the UriBuilder class? My extension makes use a class in the same project folder that implements logic to generate a token that I want to add to every request, but unfortunately BurpSuite says cannot find class UriBuilder...

Hannah, PortSwigger Agent | Last updated: Jun 04, 2024 09:18AM UTC

Hi How are you building your extension? If you're using a build manager like gradle, you can include the library as part of your JAR file. You can find an example of an extension that uses this with gradle here: https://github.com/Hannah-PortSwigger/WebSocketTurboIntruder/blob/main/build.gradle

Richard | Last updated: Jun 05, 2024 08:46AM UTC

Hi Hannah, I'm using Maven at the moment, when I build the project in IntelliJ theres no import errors but when reloading the extension is Burp I'm getting a "Missing Class, URI Builder" error. I checked my pom.xml file and the dependency is registered in there.

Hannah, PortSwigger Agent | Last updated: Jun 05, 2024 09:50AM UTC

When you build your extension with Maven (mvn package), do you get a JAR file that has "-with-dependencies" at the end of the file name? I like to use the "file expander" plugin in IntelliJ, which lets me look in the JAR file generated to double-check that specific dependencies are included within my JAR.

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