Burp Suite User Forum

Create new post

Montoya API: Burp 2023.10.2.4: java.lang.Exception: Extension class is not a recognized type

Kamalpreet | Last updated: Nov 06, 2023 10:51AM UTC

I have created a helloworld extension using the Montoya java code and getting the below error when I try to load (exported runnable jar: helloworld.jar) it in Burp UI: java.lang.Exception: Extension class is not a recognized type at burp.Zgbi.Zo(Unknown Source) at burp.Zgbi.ZQ(Unknown Source) at burp.Zw8a.Zl(Unknown Source) at burp.Zelj.ZS(Unknown Source) at burp.Zqu6.lambda$panelLoaded$0(Unknown Source) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:842) Burp 2023.10.2.4 Java : 17.0.9+11-LTS-201 My laptop has Windows 10 pro Java class: /* Copyright (c) 2022-2023. PortSwigger Ltd. All rights reserved. This code may be used to extend the functionality of Burp Suite Community Edition and Burp Suite Professional, provided that this usage does not violate the license terms for those products. */ package com.burp.montoya.helloworld; import burp.api.montoya.BurpExtension; import burp.api.montoya.MontoyaApi; import burp.api.montoya.logging.Logging; //Burp will auto-detect and load any class that extends BurpExtension. public class HelloWorld implements BurpExtension { @OverRide public void initialize(MontoyaApi api) { // set extension name api.extension().setName("Hello world extension"); Logging logging = api.logging(); // write a message to our output stream logging.logToOutput("Hello output."); // write a message to our error stream logging.logToError("Hello error."); // write a message to the Burp alerts tab logging.raiseInfoEvent("Hello info event."); logging.raiseDebugEvent("Hello debug event."); logging.raiseErrorEvent("Hello error event."); logging.raiseCriticalEvent("Hello critical event."); // throw an exception that will appear in our error stream throw new RuntimeException("Hello exception."); } }

Hannah, PortSwigger Agent | Last updated: Nov 06, 2023 05:38PM UTC

Hi Could you tell me how you have built your extension (for example, did you use a build manager like Gradle), and the version of the Montoya API you have compiled this against?

Kamalpreet | Last updated: Nov 07, 2023 05:27AM UTC

I created the jar in eclipse. I downloaded the Montoya API from Burp (Extensions --> APIs --> Montoya API --> Save interface files)

Kamalpreet | Last updated: Nov 07, 2023 05:56AM UTC

Was able to resolve the issue after running with java 1.8.0_121

Hannah, PortSwigger Agent | Last updated: Nov 07, 2023 10:13AM UTC

I'm glad to hear that you resolved your issue. Typically, we'd recommend using a build manager like Gradle or Maven to handle your dependencies. If there's anything else we can help with, then please let us know.

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