githubEdit

Encoding & Decoding

Base64

Encode

echo 'https://www.hackthebox.eu/' | base64
# aHR0cHM6Ly93d3cuaGFja3RoZWJveC5ldS8K

# Encode a file
base64 file.txt > encoded.txt
cat file.txt | base64

Decode

echo 'aHR0cHM6Ly93d3cuaGFja3RoZWJveC5ldS8K' | base64 -d
# https://www.hackthebox.eu/

# Decode a file
base64 -d encoded.txt > decoded.txt

Spotting Base64

  • Contains only: A-Z, a-z, 0-9, +, /

  • Padding: = or == at the end

  • Length is multiple of 4


Hex

Encode

Decode

Spotting Hex

  • Contains only: 0-9, a-f (or A-F)

  • Even number of characters


ROT13

Encode/Decode (Same Command)

Online Tool

  • https://rot13.com/


URL Encoding

Encode (Python)

Decode (Python)

Common URL Encoded Characters

Character
Encoded

Space

%20 or +

!

%21

"

%22

#

%23

$

%24

%

%25

&

%26

'

%27

(

%28

)

%29

*

%2a

+

%2b

,

%2c

/

%2f

:

%3a

;

%3b

<

%3c

=

%3d

>

%3e

?

%3f

@

%40

[

%5b

\

%5c

]

%5d

^

%5e

Newline

%0a


Cipher Identification

Online Tools


JavaScript Deobfuscation

Beautify Minified JS

Online Tools

Tool
URL
Use Case

Prettier

https://prettier.io/playground/

Beautify/format code

Beautifier

https://beautifier.io/

Beautify/format code

UnPacker

https://matthewfl.com/unPacker.html

Unpack (p,a,c,k,e,d) obfuscation

de4js

https://lelinhtinh.github.io/de4js/

Multiple deobfuscation methods

Obfuscator.io

https://obfuscator.io/

Obfuscate JS (for testing)

Recognizing Packer Obfuscation

Look for initial function signature:

Manual Deobfuscation Trick

Replace eval with console.log to print the deobfuscated code instead of executing it:

Last updated