Random valid username and password

Karnaphorion
7 years ago | edited 7 years ago

0

So i’m able to generate some random valid username and password but it seems that it not enough.
And i don’t really understand why it’s random.
That’s weird right ?

```function findUnHash(hash,mult)
{
var alpha2 = “abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghij”;
function int_to_string(val)
{
var str=“”;
var l= alpha2.length;
var tmpval=val;
for(var i=0;i<10;i++)
{
//console.log(tmpval%l);
str+=alpha2[tmpval%l];
tmpval=Math.floor(tmpval/l);
if(tmpval==0)break;
}
return str.split(“”).reverse().join(“”);;
}

function randomIntFromInterval(min,max)
{
return Math.floor(Math.random()*(max-min+1)+min);
}

var test = hash;
var min=0;
var max=100000000000000000000000000;
while(1)
{
if(max-min<=1)break;
var rand = randomIntFromInterval(min,max);
var str = int_to_string(rand);
var hash = makehash(str,mult);
console.log(str+“ –> ”+hash);
console.log(min+“<test<”+max);
console.log(max-min);
if(hash>test)
{
console.log(“hash>test”);
max=rand;
}
else if(hash<test)
{
console.log(“hash<test”);
min=rand;
}
else if(hash==test)
{
console.log(“Success : ”+str);
return str;
}
}
}```

Valid username : xwvNP
Valid password : of2pXnwN

4replies
5voices
217views
dloser
7 years ago

0

The reason it is random is because you use Math.random()… :P

If you understand the code, you can see why it is not enough.

Karnaphorion
7 years ago

0

Yeah the password also encrypt the url to open after login, so even if i able to pass through the username_check and the password_check if the password isn’t the right one the url will be wrong.

Kerachi
7 years ago

0

It is hard to understand, but more easier find out, or look after because it was a popular code (in june 2000 …).

(I hope i didn’t spoiler anything)

volf52
7 years ago

0

a lot of hash collisions

Reply has been removed
You must be logged in to reply to this discussion. Login
1 of 5

This site only uses cookies that are essential for the functionality of this website. Cookies are not used for tracking or marketing purposes.

By using our site, you acknowledge that you have read and understand our Privacy Policy, and Terms of Service.

Dismiss