How to use the JavaScript API correctly? #21
-
Hi! console.log('Tring to obtain variable'); console.log(getMessageValueKeys()); It failed with this error: { "message" : "Script Log", "payload" : "Tring to obtain variable" } { "message" : "Failure running rule", "exception" : "ReferenceError: \"getMessageValueKeys\" is not defined. (#2)\norg.mozilla.javascript.EcmaError: ReferenceError: \"getMessageValueKeys\" is not defined. (#2)\n\tat org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:4280)\n\tat org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:4258)\n\tat org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:4348)\n\tat org.mozilla.javascript.ScriptRuntime.getNameFunctionAndThis(ScriptRuntime.java:2462)\n\tat org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:85)\n\tat org.mozilla.javascript.gen._cmd__9._c_script_0(:2)\n\tat org.mozilla.javascript.gen._cmd__9.call()\n\tat org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:412)\n\tat org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3578)\n\tat org.mozilla.javascript.gen._cmd__9.call()\n\tat org.mozilla.javascript.gen._cmd__9.exec()\n\tat org.mozilla.javascript.Context.evaluateString(Context.java:1234)\n\tat synfron.reshaper.burp.core.rules.thens.ThenRunScript.lambda$perform$0(ThenRunScript.java:25)\n\tat synfron.reshaper.burp.core.rules.thens.entities.script.Dispatcher.lambda$getRunner$0(Dispatcher.java:53)\n\tat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)\n\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)\n\tat java.base/java.lang.Thread.run(Thread.java:831)\n", "payload" : "\tat :2\n" } Any advise on what I'm doing wrong will be much appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Looks you like actually wanted |
Beta Was this translation helpful? Give feedback.
-
Perfect! Thanks for the advice. The calls work as intended now. |
Beta Was this translation helpful? Give feedback.
-
Sorry to hijack but i'm struggling with the following console.log('Test'); Am i missing something as i get the following: _{ I also tried global:value4 but get a different error. I assume i dont need 'global:' suffix as its implied in the function name (getGlobalVariable) thanks |
Beta Was this translation helpful? Give feedback.
Looks you like actually wanted
Reshaper.event.getMessageValueKeys()
. The documentation may be a little confusing in that area, but the section header titles of that page https://synfron.github.io/ReshaperForBurp/ScriptingLibrary.html are the prefixes that need to go before the function call.