Deobfuscation & Decode
Last updated
Last updated
For example, if we were using Firefox, we can open the browser debugger with [ CTRL+SHIFT+Z
], and then click on our script secret.js
. This will show the script in its original formatting, but we can click on the '{ }
' button at the bottom, which will Pretty Print
the script into its proper JavaScript formatting:
Code: javascript
We can see that both websites do a good job in formatting the code:
Tip: Ensure you do not leave any empty lines before the script, as it may affect the deobfuscation process and give inaccurate results.
To send a POST
request, we should add the -X POST
flag to our command, and it should send a POST
request:
Tip: We add the "-s" flag to reduce cluttering the response with unnecessary data
However, POST
request usually contains POST
data. To send data, we can use the "-d "param1=sample"
" flag and include our data for each parameter, as follows:
Now that we know how to use cURL
to send basic POST
requests, in the next section, we will utilize this to replicate what server.js
is doing to understand its purpose better.
Furthermore, we can utilize many online tools or code editor plugins, like or . Let us copy the secret.js
script:
We can find many good online tools to deobfuscate JavaScript code and turn it into something we can understand. One good tool is . Let's try copying our above-obfuscated code and run it in UnPacker by clicking the UnPack
button.