Burp Suite User Forum

Create new post

the restoreState() function gives a runtime error

between-planets | Last updated: Jul 20, 2015 04:53PM UTC

I'm developing an extension that pulls back a list of saved burp states into a table. I'm trying to get the application to restore the burp state when one of these items is clicked. Unfortunatly Burp is giving me a runtime error when the file is accessed. I'm even manually added the path to a known file and still get same error. Any idea what i'm doing wrong here? Here is my code snippet: File tmp = new File("C:/SOMEPATH ON MY FILE SYSTEM/burp.state"); try{ cb.restoreState(tmp); }catch(Exception Ex){ Ex.printStackTrace(); } Here is my stack trace: java.lang.RuntimeException: java.lang.RuntimeException: An error occurred during restore operation at burp.xbe.a(Unknown Source) at burp.reb.restoreState(Unknown Source) at burp.BurpExtender$1.run(BurpExtender.java:32) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$400(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour ce) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)

PortSwigger Agent | Last updated: Jul 21, 2015 09:20AM UTC

Thanks for this report. To help us investigate further, can you answer the following: 1. If you try to do a manual restore of the same file, via the Burp UI, do you get an error? 2. What exact version of Burp are you using? Thanks.

Burp User | Last updated: Jul 21, 2015 06:14PM UTC

a manual restore works perfectly for the same file. I'm running 1.6.20

PortSwigger Agent | Last updated: Jul 22, 2015 12:52PM UTC

Thanks for the update. We're investigating this issue and will let you know if we need any further details.

Mike, PortSwigger Agent | Last updated: Jul 27, 2015 06:57AM UTC

It looks like you are calling restoreState() whilst you are still on the Swing event dispatch thread. The Burp Extender API will not allow this because the state restore operation can be time consuming and the Burp user interface would hang until the operation completed. Please can you check that this is the case? If so, you can resolve the problem by starting a new thread to perform the state restore operation. We have updated the exception message to more clearly explain this situation.

PortSwigger Agent | Last updated: Jul 27, 2015 12:35PM UTC

Just to let you know that today's release (1.6.23) now throws a more helpful and informative exeption if you try to restore state via the API in the Swing event thread.

Burp User | Last updated: Jul 27, 2015 02:14PM UTC

Yes! This fixed my issue once I ran it in a separate thread.

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