php code request for the md5 coding in the vBulletin

Discussion in 'PHP' started by crazy.works, Jan 6, 2009.

  1. #1
    hello,
    i am coding a small script that i wanna connect with my forum database. so i wanna make the registration system in my script adding in the forum database to make the table for the users is the same for the forum and the script that i am coding .

    i thought the password is stored in the database as a md5 hash but i got one problem .

    when i registered in the forum with password called "myforum" i got the pass hash like that "376b140475f5f2894fcd403cdd3ca249"

    now when i coded my script i made the md5 coding code like that
    $pass = md5($password);

    but when i tried to coding the word "myforum" i got it with different hash like that "974016833dd8b1ca230196085c38ec8c" and i don't know why !!!

    so the vBulletin use php4 or php5 or something but i don't know why i didn't got the same hash like that hash in the vb database ??

    please help me to know how they coded the word "myforum" to got it hash like "376b140475f5f2894fcd403cdd3ca249" in the vBulletin user table in the database.

    thanks
     
    crazy.works, Jan 6, 2009 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    At some point one of the scripts is adding a salt to the value before hashing it. This helps prevent any sort of dictionary or rainbow crack attempt. You need to find out what the salt was for the hash. md5 is a common hash, so it will be the same in php4, php5, perl, etc...

    You will need to look for something like:

    $salt = 'some_string_or_function';
    $password = md5($password.$salt);
     
    jestep, Jan 6, 2009 IP
  3. elias_sorensen

    elias_sorensen Well-Known Member

    Messages:
    852
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    110
    #3
    The passwords in vBulletin 3 are using double md5 hashes and salting.
    
    md5(md5('myforum') . salt)
    PHP:
     
    elias_sorensen, Jan 6, 2009 IP
  4. crazy.works

    crazy.works Peon

    Messages:
    304
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    well , thanks for that info ,it really helps me to understand . but any body know what have i wrote for the variable $salt to got the hash for the word "myforum" like that "376b140475f5f2894fcd403cdd3ca249"

    i mean the code will be like !!
    $salt = "???????";
    $password_hash = md5(md5('myforum') . $salt);

    thanks
     
    crazy.works, Jan 6, 2009 IP
  5. elias_sorensen

    elias_sorensen Well-Known Member

    Messages:
    852
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    110
    #5
    Try searching through all the files for md5(md5(

    use total commander. Navigate to the vbulletin folder, press alt+f7, check find text and write your search string :)
     
    elias_sorensen, Jan 6, 2009 IP