CVSS calculator I should use. It also has a training I might want to take - https://www.first.org/cvss/
Javascript Deobfuscation
ctrl+u look at the source code of the website
Obfuscating
Is essentially the act of making code unreadable or very difficult to read for humans
- Code Minification
- This is when you put all the code in one line
- https://www.toptal.com/developers/javascript-minifier
- Often minified code is saved with the extension
.min.js
.
- Code Packing
- https://beautifytools.com/javascript-obfuscator.php
- can be recognized with the function
function(p,a,c,k,e,d)
- Although the dictionary type function showed above can change in naming it always tries to pack the original code into an order to execute
Advanced Obfuscating
- https://obfuscator.io/
- encoding our strings adds an extra layer of obfuscation
- https://jsfuck.com/
- Obfuscation can impact performance
- https://utf-8.jp/public/jjencode.html
- https://utf-8.jp/public/aaencode.html
- obfuscation can be used to bypass webfilters or restrictions
Deobfuscation
- Deobfuscating minified JS
- easiest way is to open inspector → go to debugger → click
{ }
in firefox - can also use the following tools
- easiest way is to open inspector → go to debugger → click
- Deobfuscating packed code
- https://matthewfl.com/unPacker.html
- another way would be to console.log() the return function of the code
- Really want to checkout the Secure coding 101 course
Encoding
Base64
- Spotting
- Uses = for padding
- is alpha numeric
- encoding in terminal
echo https://www.hackthebox.eu/ | base64
- Decoding in shell
echo aHR0cHM6Ly93d3cuaGFja3RoZWJveC5ldS8K | base64 -d
Hex
- spotting
- only encoded in hex value. 0-9 a-f
- encoding in terminal
echo https://www.hackthebox.eu/ | xxd -p
- Decoding
echo 68747470733a2f2f7777772e6861636b746865626f782e65752f0a | xxd -p -r
Rot13 - Cesar Cypher
- spotting
- can be easy to spot from the way the string looks
uggcf://jjj.unpxgurobk.rh/
still looks like a url
- can be easy to spot from the way the string looks
- Encoding and decoding
echo https://www.hackthebox.eu/ | tr 'A-Za-z' 'N-ZA-Mn-za-m'
https://www.boxentriq.com/code-breaking/cipher-identifier can help identifying a cipher