My Pentesting Space
LinkedIn
  • Welcome to Hackjiji
  • 🕸️web pentesting
    • Basics
    • Web pentest cheatsheet
    • Burpsuite and browser tricks
    • cUrl cheatsheet
    • CVE exploitation
    • JavaScript Obfuscation/Deobfuscation
  • Network pentesting
    • Basics
    • Nmap favorites
    • Host discovery
    • Port scanning
    • Network Services
      • RPC-NFC
      • WINRM - 5895-5896
      • FTP - 21
      • SMB - 445
      • RDP - 3389
      • SSH - 22
      • SMTP - 25
    • Firewall evasion
    • Pivoting and double pivoting
  • Physical pentesting
    • Bad USB - Rubber Duckies
  • Linux pentesting
    • Usefull command's
    • Privilege escalation
  • windows pentesting
    • Windows useful commands
    • Windows Reverse shell codes
    • Privilege escalation
  • Active Directory pentesting
    • Basics
    • AD
    • AAD
  • General
    • Hash cracking
    • Wordlist
    • Encoding/decoding
    • Environment setup
      • Install a new OS on seperated boot sector
      • Hyper-V
      • Virtualbox
    • Reverse-shell-cheatsheet
    • Metasploit cheatsheet
    • Vulnerability research
    • My scanning methodology
  • Events
    • HackTheBox Meetup - LFI2RCE
    • Radio Equans - QR Code Awareness campaign
    • Cybersecurity job campaign
Powered by GitBook
On this page
  • Obfuscation
  • Run and test Javascript on online console
  • Minificating a JavaScript
  • Packing a JavaScript
  • Advanced obfuscation
  • Deobfuscation
  • Deobfuscation online tools
  • Beautify minified JavaScript codes
  • Base64/HEX/ROT13 encoding and decoding
  • Resources:
  1. web pentesting

JavaScript Obfuscation/Deobfuscation

PreviousCVE exploitationNextBasics

Last updated 4 months ago

Obfuscation

Obfuscation is a technique used to make a script more difficult to read by humans but allows it to function the same from a technical point of view, though performance may be slower. This is usually achieved automatically by using an obfuscation tool, which takes code as an input, and attempts to re-write the code in a way that is much more difficult to read, depending on its design.

Run and test Javascript on online console

Minificating a JavaScript

Code Minification involves compressing the code into a single, often lengthy line. This greatly reduces its readability by humans while maintaining its functionality from a technical perspective.

Online Resources for JavaScript Minifiers:

Packing a JavaScript

A packer obfuscation tool usually attempts to convert all words and symbols of the code into a list or a dictionary and then refer to them using the (p,a,c,k,e,d) function to re-build the original code during execution. The (p,a,c,k,e,d) can be different from one packer to another. However, it usually contains a certain order in which the words and symbols of the original code were packed to know how to order them during execution.

While a packer does a great job reducing the code's readability, we can still see its main strings written in cleartext, which may reveal some of its functionality. This is why we may want to look for better ways to obfuscate our code.

Online Javascript Obfuscator makes javascript code harder to read or understand.

Advanced obfuscation

Completely obfuscate the code and hide any remnants of its original functionality.

Deobfuscation

Just as there are tools to obfuscate code automatically, there are tools to beautify and deobfuscate the code automatically.

Deobfuscation online tools

Beautify minified JavaScript codes

  1. Browser tool, CTRL+ALT+I and then click on the '{}' button on the Debugger tab which will Pretty Print the script into its propoer JavaScript formatting

  2. Online resources like Prettier or Beautifiier

Base64/HEX/ROT13 encoding and decoding

Refer to the page Encoding/decoding

Resources:

🕸️
jsconsole
JavaScript Minifier
Logo
PrettierPrettier
JSFuck - Write any JavaScript with 6 Characters: []()!+
Logo
JavaScript Obfuscator Tool
aaencode - Encode any JavaScript program to Japanese style emoticons (^_^)
jjencode - Encode any JavaScript program using only symbols
Online Javascript Obfuscator - BeautifyTools.com
Logo
UnPacker
Logo
JS NICE: Statistical renaming, Type inference and Deobfuscation
HTB Academy : Cyber Security Training
Online JavaScript beautifier
Logo
Logo
Logo
Logo