Skip to content

Ilias1988/payload-obfuscator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

33 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Payload Obfuscator

πŸ›‘οΈ Payload Obfuscator

Advanced Red Team Payload Obfuscation Engine
Free & Open Source β€” Browser-Based β€” No Data Leaves Your Machine

🌐 Live Demo β€’ Features β€’ Quick Start β€’ Languages β€’ Layers

License Languages Layers Build

⚠️ For authorized security testing and educational purposes only. Do not use against systems you do not own or have explicit permission to test.


✨ Features

πŸ”“ 100% Client-Side β€” All obfuscation runs in your browser. Zero server calls. Your payloads never leave your machine.

πŸ§… 8 Stackable Layers β€” Combine any layers together for maximum evasion depth. Each layer adds a different evasion dimension.

πŸ”€ 5 Languages β€” PowerShell, Python, Bash, C#, and Go with language-specific awareness.

πŸ”¬ Context-Aware Tokenizer β€” Custom parser that understands strings, comments, interpolation, f-strings, here-strings, and escape sequences per language. Never breaks syntax.

πŸ“Š Real-Time Analysis β€” Shannon entropy meter, detection probability scoring, per-layer breakdown, and output validation.

🎯 Unicode Safe β€” B64-first encoding pipeline ensures Greek, Chinese, Emoji, and any Unicode characters work flawlessly across all layers.

πŸ†“ Completely Free β€” No tiers, no paywalls, no accounts. Every feature is available to everyone.


πŸ”€ Supported Languages

Language Icon Key Features
PowerShell ⚑ IEX Stealth auto-replacement, AMSI/ETW bypass, backtick escape resolution, $() subexpression awareness
Python 🐍 f/r/b/u string prefix detection, f-string deconstruction, __import__() safe dead code, getattr stealth
Bash 🐚 55+ command obfuscation via printf '\xHH', $'...' ANSI-C quoting preservation, native eval execution
C# πŸ”· Verbatim @"" and interpolated $"" string preservation, shellcode loader templates, in-method injection
Go πŸ”Ή Raw backtick string preservation, safe byte slice encoding, encoding/base64 import awareness

πŸ§… Obfuscation Layers

All 8 layers can be combined in any order. Each layer operates independently and adds a unique evasion dimension:

# Layer Icon What It Does Evasion Impact
1 Variable Randomization 🎲 Renames variables and function names to random identifiers Breaks static signature matching on known variable names
2 String Encoding πŸ” Encodes string literals with Base64, Hex, or char arrays Hides suspicious strings from pattern-matching scanners
3 Dead Code Injection πŸ’€ Inserts non-functional code at safe locations Alters control flow graph and code fingerprint
4 Anti-Analysis πŸ›‘οΈ Adds sandbox detection, sleep timers, CPU/RAM checks Evades dynamic analysis and sandbox environments
5 XOR String Encryption βš”οΈ Encrypts each string with unique random XOR key + JIT decrypt Eliminates all plaintext β€” defeats heuristic scanners
6 Control Flow Flattening πŸŒ€ Flattens code into randomized state-machine (while/switch) Defeats CFG analysis and decompiler pattern recognition
7 AMSI/ETW Patch 🧬 Prepends obfuscated AMSI bypass + ETW blind Disables runtime memory scanning on Windows targets
8 Encryption Wrapper πŸ”’ Wraps entire payload in polymorphic XOR/AES envelope Completely hides payload structure from static scanners

πŸ”’ Encryption Wrapper Methods (Randomized)

Each time you encrypt, one of these polymorphic methods is randomly selected:

Method Description
XOR + Base64 XOR encrypt Base64-encoded payload with random 16-byte key
Hex-Shift Shift each byte by random offset, encode as hex string
Multi-XOR Double XOR with two independent 16-byte keys
Byte Rotation Rotate each byte by random offset (3-50), stored as array

All methods use B64-first encoding (Base64 before encryption) to guarantee Unicode safety and prevent byte overflow.


πŸ”¬ Technical Highlights

Context-Aware Parser

The custom tokenizer (parser.js) splits source code into string, comment, and code tokens. Obfuscation engines only modify the appropriate token types β€” never breaking syntax, keywords, or structural delimiters.

Interpolation-Aware Encoding

Interpolated strings are split into static and variable segments:

  • PowerShell: "Hello $name" β†’ encoded_static + $name
  • Python: f"Hello {name}" β†’ encoded_static + str(name)
  • Bash: "Hello $var" β†’ encoded_static$var
  • C#: $"Hello {name}" β†’ string.Format(encoded, name)

Unicode Safety (B64-First Pipeline)

All encoding and encryption operations use a Base64-first approach:

  1. Resolve language-specific escape sequences (\n β†’ real newline)
  2. Encode string to Base64 (guaranteed ASCII, 0-127 range)
  3. Apply XOR/shift/rotation on the safe B64 bytes
  4. Decryption stub reverses: decrypt β†’ Base64 decode β†’ UTF-8 string

This prevents the Cannot convert value "913" to type System.Byte error when processing Unicode characters (Greek, CJK, Emoji, etc.).

