380
◾
Ethical Hacking and Penetration Testing Guide
The Chrome JS console automatically points us to the vulnerable code as we were trying to
load a nonexisting image (By clicking the line number, you would be automatically taken to the vulnerable code that is
responsible for the cause of the vulnerability.
You can verify it by setting up a breakpoint on line number 7. The idea behind this is to gener-
ate an intentional error, which would get caught with Chrome js console, and hence point us to
the vulnerable code.
DOM XSS wiki has a list of the best-known jquery sinks that would lead to dom XSS if the
input is not escaped before being executed by a sink.
◾
https://code.google.com/p/domxsswiki/wiki/jQuery
Note
: This method does not work very well for inline JS, things such as
eval() and set-
timeout()
. In such a situation, we can crawl the JavaScript for location.hash, location.href, and
other input sources and set up breakpoints to inspect the input values on each of the breakpoints.
For larger JavaScript files, this may be a tedious task; therefore, a better option would be to use a
static or a dynamic code analyzer.
Dostları ilə paylaş: