Burp Suite User Forum

Create new post

Packaging Burp Extensions

Venka | Last updated: Aug 25, 2019 02:18AM UTC

How are we supposed to package extensions that require both Java and Jython? I've an extension which uses 2 python projects and those 2 use python modules like six. How should I package it for distribution?

Burp User | Last updated: Aug 25, 2019 02:53PM UTC

Giving you more context, I'm trying to bundle/package the Python modules with the Java jar file packages. But when I do this, Jython is not able to find these modules unless you put them under the Lib folderwhere Jython.jar is present. So, I tried adding the extension's ProtectionDomain path (zip/jar) to "python.path" which looks like Jython is able to find the modules but is unable to find the other modules. I get the following error in this case. So, what's the proper way to bundle the Python modules without having the user install them in the LIb folder and have the extension work seamlessly? Error: Current class path 1 /tmp/burp93946213344455771.tmp/1 New python module path value /tmp/burp93946213344455771.tmp/1 Exception during disposal: java.lang.reflect.InvocationTargetException at java.awt.EventQueue.invokeAndWait(EventQueue.java:1349) at java.awt.Window.doDispose(Window.java:1210) at java.awt.Window.dispose(Window.java:1147) at burp.bbm.n(Unknown Source) at burp.czi.lambda$exitSuite$4(Unknown Source) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.IllegalStateException: Can't dispose InputContext while it's active at sun.awt.im.InputContext.dispose(InputContext.java:666) ....... Deleting temporary files - please wait ... done. java.lang.NoClassDefFoundError: org/python/netty/util/concurrent/DefaultFutureListeners at org.python.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:577) at org.python.netty.util.concurrent.DefaultPromise.setSuccess(DefaultPromise.java:397) at org.python.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:155) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.ClassNotFoundException: org.python.netty.util.concurrent.DefaultFutureListeners at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 4 more java.lang.NoClassDefFoundError: org/python/netty/util/concurrent/DefaultFutureListeners

Liam, PortSwigger Agent | Last updated: Aug 28, 2019 11:45AM UTC

We have a bit of a backlog in terms of Extensions issues. Please accept our apologies, we'll get back to you as soon as we can.

Mike, PortSwigger Agent | Last updated: Aug 29, 2019 09:43AM UTC

Hi Venka, we recommend using a requirements.txt file to list your python dependencies, you can find out more about how to configure this at the following page: https://pip.readthedocs.io/en/1.1/requirements.html

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