Stealth Execution

  • PowerShell: ScriptBlock::Create(), ExecutionContext.InvokeCommand, Invoke-Command (randomized)
  • Bash: eval "$(…)" with variable indirection (no pipe/subshell scope loss)
  • IEX Stealth: Auto-replaces IEX/Invoke-Expression with & ($ShellId[1]+$ShellId[13]+'X')

πŸ“Š Analysis Dashboard

The built-in analysis panel provides real-time feedback:

  • Shannon Entropy β€” Measures randomness (Higher = harder to fingerprint)
  • Detection Score β€” Estimates probability of AV/EDR detection per active layer
  • Size Ratio β€” Before/after payload size comparison
  • Validation β€” Checks balanced delimiters and structural integrity

πŸš€ Quick Start

# Clone the repository
git clone https://github.com/Ilias1988/payload-obfuscator.git
cd payload-obfuscator

# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

Then open http://localhost:5173 in your browser.

Or just visit the Live Demo β†’


πŸ“ Project Structure

payload-obfuscator/
β”œβ”€β”€ index.html                    # SEO-optimized shell
β”œβ”€β”€ vite.config.js                # Vite configuration
β”œβ”€β”€ tailwind.config.js            # Tailwind theme (dark terminal)
β”œβ”€β”€ scripts/
β”‚   └── build.mjs                 # Production build script
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ robots.txt
β”‚   └── sitemap.xml
└── src/
    β”œβ”€β”€ App.jsx                   # Main application
    β”œβ”€β”€ main.jsx                  # React entry point
    β”œβ”€β”€ index.css                 # Tailwind + custom styles
    β”œβ”€β”€ components/
    β”‚   β”œβ”€β”€ layout/               # Header, Footer
    β”‚   β”œβ”€β”€ panels/               # Input, Output, Options, Analysis, Language
    β”‚   β”œβ”€β”€ seo/                  # SEOHead, SEOContent
    β”‚   └── ui/                   # CopyButton, EntropyMeter, Toast
    β”œβ”€β”€ data/
    β”‚   └── techniques.js         # Languages, layers, templates
    β”œβ”€β”€ engines/
    β”‚   β”œβ”€β”€ powershell.js         # PowerShell engine (8 layers)
    β”‚   β”œβ”€β”€ python.js             # Python engine (6 layers)
    β”‚   β”œβ”€β”€ bash.js               # Bash engine (6 layers)
    β”‚   β”œβ”€β”€ csharp.js             # C# engine (8 layers)
    β”‚   β”œβ”€β”€ golang.js             # Go engine (7 layers)
    β”‚   β”œβ”€β”€ controlflow.js        # Scope-aware CFF engine
    β”‚   └── amsi.js               # AMSI/ETW patch generator
    β”œβ”€β”€ hooks/
    β”‚   └── useObfuscator.js      # Core state management
    └── utils/
        β”œβ”€β”€ encoding.js           # Base64, Hex, XOR, resolveLanguageEscapes()
        β”œβ”€β”€ entropy.js            # Shannon entropy + detection scoring
        β”œβ”€β”€ parser.js             # Context-aware tokenizer
        β”œβ”€β”€ randomization.js      # Variable/function name generation
        └── validator.js          # Output validation

πŸ› οΈ Tech Stack

Technology Purpose
React 18 UI framework
Vite 5 Build tool & dev server
Tailwind CSS 3.4 Styling (dark terminal theme)
Lucide React Icons
React Helmet Async Dynamic SEO meta tags

πŸ“‹ Templates

7 pre-built payload skeletons included:

  • ⚑ PowerShell Download Cradle
  • πŸ›‘οΈ AMSI Bypass Template
  • 🏴 Master Payload v3.0 (AMSI + Stealth IEX + Download Cradle)
  • 🐍 Python Reverse Shell
  • 🐚 Bash Reverse Shell
  • πŸ”· C# Shellcode Loader Skeleton
  • πŸ”Ή Go Reverse Shell

πŸ“Œ Version History

Version Highlights
v5.3 B64-first Unicode safety (all engines), resolveLanguageEscapes(), escape sequence fix, Python XOR B64-first
v5.2 F-string var rename sync, as/for capture, 2-phase randomization
v5.1 Dead code __import__() safety β€” zero NameError crashes
v5.0 F-string deconstruction, context-aware parser
v4.5 Polymorphic encryption wrappers (4 methods), stealth exec
v4.1 Scope-aware CFF rewrite (brace counting, atomic try/catch)
v4.0 XOR String Encryption, Control Flow Flattening
v3.0 IEX Stealth, AMSI templates, entropy analysis
v2.0 Context-aware parser, string-safe encoding
v1.0 5 languages, 5 layers, basic obfuscation

πŸ“œ License

MIT License β€” See LICENSE for details.


πŸ‘€ Author

Ilias Georgopoulos


Built with β˜• and πŸ”₯ for the red team community

About

Advanced Red Team Payload Obfuscator. A multi-layer evasion tool for PowerShell, Python, Bash, C#, and Go. Features Shannon Entropy analysis and real-time detection scoring.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors