Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-25-2008, 09:11 PM
teamsupra teamsupra is offline
 
Join Date: Aug 2003
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Mass Password Change?

I have a hacker who seems to have gotten a hold of my user database. And if logging in as all different users. I need to way to mass change all of the users Pws. So they would have to login and click Forgot password so that its emailed to them.

Anyway to do this.

Please help
Reply With Quote
  #2  
Old 01-25-2008, 09:16 PM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could perform a query...

[sql]UPDATE user
SET password = md5(concat(md5('new_password'), salt))
WHERE userid NOT IN (1, 5, 7);[/sql]

1, 5, 7 being the IDs of users whose passwords you don't want to change. Just be very careful doing this - you should probably perform a backup first.
Reply With Quote
  #3  
Old 01-26-2008, 01:52 AM
teamsupra teamsupra is offline
 
Join Date: Aug 2003
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where I enter new_password would it be plain text or md5?
Reply With Quote
  #4  
Old 01-26-2008, 07:34 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry but this does not make much sense. Even with the database you can not get the passwords.

Most likely there is something else going on.
Reply With Quote
  #5  
Old 01-26-2008, 08:41 AM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Theres no point in resetting passwords as the "hacker" doesn't have the passwords in plain text, they are hashed. Therefore he can't use them to login, he might try and crack them but its unlikely he is going to waste time for a Internet Forum there wouldn't be much point to it. Just ask your users to reset the passwords themselves.
Reply With Quote
  #6  
Old 01-26-2008, 06:33 PM
teamsupra teamsupra is offline
 
Join Date: Aug 2003
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The hacker installed a VB phisher in /inc/functions_login.. What he did was add a line in the login field to email him the username and PW when they login..

I changed all the PWs so now all users have to click Forgot password.

Also there is a MD5 cracker out so once a hacker gets the USERDB they run it against the MD5 cracker.
Reply With Quote
  #7  
Old 01-27-2008, 07:01 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you talking about a "inc" directory (ie. non-vBulletin) or "includes"?

If they managed to change a file, then most likely your hosting account (or if on a shared server with bad security another account on the same server) is compromised. I striongly suggest that you ask your host to find the reason as they might be able to do it again any day.

Finally you can not crack a MD5 hash. For plain MD5 there are some rainbow tables around providing a way to lookup hashes and their possible plaintext value, but i have never seen it done for mutliple MD5's like vBulletin is using and i strongly doubt anyone will ever make such tables.
Reply With Quote
  #8  
Old 04-08-2008, 04:19 AM
Absolution Absolution is offline
 
Join Date: Sep 2006
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this doesn't work in vb3.7.0 RC2, so I've modified the script provided above

i don't program in php, but it didn't seem hard to modify
Code:
<?php
require_once('./global.php');
require_once('./includes/functions.php');
$perpage = 100;
$start = intval($_REQUEST[start]);
echo "Resetting up to $perpage passwords starting at user id $start, please stand by!<br />";
$res = $vbulletin->db->query_first("SELECT userid FROM " . TABLE_PREFIX . "user ORDER BY userid DESC LIMIT 1");
$maxuid = $res[userid];
$users = $vbulletin->db->query("SELECT userid,username,salt,email FROM " . TABLE_PREFIX . "user WHERE userid > $start ORDER BY userid ASC LIMIT $perpage");
vbmail_start();
while ($userinfo = $vbulletin->db->fetch_array($users)) {
   $vbulletin->db->query("DELETE FROM " . TABLE_PREFIX . "useractivation WHERE userid = $userinfo[userid] AND type = 1");
   $newpassword = vbrand(0, 100000000);
   $vbulletin->db->query("UPDATE " . TABLE_PREFIX . "user SET password = '" . addslashes(md5(md5($newpassword) . $userinfo['salt'])) . "', passworddate = NOW() WHERE userid = $userinfo[userid]");
   eval(fetch_email_phrases('resetpw', $userinfo['languageid']));
   vbmail($userinfo['email'], $subject, $message, true);
   echo "Reset UserID:";
   echo $userinfo[userid];
   echo "<br />";
   flush();
   $lastuid = $userinfo[userid];
}
vbmail_end();
if ($lastuid < $maxuid) {
  $start=$lastuid;
  $vbulletin->url = "resetpw.php?" . $vbulletin->session->vars['sessionurl'] . "start=$start";
  eval(print_standard_redirect('Going for another $perpage Password-Resets', 0));  
} else {
  echo "Finished!";
}
?>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:23 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03761 seconds
  • Memory Usage 2,225KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete