Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-23-2012, 01:37 AM
CommanderFluffy CommanderFluffy is offline
 
Join Date: Nov 2006
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Password Encriptions

Hi all,

im looking for a way to change vbulletin from md5 to sha2 can anyone give me instructions on how to do that?

or can anyone give me detailed step by step instructions to salt the md5 hash codes?

yes i have google'd yes i have looked. all the stuff is old and i dont know if it even matches.

i also cant find something detailed walkthrough on how to do it.

vbulletin version 4.1.4 or higher would be great for this stuff.
Reply With Quote
  #2  
Old 07-23-2012, 01:14 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The password is saved in the database as md5(md5(password) . salt), so it already includes salt (or maybe you mean something different). The place that creates the hash is in includes/class_dm_user.php, function hash_password(), and the main place that checks it is in includes/functions_login.php, function verify_authentication(). But if you were going to change it to sha2 I think there are other places that would need to be changed as well (searching all code for md5(md5( is probably a good start).
Reply With Quote
  #3  
Old 07-23-2012, 05:15 PM
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
Location: GER
Posts: 765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

4 to be precise. This should spare you the search:

Code:
www-data@debianfish:/var/www/forum$ find . -iname "*.php" | xargs grep "md5(md5"
./profile.php:                  vbsetcookie('password', md5(md5($vbulletin->GPC['newpassword'] . $vbulletin->userinfo['salt']) . COOKIE_SALT), true, true, true);
./includes/class_dm_user.php:                   if ($password == md5(md5($this->fetch_field('username')) . $salt))
./includes/functions_login.php:                 $vbulletin->userinfo['password'] != iif($password AND !$md5password, md5(md5($password) . $vbulletin->userinfo['salt']), '') AND
./includes/class_bootstrap.php:                 if ($vbulletin->userinfo['password'] == md5(md5($vbulletin->userinfo['username']) . $vbulletin->userinfo['salt']))
./includes/class_core.php:      * @param        string          Password, must arrive in cookie format: md5(md5(md5(password) . salt) . 'abcd1234')
Reply With Quote
  #4  
Old 07-23-2012, 10:00 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh, one more thing that just occurred to me: normally a password the user enters is hashed with a javascript function before it's sent to the server (which is why the verify_authentication() function checks for a plain text password or md5(password). If you search the templates for md5hash, you'll find where this is done.

I also just noticed that you asked for "detailed step by step instructions", and that's not what I gave you. Sorry, I guess it's a little too complicated for that (although someone else might take a shot at it).
Reply With Quote
  #5  
Old 07-23-2012, 10:08 PM
CommanderFluffy CommanderFluffy is offline
 
Join Date: Nov 2006
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the main reason i need this is some guy got into my database and unsalted and unhashed quite alot of passwords and posted them public to the server. great dissapointment to me and what i had...

now im looking for the more secure sha2. if you could even provide a step by step what needs to change and how kinda thing that would be great!
Reply With Quote
  #6  
Old 07-23-2012, 10:49 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's not going to be easy, not to mention would break with every upgrade. You need to take better steps to protect your users data in the first place. If someone can get into the system with enough time and effort they can still decrypt passwords.

also understand that they did not unhash the passwords. They used brute force of trying hundreds of thousands of combinations to break the md5 hash. Its not something you just click a button on and find the right combo.

If your database were better protected in the first place, he wouldn't have been able to access it, and get the data to try to hammer on.
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 01:28 PM.


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.03668 seconds
  • Memory Usage 2,206KB
  • Queries Executed 11 (?)
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
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)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