DOM-based Vulnerabilities

Types of Sinks

For DOM-based open-redirection vulnerabilities

location
location.host
location.hostname
location.href
location.pathname
location.search
location.protocol
location.assign()
location.replace()
open()
element.srcdoc
XMLHttpRequest.open()
XMLHttpRequest.send()
jQuery.ajax()
$.ajax()

For DOM-based Javascript Injection

For DOM-based document domain manipulation

For WebScoket-URL poisoning

For DOM-based web-message manipulation

For DOM-based Ajax request-header manipulation

For DOM-based local file-path manipulation

For DOM-based cient-side SQL-injection

For DOM-based HTML5-storage manipulation

For DOM-based XPath injection

For DOM-based JSON-injection vulnerabilities

For DOM-data manipulation

For DOM-based denial-of-server (DOS)

Lab: DOM-based open redirection

We can see this in the web page on blog post

This means that if there is urlparameter provided, it will go to the home page.

We just needed to redirect it back to the exploit server by requesting this URL

After which, we can see the request is being send from the target to the exploit server

When we visit the product page, we can see that the website will save a cookie to the last product that the user visited.

To solve the lab, we will just need to send this to the victim

Lab: DOM XSS using web messages

When viewing the home page, we can see that there is this window.addEventListenerwhich will add anything into the <div id="ads">tag.

To solve the lab, set this payload on the exploit server and sent it to the victim.

Lab: DOM XSS using web messages and a JavaScript URL

To-Do later

For this lab, we can see now they will check if the message content have http:or https:

To solve the lab, set this payload on the exploit server and send it to the victim.

Lab: DOM XSS using web messages and JSON.parse

For this lab, we can see that the data is being pass using JSON.parse. So the message that we will be sending over must be in JSON format. We also can see under the load-channel, the url will be parsed in without any checks. So we can use the payload from the previous lab to call print().

To solve the lab, set this payload on the exploit server and send it to the victim

Lab: Exploiting DOM clobbering to enable XSS

(To Do)

To solve the lab, send this payload in the comments

Last updated