Burp Suite User Forum

Create new post

Burp Suite Extension

srmburp | Last updated: Jan 27, 2020 07:43AM UTC

I am writing a Burp Extension in Java  using the instructions at  https://portswigger.net/burp/extender/writing-your-first-burp-suite-extension I am able to build the jar file but I am getting an error when I load the extension using the jar file I built. java.lang.ClassNotFoundException: burp.BurpExtender at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:436) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:415) at burp.elf.a(Unknown Source) at burp.elf.<init>(Unknown Source) at burp.c7u.a(Unknown Source) at burp.fuj.lambda$panelLoaded$0(Unknown Source) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:835) Build Platform:    Mac OS 10.14.6 Burp Pro Edition 2.1.07 The directory structure: /Users/<..>/burp Build Methods:  - Download  all the interfaces from Burp suite into /Users/< . >/burp from Burp Suite->Extensions->APIs  - Create a file called BurpExtender.java and copy the following lines: package burp; public class BurpExtender implements IBurpExtender {public void registerExtenderCallbacks (IBurpExtenderCallbacks callbacks){ // your extension code here}}  - javac *.java  - jar -tvf burp.jar *.class (I built using IntelliJ and the loading error is the same whether I built using Intellij or command line as above) Directory Contents: burp.jar BurpExtender.java BurpExtender.class IBurpCollaboratorClientContext.class IBurpCollaboratorClientContext.java IBurpCollaboratorInteraction.class IBurpCollaboratorInteraction.java IBurpExtender.class IBurpExtender.java IBurpExtenderCallbacks.class IBurpExtenderCallbacks.java IContextMenuFactory.class IContextMenuFactory.java IContextMenuInvocation.class IContextMenuInvocation.java ICookie.class ICookie.java IExtensionHelpers.class IExtensionHelpers.java IExtensionStateListener.class IExtensionStateListener.java IHttpListener.class IHttpListener.java IHttpRequestResponse.class IHttpRequestResponse.java IHttpRequestResponsePersisted.class IHttpRequestResponsePersisted.java IHttpRequestResponseWithMarkers.class IHttpRequestResponseWithMarkers.java IHttpService.class IHttpService.java IInterceptedProxyMessage.class IInterceptedProxyMessage.java IIntruderAttack.class IIntruderAttack.java IIntruderPayloadGenerator.class IIntruderPayloadGenerator.java IIntruderPayloadGeneratorFactory.class IIntruderPayloadGeneratorFactory.java IIntruderPayloadProcessor.class IIntruderPayloadProcessor.java IMenuItemHandler.class IMenuItemHandler.java IMessageEditor.class IMessageEditor.java IMessageEditorController.class IMessageEditorController.java IMessageEditorTab.class IMessageEditorTab.java IMessageEditorTabFactory.class IMessageEditorTabFactory.java IParameter.class IParameter.java IProxyListener.class IProxyListener.java IRequestInfo.class IRequestInfo.java IResponseInfo.class IResponseInfo.java IResponseKeywords.class IResponseKeywords.java IResponseVariations.class IResponseVariations.java IScanIssue.class IScanIssue.java IScanQueueItem.class IScanQueueItem.java IScannerCheck.class IScannerCheck.java IScannerInsertionPoint.class IScannerInsertionPoint.java IScannerInsertionPointProvider.class IScannerInsertionPointProvider.java IScannerListener.class IScannerListener.java IScopeChangeListener.class IScopeChangeListener.java ISessionHandlingAction.class ISessionHandlingAction.java ITab.class ITab.java ITempFile.class ITempFile.java ITextEditor.class ITextEditor.java

Hannah, PortSwigger Agent | Last updated: Jan 27, 2020 08:20AM UTC

The ClassNotFoundException is thrown when the Java Virtual Machine (JVM) tries to load a particular class and the specified class cannot be found in the classpath. Are you using a tool like Gradle to compile your project? In IntelliJ, you can go to "Gradle > tasks > build > jar" and the output will be put in to "build/libs". To compile and package your code into a jar file manually, you will need to go back one level in your file structure, to package the entire contents of the module properly. Additionally you will need to use "cvf" to create rather than "tvf" to list. - javac burp/*.java - jar cvf burp.jar burp If you then use "java tvf burp.jar", when the contents are listed they should all have burp/<file name> You should then be able to load your outputted .jar file into Burp without errors.

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