-
Notifications
You must be signed in to change notification settings - Fork 224
JS Editor
This tab offers a text editor in which you can add your own hooks and functions to Brida JS files. This editor used the great RSyntaxTextArea library, with a few modifications to make the library work inside Burp Suite.
After setting the configurations, the user can click on the "Load JS file" button to open one of the Brida JS files (the default load folder is the one set in the configuration tab). Usually user should modify only the brida.js file. Other files include Frida hooks used by Brida components and usually should not be modified/removed by the user.
On the top of brida.js file there are some imports that should not be removed. The same applies for the initial list of exported function contained in the rpc.exports block.
User can put his own export and functions inside brida.js file, exports in the rpc.exports block and function/hooks outside.
In the last part of brida.js file there are many auxiliary functions that can be helpful to the user (hex2bytes, bytes2hex, string2hex, hex2string, base64, etc.). User can remove these functions is unnecessary but, if possible, he should avoid returning unencoded binary data from JS functions to his Brida plugins because binary data through Brida bridge can cause unexpected behaviors in some situations. In these situations, is advisable to encode binary data to ASCII-HEX or Base64 with these functions before returning the data to the Brida plugin (Brida custom plugin engine handles many encoding, refer to the Wiki page on the topic).
Last, edited file can be saved using the "Save JS file" button. Remember to recompile before respawning/attaching/reloading, otherwise old version of the JS files will be used.