Web Hacking
◾
383
The document.referrer is currently exploitable only in Internet Explorer, because in browsers
like Firefox, Chrome, and Safari, user input passed after the “?” is returned encoded.
Example 5
The document.cookie is another very common source of DOM XSS; however, the exploitation of
however, it's exploitation is a bit trivial, because in order to exploit it, you need to have the ability to
manipulate the cookies. Since you can manipulate your own cookies, you can only XSS yourself,
which is otherwise known as a “SELF-XSS.” The goal with the XSS would be to execute the JavaScript
in the victim’s browsers. In order to do that, we need to find another subdomain vulnerable to XSS.
Let’s take a look at an example of a DOM-based XSS vulnerability found by one of my friends
Prakhar Prasad from India. The vulnerability was in a popular Indian website called “rediff.com.”
The source was a document.cookie, and the execution sink was innerHTML. Let’s take a look at
the vulnerable code.
Dostları ilə paylaş: