Command Injection Bypass-generator
Voer een commando en een regex-filter in. Wij genereren payloads die daar langs komen.
Hoe het werkt
Deze tool automatiseert het vinden van command injection-payloads die een gegeven regex-filter overleven. Het genereert tientallen versluierde varianten van je commando en test elk tegen de regex — server-side in PHP, er wordt nooit iets uitgevoerd.
- 1. Voer je commando in: het ruwe commando om in te voegen, bijv.
whoamiofcat /etc/passwd. - 2. Plak het regex-filter: elk formaat: PHP
/pattern/flags, Pythonr"pattern"ofre.compile(...), JavaScriptnew RegExp(...), Go backtick, of een gewoon patroon. - 3. Kies het filtertype: blacklist-filters blokkeren overeenkomende invoer (payload mag NIET overeenkomen); whitelist-filters staan alleen overeenkomende invoer toe (payload moet overeenkomen).
- 4. Ontvang je bypasses: elke payload die aan de filtervoorwaarde voldoet wordt teruggegeven, gegroepeerd op techniek, met het OS waarop het van toepassing is.
Bypass-techniekeencategorieën
De generator dekt de volgende families van bypass-technieken voor Linux/Bash en Windows CMD/PowerShell.
Encoding (base64 / hex / xxd / octal)
Encodes the entire command using base64 (subshell and pipe-to-sh), raw hex decoded by xxd -r -p, printf \x escapes (lowercase), and ANSI-C $'\x..' quoting. Lowercase-only variants bypass [A-Z] filters.
Quote splitting
Inserts empty single quotes, double quotes, or backslash escapes inside the keyword, e.g. c''at or c\at, breaking pattern matching without changing shell semantics.
Space bypass
Replaces literal spaces with $IFS, ${IFS}, a tab character ($'\t'), brace expansion ({cmd,arg}), or input redirection (cat</etc/passwd).
Slash bypass
Replaces forward slashes using ${HOME:0:1}, ANSI-C $'\x2f', $'\57', or $(printf '\57').
Variable concat
Splits the command across two shell variables (a=wh; b=oami; $a$b) to avoid matching the full keyword in the regex.
Alternative commands
Substitutes blocked commands: cat → less, tac, nl, head, xxd; whoami → id; ls → echo *.
Wildcards / globbing (hint)
Generates c?t and c* variants. These bypass the regex but require the correct binary on the filesystem. Verify manually.
CMD caret obfuscation
Inserts the ^ escape character between chars (w^h^o^a^m^i). CMD ignores ^ and executes the command normally.
CMD quote splitting
Inserts empty double quotes (wh""oami). Functionally identical to the unquoted form in CMD.
CMD variable tricks
Splits across environment variables (set a=wh& set b=oami& call %a%%b%). Also supports delayed expansion via cmd /V:ON and !var!.
PowerShell backtick
The backtick (`) is a PowerShell escape character silently ignored in identifiers. wh`oami executes as whoami.
PowerShell encoding
Encodes as UTF-16LE base64 for powershell -enc, or rebuilds from a char array ([char[]](119,104,...) -join '') or string concat ('wh'+'oami').
PowerShell invoke variants
Uses iex, the & operator, ScriptBlock::Create, or mixed-case IeX without spelling Invoke-Expression.
Blacklist- vs. whitelist-filters
Blacklist — payload mag NIET overeenkomen
De applicatie blokkeert invoer wanneer de regex overeenkomt. De regex beschrijft het gevaarlijke patroon — bijv. [;&|`$] of cat|ls|whoami. Een payload mag de regex niet activeren om er doorheen te glippen.
Veelgebruikt in: PHP preg_match() met die/block bij overeenkomst, Python re.search() guards.
Whitelist — payload moet overeenkomen
De applicatie verwerkt invoer alleen wanneer de regex overeenkomt. De regex beschrijft toegestane tekens — bijv. ^[^;\/&A-Z]*$. Een payload moet aan de regex voldoen en toch een commando uitvoeren.
Veelgebruikt in: invoervalidators, CTF-broncode, WAF-allowlists.
Tip: als de regex verankerd is met ^ en $, is het bijna altijd een whitelist. De tool waarschuwt je als je modusselectie niet klopt.
Ondersteunde regex-invoerformaten
Plak de regex precies zoals deze in de broncode staat — de tool detecteert automatisch het formaat, extraheert het patroon en de vlaggen, en compileert het naar een PHP-compatibele expressie.
| Taal / formaat | Voorbeeld |
|---|---|
| PHP / JS / Ruby / Perl | /[;&|`$\s]/i |
| Kaal patroon | ^[0-9a-z]+$ |
| Python raw string | r"^[^;/\&.<>\rA-Z]*$" |
| Python re.compile | re.compile(r"[;&|]", re.IGNORECASE) |
| JavaScript new RegExp | new RegExp("[;&|]", "gi") |
| Go raw string | `^[a-z0-9]+$` |
| Perl m// | m/[;&|]/gi |
| String met aanhalingstekens | "^[a-z0-9]+$" |
FAQ
Voert dit daadwerkelijk commando’s uit?
Nee. Alles draait server-side in PHP. Payloads worden als strings gegenereerd en met preg_match() tegen je regex getest. Er wordt nooit een commando op de server uitgevoerd.
Wat betekent "payload moet matchen / mag NIET matchen"?
Een blacklist blokkeert invoer wanneer de regex matcht: de payload mag NIET matchen. Een whitelist staat invoer alleen toe wanneer de regex matcht: de payload moet matchen. De tool detecteert automatisch wat waarschijnlijker is en waarschuwt je als je keuze verkeerd lijkt.
Waarom zijn sommige payloads met een waarschuwing gemarkeerd?
Wildcard- en glob-gebaseerde payloads (bijv. /bin/c?t) zijn afhankelijk van de bestandssysteemindeling van het doel. Ze omzeilen de regexfilter, maar werken alleen als de verwachte binary op dat pad aanwezig is.
Waarom werkt mijn ANSI-C-quoting-payload niet direct?
Een ANSI-C-string zoals $'\x77\x68\x6f\x61\x6d\x69' evalueert in bash naar de letterlijke string whoami, maar voert die niet vanzelf uit. Zet er eval of bash -c voor, die uit kleine letters bestaan en waarschijnlijk niet gefilterd worden.
Kan ik dit gebruiken voor CTF-challenges?
Ja. Deze tool is bedoeld voor CTF- en geautoriseerde pentestscenario’s waarin je een invoerfilter moet omzeilen om commando-uitvoering te bereiken. Gebruik het alleen op systemen die je bezit of waarvoor je uitdrukkelijke toestemming hebt om te testen.