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 07-06-2007, 04:44 PM
agallian86 agallian86 is offline
 
Join Date: Jun 2007
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default vBulletin SHA1 Workaround?

I've upgraded to vBulletin from SMF, and am looking to not have my users reset their passwords. The problem is that vBulletin uses an md5 hash while SMF uses SHA1.

So, my theory is to, during the login process, write some php code (or something else?) to essentially:
-capture input password
-convert password to md5 and check with db, if true -> login (the typical behavior), else...
-convert password to sha1, check with the db, if true ->...
-save inputted pass as an md5 hash, go back to step 2.

I've read conflicting things about how many md5 calls there are and where they are relegated to. Can anyone point out a specific place to modify (i.e. member.php) and/or give an example of how to accomplish what I need?

Thanks.

P.S. I wrote tech support on vbulletin.com and my ticket assistance said it was possible and to refer to you guys for some code modification help.

I've been informed (and learned via searching) that I need to pay most of my attention to the vbulletion_md5.js, login.php, and functions_login.php files.

I am not an experienced coder (for these languages at least) and could use some help implementing a SHA -> MD5 workaround; the workaround doesn't have to be done the way I've explained above by any means, as long as it's transparent to the user and they can login to their existing SHA'd password.
Reply With Quote
  #2  
Old 07-07-2007, 06:32 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Problems List

1./ vBulletin "zaps" (encrypts) the password before it even gets to the server, making it impossible to capture without changing a heap of things.
2./ Even if you did get past that, anyone could login as anyone and gain control of their account...
Reply With Quote
  #3  
Old 07-07-2007, 07:00 AM
agallian86 agallian86 is offline
 
Join Date: Jun 2007
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
Problems List

1./ vBulletin "zaps" (encrypts) the password before it even gets to the server, making it impossible to capture without changing a heap of things.
2./ Even if you did get past that, anyone could login as anyone and gain control of their account...
1. Why couldn't I just change the calls from md5 to sha? and/or add funtionality to the checking? (check against md5 and sha hash)

2. No, they couldn't. It would check their pw against the hash stored on the db, first as an md5 and if it didn't match try to hash it as a sha and if that didn't match then your login failed, if it did match then you store it as an md5 hash so it doesn't need to be compared each time as md5 then sha (i.e. usual vbulletin functionality).

I've been told specifically by vbulletin staff that it would work and not take tons of effort, trouble is, I don't have the faintest idea of how to code it and they're not authorized to help with code modification, and I know someone here can help point to the right direction.
Reply With Quote
  #4  
Old 07-07-2007, 07:30 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
1./ vBulletin "zaps" (encrypts) the password before it even gets to the server, making it impossible to capture without changing a heap of things.
Although not advised from a security POV, you can set 'DISABLE_PASSWORD_CLEARING' to true in your config.php, and the passwords will be passed to the server unencrypted.
Reply With Quote
  #5  
Old 07-07-2007, 09:15 AM
agallian86 agallian86 is offline
 
Join Date: Jun 2007
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Marco van Herwaarden View Post
Although not advised from a security POV, you can set 'DISABLE_PASSWORD_CLEARING' to true in your config.php, and the passwords will be passed to the server unencrypted.
Seems like a great step to what I need accomplished.

Though, since it would be now sent in plain text, would it be possible to call an SHA hash to compare against the SHA hash I have stored on the database (from SMF)? And then have that authenticate old users. And call an MD5 hash to compare against an MD5 hash stored in the database (from vBulletin).

Basically something like:
-capture pass in clear text
-sha hash it, if it matches the pw on the db allow login, else
-md5 hash it, if it matches the pw on the db allow login, else
-reject login credentials

I'm not interested in getting the passwords for my users per se, I'm interested in being able to compare old users passwords to their SHA hash from the old forum I was using and then (optionally) if that password works setting it to replace the pw field with the md5 hash so that eventually I could do away with the SHA hashing once everyone effectively gets their passwords md5'd. New users would simply work with the normal vBulletin hashing scheme and not have any issues.

I hope I'm conveying my need clearly, thanks for the directions thus far guys!
Reply With Quote
  #6  
Old 07-07-2007, 10:19 AM
El_Muerte's Avatar
El_Muerte El_Muerte is offline
 
Join Date: Nov 2001
Posts: 237
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Marco van Herwaarden View Post
Although not advised from a security POV, you can set 'DISABLE_PASSWORD_CLEARING' to true in your config.php, and the passwords will be passed to the server unencrypted.
or you extend the code to include both md5 and sha1 passwords, of course you'll need a javascript sha1 routine
Reply With Quote
  #7  
Old 07-07-2007, 10:22 AM
agallian86 agallian86 is offline
 
Join Date: Jun 2007
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So, I create something along the lines of vbulletin_sha1.js, which php files would I need to modify in order to run the comparison at a user's login? login.php and function_login.php?

I've got mixed information about where the md5 calls are performed.
Reply With Quote
  #8  
Old 07-07-2007, 10:26 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hate to say it but the easy way out seems to just have users change their passwords
Reply With Quote
  #9  
Old 07-07-2007, 11:00 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by agallian86 View Post
So, I create something along the lines of vbulletin_sha1.js, which php files would I need to modify in order to run the comparison at a user's login? login.php and function_login.php?

I've got mixed information about where the md5 calls are performed.
You would hook the login process. Read up on vBulletin Plugins and how they work .
Reply With Quote
  #10  
Old 07-09-2007, 03:07 PM
agallian86 agallian86 is offline
 
Join Date: Jun 2007
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've successfully gotten the db to store a newly created password in plain text (though this is an intermittent success as I don't want to keep it in plain text), however, the DISABLE_PASSWORD_CLEARING doesn't seem to be working as I cannot login to accounts with the unhashed password set regardless of the true/false setting for that.

In theory since the pw is now stored on the db in plain text and setting DISABLE_PASSWORD_CLEARING to true should compare the pw as plain text, now ONLY the non-hashed passwords should be logging in, correct?

Not sure why this simple set of mods is only working halfway and screwing up on the eaiser part (not zapping the pw)
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 06:28 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.04578 seconds
  • Memory Usage 2,258KB
  • 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
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete