कंटेंट पर जाएँ
HackIndex.io
टूल्स

कमांड इंजेक्शन बाईपास जनरेटर

एक कमांड और एक regex फ़िल्टर डालें। हम उसे बायपास करने वाले पेलोड बना देंगे।

\rA-Z]*$\"">

सुझाव: आप regex को delimiters के साथ या बिना दर्ज कर सकते हैं — /pattern/flags और सामान्य pattern दोनों काम करते हैं।

यह कैसे काम करता है

यह टूल उन कमांड इंजेक्शन पेलोड को खोजने को स्वचालित करता है जो दी गई regex फ़िल्टर से बच जाते हैं। यह आपके कमांड के दर्जनों अस्पष्ट variants उत्पन्न करता है और प्रत्येक को regex के विरुद्ध परीक्षण करता है — सर्वर-साइड PHP में, कुछ भी कभी निष्पादित नहीं होता।

  1. 1. अपना कमांड दर्ज करें: इंजेक्ट करने के लिए raw कमांड, उदा. whoami या cat /etc/passwd.
  2. 2. regex फ़िल्टर पेस्ट करें: कोई भी फ़ॉर्मैट: PHP /pattern/flags, Python r"pattern" या re.compile(...), JavaScript new RegExp(...), Go backtick, या एक सामान्य pattern।
  3. 3. फ़िल्टर का प्रकार चुनें: blacklist फ़िल्टर मिलते-जुलते इनपुट को ब्लॉक करते हैं (पेलोड मेल नहीं खाना चाहिए); whitelist फ़िल्टर केवल मिलते-जुलते इनपुट की अनुमति देते हैं (पेलोड मेल खाना चाहिए)।
  4. 4. अपने बाईपास प्राप्त करें: फ़िल्टर शर्त पास करने वाला हर पेलोड वापस किया जाता है, तकनीक के अनुसार समूहीकृत, उस OS के साथ जिस पर यह लागू होता है।

बाईपास तकनीक श्रेणियां

जनरेटर Linux/Bash और Windows CMD/PowerShell के लिए बाईपास तकनीकों के निम्नलिखित परिवारों को कवर करता है।

Linux

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.

Linux

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.

Linux

Space bypass

Replaces literal spaces with $IFS, ${IFS}, a tab character ($'\t'), brace expansion ({cmd,arg}), or input redirection (cat</etc/passwd).

Linux

Slash bypass

Replaces forward slashes using ${HOME:0:1}, ANSI-C $'\x2f', $'\57', or $(printf '\57').

Linux

Variable concat

Splits the command across two shell variables (a=wh; b=oami; $a$b) to avoid matching the full keyword in the regex.

Linux

Alternative commands

Substitutes blocked commands: cat → less, tac, nl, head, xxd; whoami → id; ls → echo *.

Linux

Wildcards / globbing (hint)

Generates c?t and c* variants. These bypass the regex but require the correct binary on the filesystem. Verify manually.

Windows

CMD caret obfuscation

Inserts the ^ escape character between chars (w^h^o^a^m^i). CMD ignores ^ and executes the command normally.

Windows

CMD quote splitting

Inserts empty double quotes (wh""oami). Functionally identical to the unquoted form in CMD.

Windows

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!.

Windows

PowerShell backtick

