XSS
Cross-site Scripting
Test Filters
External Requests
External Requests
Test if the web application allows the inclusion of resources from external servers:
Spawn a
HTTP
serverpython3 -m http.server 80
Submit the payload and wait for the request
<img src='http://10.10.14.30/test.jpg' />
Code Execution
Code Execution
Charcode Bypass
Charcode Bypass
First use
python
to convert the payload to integers:
Now make the payload:
If you get a respond on the server you can try to steal data by creating the malicious files.
Stealers
Reflected XSS
Reflected XSS
Capture the
Full HTML
content of a web page:
Once the full content is captured you can target a specific element or section of the page:
You can also steals cookies that may been stored in the
DOM
:
In this code,
safeContentGrab
safely fetches & encodes content,cookieExample
shows correct cookie access; contrast with directXSS
payload execution inCTF
scenarios.
Stealing Cookies
Key Condition -> HttpOnly
needs to be set to false
HttpOnly
needs to be set to false
Use when injecting into an image tag where an error event triggers(
HTTP response error or broken link
):
Use when you can inject an image and trigger a redirect via the
onerror
event(load error
):
Use in situations where you can send cookies via an image request (
URL encoding
):
Use when you need to send cookies using an
audio object
:
Use when you
want to redirect
the user to a server with the cookies attached:
Similar to the previous one; use when you
want to redirect
:
Use in scenarios where you can modify the
document.location
and send cookies:
Inject when you need to send cookies via
document.location.href
and trigger aredirect
:
Use to
dynamically write an image
that sends cookies:
Use when you need to
assign a location redirect
with cookies:
Similar to the previous one, use when you need to access
window.location
properties dynamically:
Use when you need to modify
window.location.href
dynamically:
Use when you can
dynamically join the URL and cookies to redirect
:
Use when you can send cookies using an
image object
:
Use when you need to
redirect with concatenation of cookies
into a URL:
Use in scenarios where you can send cookies via an
XMLHttpRequest
:
Use when you can inject
base64-encoded JavaScript
and execute it to send cookies:
Use when you need to send cookies via
fetch
withno-cors
mode toavoid response handling
:
Use when you want to send cookies
asynchronously
in the background using thesendBeacon
API, typically for stealthier attacks.
Last updated