Search code examples
authorizationvbulletin

Login in vbulletin without password (username and hash only)


All day I was looking an answer on this question: How to log in vbulletin, without using password.

For example I send username in request to module and it logs user in.

All I found is:

verify_authentication('username', 'pass', '', '', TRUE, TRUE);
process_new_login('', TRUE, '');

or

verify_authentication('username', '', 'md5(pass)', 'md5(pass)', TRUE, TRUE);
process_new_login('', TRUE, '');

But I haven't got no password neither md5 hash, I have only md5(md5(pass+salt)).

Can someone help?


Solution

  • Found solution. All we need is user id.

        $vbulletin->userinfo = fetch_userinfo($userid);
        vbsetcookie('userid', $vbulletin->userinfo['userid'], true, true, true);
        vbsetcookie('password', md5($vbulletin->userinfo['password'] . COOKIE_SALT), true, true, true);
        exec_unstrike_user($vbulletin->userinfo['username']);
        $logintype = ($vbulletin->userinfo['usergroupid'] == '6') ? 'cplogin' : '';
        process_new_login($logintype, TRUE, TRUE);