Provides web exploitation techniques for CTF challenges. Use when solving web security challenges involving XSS, SQLi, SSTI, SSRF, CSRF, XXE, file upload bypasses, JWT attacks, prototype pollution, path traversal, command injection, LaTeX injection, request smuggling, DOM clobbering, Web3/blockchain, authentication bypass, SAML exploitation, OAuth/OIDC, open redirect chains, subdomain takeover, or CI/CD credential theft.
Quick reference for web CTF challenges. Each technique has a one-liner here; see supporting files for full details with payloads and code.
Python packages (all platforms):
CODEBLOCK0
Linux (apt):
CODEBLOCK1
macOS (Homebrew):
CODEBLOCK2
Go tools (all platforms, requires Go):
CODEBLOCK3
Manual install:
__dict__.update() quote bypass), Python str.format() attribute traversal, SSRF (Host header, DNS rebinding, curl redirect), XXE, XML injection via X-Forwarded-For header, command injection (newline, blocklist bypass, sendmail, multi-barcode, git CLI newline injection), PHP type juggling, PHP file inclusion / php://filter, GraphQL injection (introspection, query batching/aliasing, string interpolation)__reduce__, restricted unpickler bypass, STOP opcode chaining), PHP serialization length manipulation via filter word expansion, race conditions (TOCTOU async exploits, double-spend, coupon reuse)/ctf-reverse first./ctf-pwn./ctf-crypto./ctf-forensics./ctf-osint.CODEBLOCK4
.map source map files/robots.txt, /sitemap.xml, /.well-known/, /admin, /api, /debug, /.git/, INLINECODE15grep -oE '"/api/[^"]+"' for hidden endpointsfavicon.ico, robots.txt may contain data despite error codes: INLINECODE19Detection: Send ' — syntax error indicates SQLi
CODEBLOCK5
WAF bypasses: XML entity encoding (UNION), EXIF metadata injection (exiftool -Comment="' UNION SELECT..."), Shift-JIS \u00a5→0x5c backslash, QR code payload injection, double-keyword nesting (selselectect). See sql-injection.md for all techniques.
MySQL session variable dual-value injection: @var:= assigns return different values across sequential queries in one connection. PHP PCRE backtrack limit WAF bypass: 1M+ chars cause preg_match() to return false, passing !false. information_schema.processlist race condition leaks secrets from concurrent queries. See sql-injection.md.
See server-side-exec.md for PHP pregreplace /e RCE and Prolog injection. See server-side-exec-2.md for SQLi via DNS records and SQLi keyword fragmentation.
CODEBLOCK6
Filter bypass: hex \x3cscript\x3e, entities <script>, case mixing <ScRiPt>, event handlers.
1558071511 = 92.123.45.67) eliminates dots from URLs. JavaScript bracket notation (document["cookie"]) replaces dot property access. See client-side-advanced.md.domain=.parent.tld from one subdomain to inject XSS payload rendered on a sibling subdomain. See client-side-advanced.md.String.prototype.charAt with trim to bypass AngularJS expression sandbox, then $eval arbitrary JS. See client-side.md.See client-side.md for DOMPurify bypass, cache poisoning, CSPT, React input tricks.
JSONP endpoint (?callback=func) wraps sensitive data in a function call. Load cross-origin via <script src> with custom callback to exfiltrate. Chain: SHA1 cookie inversion -> IDOR on debug endpoint -> XSSI -> cloud function OOB. See client-side-advanced.md.
CODEBLOCK7
Windows 8.3 short filename bypass: FILEFO~1.EXT short names bypass path filters that check the long filename. See server-side-advanced-2.md.
URL parseurl @ bypass: http://valid@attacker.com/ -- PHP parse_url() extracts attacker.com as host, bypassing domain checks. See server-side-advanced-2.md.
http://x:x@127.0.0.1:80@allowed.host/path — parse_url() sees allowed.host, curl connects to 127.0.0.1. Distinct from single-@ bypass. See server-side-advanced-2.md./dev/fd symlink bypass: When /proc is blacklisted, use /dev/fd/../environ -- /dev/fd symlinks to /proc/self/fd, so ../ reaches /proc/self/. See server-side-advanced.md.
Python footgun: os.path.join('/app/public', '/etc/passwd') returns INLINECODE59
alg: none — remove signature entirely/api/getPublicKey, .env, INLINECODE63../../../dev/null for empty key, or SQL injection in KIDSee auth-jwt.md for full JWT/JWE attacks and session manipulation.
Detection: {{7*7}} returns INLINECODE66
CODEBLOCK8
Mako SSTI (Python): ${__import__('os').popen('id').read()} — no sandbox, plain Python inside ${} or <% %>. Twig SSTI (PHP): {{['id']|map('system')|join}} — distinguish from Jinja2 via {{7*'7'}} (Twig repeats string, Jinja2 returns 49). See server-side.md and server-side.md.
Quote filter bypass: Use __dict__.update(key=value) — keyword arguments need no quotes. See server-side.md.
ERB SSTI (Ruby/Sinatra): <%= Sequel::DATABASES.first[:table].all %> bypasses ERBSandbox variable-name restrictions via the global Sequel::DATABASES array. See server-side.md.
Python str.format() allows dot-notation attribute traversal ({0.attr.subattr}) and bracket indexing ({0[key]}). When user input reaches .format(obj), leak arbitrary attributes without a template engine. Distinct from SSTI. See server-side.md.
Thymeleaf SpEL SSTI (Java/Spring): ${T(org.springframework.util.FileCopyUtils).copyToByteArray(new java.io.File("/flag.txt"))} reads files via Spring utility classes when standard I/O is WAF-blocked. Works in distroless containers (no shell). See server-side-exec.md.
CODEBLOCK9
DNS rebinding for TOCTOU: https://lock.cmpxchg8b.com/rebinder.html
Host header SSRF: Server builds internal request URL from Host header (e.g., http.Get("http://" + request.Host + "/validate")). Set Host to attacker domain → validation request goes to attacker server. See server-side.md.
ElasticSearch Groovy RCE via SSRF: SSRF to internal ES on port 9200 enables RCE through script_fields Groovy scripting (pre-5.0). See server-side-advanced-2.md.
CODEBLOCK10
When cat/head blocked: sed -n p flag.txt, awk '{print}', INLINECODE85
Bash brace expansion (space-free injection): {ls,-la,..} expands to ls -la .. without literal spaces. See server-side-exec-2.md.
Git CLI newline injection: %0a in URL path breaks out of backtick/system() shell calls that only filter ;|&<>. See server-side.md.
CODEBLOCK11
PHP filter: INLINECODE90
XXE in DOCX uploads: DOCX is ZIP+XML; inject XXE in [Content_Types].xml inside the archive. See server-side.md.
Loose == performs type coercion: 0 == "string" is true, "0e123" == "0e456" is true (magic hashes). Send JSON integer 0 to bypass string password checks. strcmp([], "str") returns NULL which passes !strcmp(). Use === for defense.
See server-side.md for comparison table and exploit payloads.
INLINECODE102 leaks PHP source code without execution. Common LFI targets: /etc/passwd, /proc/self/environ, app config files. Null byte (%00) truncates .php suffix on PHP < 5.3.4.
See server-side.md for filter chains and RCE techniques.
Ruby instance_eval: Break string + comment: VALID');INJECTED_CODE#
Perl open(): 2-arg open allows pipe: |command|
JS eval blocklist bypass: row['con'+'structor']['con'+'structor']('return this')()
PHP deserialization: Craft serialized object in cookie → LFI/RCE
LaTeX injection: \input{|"cat /flag.txt"} — shell command via pipe syntax in PDF generation services. \@@input"/etc/passwd" for file reads without shell.
write18 is restricted, mpost -ini "-tex=bash -c (cmd)" file.mp uses mpost's whitelisted status to execute arbitrary commands. ${IFS} replaces spaces. See server-side-advanced-2.md. echocat ; -- PHP backticks = shellexec(), fits RCE in as few as 8 chars. Use $GET[0]; to move payload to URL parameter. See [server-side-exec.md](server-side-exec.md#php-backtick-eval-under-character-limit-easyctf-2017).
**PHP assert() injection:** assert("strpos('$input', '..') === false") — inject ') || system('cmd');// for RCE (PHP < 7.2). See [server-side-exec.md](server-side-exec.md#php-assert-string-evaluation-injection-csaw-ctf-2016).
**Common Lisp read injection:** #.(run-shell-command "cat /flag") — reader macro evaluates at parse time. See [server-side-exec-2.md](server-side-exec-2.md#common-lisp-injection-via-reader-macro-insomnihack-2016).
**Ruby ObjectSpace scanning:** ObjectSpace.eachobject(String) dumps all in-memory strings including flag. See [server-side-exec.md](server-side-exec.md#ruby-objectspace-memory-scanning-for-flag-extraction-tokyo-westerns-2016).
See [server-side-exec.md](server-side-exec.md) for full payloads and bypass techniques.
## Java Deserialization
Serialized Java objects (rO0AB / aced0005) + ysoserial gadget chains → RCE via ObjectInputStream.readObject(). Try CommonsCollections1-7, URLDNS for blind detection. See [server-side-deser.md](server-side-deser.md#java-deserialization-ysoserial).
## Python Pickle Deserialization
pickle.loads() calls reduce() → (os.system, ('cmd',)) instant RCE. Also via yaml.load(), torch.load(), joblib.load(). See [server-side-deser.md](server-side-deser.md#python-pickle-deserialization).
## Race Conditions (TOCTOU)
Concurrent requests bypass check-then-act patterns (balance, coupons, registration). Send 50 simultaneous requests — all see pre-modification state. See [server-side-deser.md](server-side-deser.md#race-conditions-toctou).
## Node.js Quick Reference
**Prototype pollution:** {"proto": {"isAdmin": true}} or flatnest circular ref bypass
**VM escape:** this.constructor.constructor("return process")() → RCE
**Full chain:** pollution → enable JS eval in Happy-DOM → VM escape → RCE
**Prototype pollution permission bypass:** {"proto":{"isAdmin":true}} on JSON endpoints pollutes Object.prototype. Always try proto injection even when the vulnerability seems like something else.
See [node-and-prototype.md](node-and-prototype.md) for detailed exploitation.
## Auth & Access Control Quick Reference
- Cookie manipulation: role=admin, isAdmin=true
- Public admin-login cookie seeding: check if /admin/login sets reusable admin session cookie
- Host header bypass: Host: 127.0.0.1
- Hidden endpoints: search JS bundles for /api/internal/, /api/admin/; fuzz with auth cookie for non-/api routes like /internal/
- Client-side gates: window.overrideAccess = true or call API directly
- Password inference: profile data + structured ID format → brute-force
- Weak signature: check if only first N chars of hash are validated
- Affine cipher OTP: only 312 possible values (12 mults × 26 adds), brute-force all in seconds
- TOTP srand(time()) weakness: sync server clock to predict codes. See [auth-and-access.md](auth-and-access.md#totp-recovery-via-php-srandtime-seed-weakness-tum-ctf-2016)
- Express.js %2F middleware bypass, IDOR on WIP endpoints, git history credential leakage
- CI/CD variable theft, identity provider API takeover (bypass MFA: notconfiguredaction: skip)
- SAML SSO automation, Guacamole parameter extraction, login page poisoning, TeamCity REST API RCE
## Apache CVE-2012-0053 HttpOnly Cookie Leak
Send oversized Cookie header to trigger 400 Bad Request; Apache's error page reflects the cookie value, leaking HttpOnly cookies. See [cves.md](cves.md#cve-2012-0053-apache-httponly-cookie-leak-via-400-bad-request-rc3-ctf-2016).
## Apache mod_status Information Disclosure
/server-status endpoint reveals active URLs, client IPs, and session data. Use for admin endpoint discovery and session forging. See [auth-and-access.md](auth-and-access.md#apache-modstatus-information-disclosure-session-forging-29c3-ctf-2012).
## Open Redirect Chains
Chain open redirects (?redirect=, ?next=, ?url=) with OAuth flows for token theft. Bypass validation with @, %00, //, \, CRLF. See [auth-and-access.md](auth-and-access.md#open-redirect-chains).
## Subdomain Takeover
Dangling CNAME → claim resource on external service (GitHub Pages, S3, Heroku). Use subfinder + httpx to enumerate, check fingerprints. See [auth-and-access.md](auth-and-access.md#subdomain-takeover).
See [auth-and-access.md](auth-and-access.md) for access control bypasses, [auth-jwt.md](auth-jwt.md) for JWT/JWE attacks, and [auth-infra.md](auth-infra.md) for OAuth/SAML/CI-CD/infrastructure auth.
## File Upload → RCE
- .htaccess upload: AddType application/x-httpd-php .lol + webshell
- Gogs symlink: overwrite .git/config with core.sshCommand RCE
- Python .so hijack: write malicious shared object + delete .pyc to force reimport
- ZipSlip: symlink in zip for file read, path traversal for file write
- Log poisoning: PHP payload in User-Agent + path traversal to include log
- PNG/PHP polyglot + double extension: valid PNG with after IEND chunk, uploaded as .png.php; when disablefunctions blocks exec, use scandir('/') + filegetcontents() for flag. See [server-side-exec-2.md](server-side-exec-2.md#pngphp-polyglot-upload-double-extension-disablefunctions-bypass-metactf-flash-2026).
See [server-side-exec.md](server-side-exec.md) and [server-side-exec-2.md](server-side-exec-2.md) for detailed steps.
## Multi-Stage Chain Patterns
**0xClinic chain:** Password inference → path traversal + ReDoS oracle (leak secrets from /proc/1/environ) → CRLF injection (CSP bypass + cache poisoning + XSS) → urllib scheme bypass (SSRF) → .so write via path traversal → RCE
**Key chaining insights:**
- Path traversal + any file-reading primitive → leak /proc//environ, /proc//cmdline
- CRLF in headers → CSP bypass + cache poisoning + XSS in one shot
- Arbitrary file write in Python → .so hijacking or .pyc overwrite for RCE
- Lowercased response body → use hex escapes (\x3c for <)
## Flask/Werkzeug Debug Mode
Weak session secret brute-force + forge admin session + Werkzeug debugger PIN RCE. See [server-side-advanced.md](server-side-advanced.md#flaskwerkzeug-debug-mode-exploitation) for full attack chain.
## XXE with External DTD Filter Bypass
Host malicious DTD externally to bypass upload keyword filters. See [server-side-advanced.md](server-side-advanced.md#xxe-with-external-dtd-filter-bypass) for payload and webhook.site setup.
## JSFuck Decoding
Remove trailing ()(), eval in Node.js, .toString() reveals original code. See [client-side.md](client-side.md#jsfuck-decoding).
## DOM XSS via jQuery Hashchange (Crypto-Cat)
$(location.hash) + hashchange event → XSS via iframe: 多链集团旗下-闲社网
闲社在线客服
关注闲社网微信
闲社网APP
Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1
Powered by Discuz! X5.0 © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com
