Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Accept cookie authorization only from last user's session host (or IP range) Details »»
Accept cookie authorization only from last user's session host (or IP range)
Version: 1.00, by JohnWoo JohnWoo is offline
Developer Last Online: Apr 2014 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 07-24-2004 Last Update: Never Installs: 2
 
No support by the author.

Hello!

As we all know, native VB authorization have two main weak sides:
- cookie connected only with username (userid)
[if somebody will steal your cookies (all browsers including latest allow to do it very easy), he will be able to enter]
- password string (even md5 hash of password from JS) in post data always same
[is somebody in your network can trace you HTTP headers, he will be able to send same post data and enter]
We can try to fight with first problem connecting cookie stored in browser with users host or, if php on your server have no gethostbyaddr function, with first 3 numbers of IP (IP range).
After installing authorization scenario will be the following:
1. user enter username and password in login form and submit it
2. if password match vb set two cookies:
- userid (number)
- password hash
[md5 hash for the result of concatenation "already hashed password stored in db" + "current user's host or ip range" + "some long string just to be more sure".
But if user host look like "dialaup-1276.something.isphost.com", only "isphost.com" part will be included in concatenation.]
3. If user use cookie authorization, VB will compare cookie send by browser with same md5 hash of same concatenation result. So if cookie comes from different host, user will be forced to enter password again.

Hope that this small hack will make your vb little more secure

PS It is possible to fight easy with second weak side too, but it needs too much files and template changes and explanations and i don't fink that i'll be able to explaing it with my English Sorry

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 07-25-2004, 01:32 PM
???`S?LV?R???`'s Avatar
???`S?LV?R???` ???`S?LV?R???` is offline
 
Join Date: Aug 2003
Posts: 368
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice addition
Reply With Quote
  #3  
Old 08-06-2004, 03:44 PM
YLP1 YLP1 is offline
 
Join Date: Aug 2004
Posts: 417
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am trying to install this mod but the second step of replacing this code:
vbsetcookie('password', md5($bbuserinfo['password'] . ''));

or may be

vbsetcookie('password', md5($bbuserinfo['password'] . 'somerandomstring'));

My version (3.0.03 ) shows this in two instances:

vbsetcookie('password', md5($bbuserinfo['password'] . 'IN HERE IS 8 Characters that I didn't want to post cuz I don't know what they are'), 0);

AND

vbsetcookie('userid', $bbuserinfo['userid'], 0);
vbsetcookie('password', md5($bbuserinfo['password'] . 'HERE IS 8 Characters that I didn't want to post cuz I don't know what they are'), 0

I am afraid to overwrite this piece....any suggestions?
Reply With Quote
  #4  
Old 08-06-2004, 04:26 PM
JohnWoo's Avatar
JohnWoo JohnWoo is offline
 
Join Date: Jan 2002
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have not seen 3.0.03 yet...
But vbsetcookie function in Gold with last zero as parameter, set cookie that will disappear after closing browser, so i understand nothing and can suggest nothing. Sorry
Reply With Quote
  #5  
Old 08-08-2004, 11:26 AM
MrZeropage's Avatar
MrZeropage MrZeropage is offline
 
Join Date: Nov 2003
Location: Munich, Germany
Posts: 3,012
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

somerandomstring is called "salt" in vBulletin 3.0.3 and is a random string of three characters.

The password is hashed like this: md5(md5($bbuserinfo['password'] . $bbuserinfo['salt'])) so md5 is used twice, once the password is hashed and then the "salt" gets added and then the whole things gets hashed again, and this hash is stored in the database.
Reply With Quote
  #6  
Old 08-08-2004, 01:00 PM
JohnWoo's Avatar
JohnWoo JohnWoo is offline
 
Join Date: Jan 2002
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, but for cookie authorization vb3 use another random string It is not stored in db and i feel that it connected with licence number somehow
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 10:38 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.03660 seconds
  • Memory Usage 2,250KB
  • Queries Executed 21 (?)
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)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)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
  • (5)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_postinfo_query
  • fetch_postinfo
  • 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