Burp Suite User Forum

Create new post

HTTP Mock extension can't be loaded

Ilya | Last updated: Jan 28, 2021 06:28PM UTC

HTTP Mock extension loading with a error: java.util.regex.PatternSyntaxException: Unexpected internal error near index 28 ^/Dashboard/GetRepositories\ at java.base/java.util.regex.Pattern.error(Pattern.java:2029) at java.base/java.util.regex.Pattern.compile(Pattern.java:1790) at java.base/java.util.regex.Pattern.<init>(Pattern.java:1431) at java.base/java.util.regex.Pattern.compile(Pattern.java:1070) at net.logicaltrust.model.MockRule.setPath(MockRule.java:101) at net.logicaltrust.persistent.MockJsonSerializer$MockRuleAdapter.read(MockJsonSerializer.java:91) at net.logicaltrust.persistent.MockJsonSerializer$MockRuleAdapter.read(MockJsonSerializer.java:68) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222) at com.google.gson.Gson.fromJson(Gson.java:927) at com.google.gson.Gson.fromJson(Gson.java:892) at com.google.gson.Gson.fromJson(Gson.java:841) at com.google.gson.Gson.fromJson(Gson.java:813) at net.logicaltrust.persistent.SettingsSaver.entryFromString(SettingsSaver.java:179) at net.logicaltrust.persistent.SettingsSaver.lambda$loadEntries$2(SettingsSaver.java:79) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) at net.logicaltrust.persistent.SettingsSaver.loadEntries(SettingsSaver.java:80) at net.logicaltrust.persistent.MockRepository.<init>(MockRepository.java:23) at burp.BurpExtender.registerExtenderCallbacks(BurpExtender.java:33) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at burp.avu.lambda$registerExtenderCallbacks$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:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:832) The reason is this record ^/Dashboard/GetRepositories\ How can I remove this record from extension data?

Uthman, PortSwigger Agent | Last updated: Jan 29, 2021 09:34AM UTC

Hi Ilya, I just loaded this extension directly from the BApp Store and it works without any errors. Can you provide more detail on how you are loading the extension? Are you building it directly from the source (GitHub) and loading the JAR? Unfortunately, we do not manage third-party extensions so if you continue to face issues then you will need to raise this on GitHub with the extension developer: - https://github.com/LogicalTrust/BurpHttpMock/issues

Ilya | Last updated: Jan 29, 2021 12:26PM UTC

Hello there! Okay, I'll describe it step-by-step: 1. I installed this extension and mistakenly added to settings wrong regular expression. 2. After that I can't load it to my Burp Suite. 3. In source code of extension a saw, that they are using callbacks.loadExtensionSetting here https://github.com/PortSwigger/http-mock/blob/master/src/net/logicaltrust/persistent/SettingsSaver.java#L69 4. I have tried to delete extension, extension folder in %Appdata%, reinstall it. Nothing helps. 5. I have tried to reinstall my Burp Suite - doesn't help as well. 6. So I suspect, HTTP Mock store extension data somewhere in Burp Suite files using Burp Extender, can you help me to find this files? I will just reinstall Burp Suite and delete those files. By the way, I have tried to do Help -> Clean Burp suite from computer. Doesn't help either. HTTP Mock extension is from PortSwigger BApp store, and this extension can corrupt Burp Suite installation. Seems to me, it's a bug. May be you better contact with HTTP Mock developers? :) Regars, Ilya

Uthman, PortSwigger Agent | Last updated: Jan 29, 2021 12:37PM UTC

Can you see if any extension files exist in your home directory > .BurpSuite > bapps? I just double-checked this and the extension appears to load in fine if I select 'Install' directly from the Extender > BApp Store within Burp. Have you tried this? Can you please share a screen recording with support@portswigger.net?

Ilya | Last updated: Jan 29, 2021 01:53PM UTC

Yes, I have tried this - doesn't work. But fixed it by this steps: 1. On Extender -> Extension tab I chose 'Add' and select jar file of extension. 2. Then I clicked Next and voila Extension appears in UI successfully loaded. Thank you Uthman for assistance! Have a nice weekend! Regards, Ilya.

Uthman, PortSwigger Agent | Last updated: Jan 29, 2021 02:16PM UTC

Great! Have a nice weekend too!

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