The backtick (`) is a PowerShell escape character silently ignored in identifiers. wh`oami executes as whoami.

Windows

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').

Windows

PowerShell invoke variants

Uses iex, the & operator, ScriptBlock::Create, or mixed-case IeX without spelling Invoke-Expression.

blacklist बनाम whitelist फ़िल्टर

blacklist — पेलोड मेल नहीं खाना चाहिए

जब regex मेल खाता है तो एप्लिकेशन इनपुट ब्लॉक करता है। regex खतरनाक pattern का वर्णन करता है — उदाहरण के लिए [;&|`$] या cat|ls|whoami. पेलोड को regex ट्रिगर नहीं करना चाहिए ताकि वह फ़िल्टर से गुज़र सके।

इनमें सामान्य: PHP preg_match() जो मिलान पर die/block करता है, Python re.search() गार्ड्स।

whitelist — पेलोड मेल खाना चाहिए

एप्लिकेशन इनपुट केवल तभी प्रोसेस करता है जब regex मेल खाता है। regex अनुमत अक्षरों का वर्णन करता है — उदाहरण के लिए ^[^;\/&A-Z]*$. पेलोड को regex संतुष्ट करते हुए कमांड भी निष्पादित करना होगा।

इनमें सामान्य: input validators, CTF challenge सोर्स, WAF allowlists।

सुझाव: यदि regex के साथ एंकर किया गया है ^ और $, यह लगभग हमेशा एक whitelist होती है। यदि आपका मोड चयन गलत लगता है तो टूल आपको चेतावनी देगा।

सपोर्ट किए गए regex इनपुट फ़ॉर्मैट

regex को बिल्कुल वैसे ही पेस्ट करें जैसा सोर्स कोड में दिखता है — टूल फ़ॉर्मैट स्वतः पहचानता है, pattern और flags निकालता है, और इसे PHP-compatible expression में संकलित करता है।

भाषा / फ़ॉर्मैट उदाहरण
PHP / JS / Ruby / Perl /[;&|`$\s]/i
सादा पैटर्न ^[0-9a-z]+$
Python रॉ स्ट्रिंग r"^[^;/\&.<>\rA-Z]*$"
Python re.compile re.compile(r"[;&|]", re.IGNORECASE)
JavaScript new RegExp new RegExp("[;&|]", "gi")
Go रॉ स्ट्रिंग `^[a-z0-9]+$`
Perl m// m/[;&|]/gi
उद्धृत स्ट्रिंग "^[a-z0-9]+$"

FAQ

क्या यह वास्तव में कमांड निष्पादित करता है?

नहीं। सब कुछ सर्वर-साइड PHP में चलता है। पेलोड स्ट्रिंग के रूप में जनरेट होते हैं और preg_match() से आपके regex के विरुद्ध परखे जाते हैं। सर्वर पर कोई कमांड कभी निष्पादित नहीं होता।

"पेलोड मैच होना चाहिए / मैच नहीं होना चाहिए" का क्या अर्थ है?

ब्लैकलिस्ट तब इनपुट ब्लॉक करती है जब regex मैच होता है: पेलोड मैच नहीं होना चाहिए। व्हाइटलिस्ट केवल तभी इनपुट की अनुमति देती है जब regex मैच होता है: पेलोड मैच होना चाहिए। टूल स्वतः पता लगाता है कि कौन-सा अधिक संभावित है और यदि आपका चयन ग़लत लगे तो चेतावनी देता है।

कुछ पेलोड चेतावनी के साथ क्यों चिह्नित हैं?

वाइल्डकार्ड और glob-आधारित पेलोड (जैसे /bin/c?t) लक्ष्य के फ़ाइल सिस्टम लेआउट पर निर्भर करते हैं। वे regex फ़िल्टर को बायपास करते हैं, लेकिन केवल तभी काम करेंगे जब अपेक्षित बाइनरी उस पथ पर मौजूद हो।

मेरा ANSI-C कोटिंग पेलोड सीधे क्यों नहीं चलता?

$'\x77\x68\x6f\x61\x6d\x69' जैसी ANSI-C स्ट्रिंग bash में शाब्दिक स्ट्रिंग whoami के रूप में मूल्यांकित होती है, पर स्वयं निष्पादित नहीं होती। इसके आगे eval या bash -c लगाएँ, जो छोटे अक्षर हैं और फ़िल्टर होने की संभावना कम है।

क्या मैं इसे CTF चैलेंज के लिए उपयोग कर सकता हूँ?

हाँ। यह टूल CTF और अधिकृत पेनिट्रेशन टेस्टिंग परिदृश्यों के लिए बनाया गया है जहाँ कमांड निष्पादन पाने हेतु इनपुट फ़िल्टर बायपास करना होता है। इसे केवल उन सिस्टम पर उपयोग करें जिनके आप स्वामी हैं या जिन्हें परखने की स्पष्ट अनुमति है।