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

Reply
 
Thread Tools Display Modes
  #1  
Old 03-11-2006, 06:26 PM
NeilFawcett NeilFawcett is offline
 
Join Date: Mar 2006
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Using VBulletin to authenticate users to my software?

I'd like to use the registration system of VBulletin to verify/identify users for a perl script I've got.

Ideally I'd like a link in VBulletin (ie: a link forum) to fire off my perl script. As part of that link I'd include the current session id of the user. On entering my perl script I'd then read the session table from the SQL database for the session id (passed to me) to get the username & if they're logged on (userid/loggedin).

From there my script should be happy. ie: I know that the person accessing my script has logged in successfully to VBulletin to get that far and I can take over from that point...


My questions are simply:-
a) Can I include the users session id in a link (somehow)? Preferably as a "Forum Link", ie: A forum definition that's actually a link. Or could I hardcode it in a template using the forum ID and include the session id in there somehow?
b) I know from Perl I can read MYSQL etc, so I assume I can read the "session" table/record using "sessionhash" and check "userid" and "loggedin" are OK?
c) If I wish to take a payment to allow access to the perl script, how could I use the subscription system in VBulletin? ie: What record/table would I have to read to see if the user has subscribed/paid?


I've very new to VBulletin so I apologise if any of these questions are noobish!

Using VBulleting to verify users would really help my site. Taking payments/subscription via VBulletin would be a nice bonus!
Reply With Quote
  #2  
Old 03-11-2006, 08:26 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A session ID is not a suitable means of authenticating somebody. A link with a session ID can be copied and pasted to some other site, and when users click the link, your script will think that they're authenticated.
Reply With Quote
  #3  
Old 03-12-2006, 07:42 AM
NeilFawcett NeilFawcett is offline
 
Join Date: Mar 2006
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by filburt1
A session ID is not a suitable means of authenticating somebody. A link with a session ID can be copied and pasted to some other site, and when users click the link, your script will think that they're authenticated.
a) Surely a session ID is only valid for X minutes or so? ie: When I go to the forum, it recognises my logon and assigns me a sessions ID. When I stop using the forum, the session record will surely be deleted within X minutes? Therefore if I try and use my suggested link after these X minutes, the session record wouldn't even exist and authentication in my script would not be valid (as it wouldn't find a session record)?

b) My script would ensure the request came from my site; The REFERER (referrer) would have to be my site. ie: Someone not could post a link on another site (as you suggest), and loads of people click it within the X minutes.

c) I could even take one step further and validate say the first 3 elements of the IP address - if that's what is held in "location" on that session table?

Surely this is a fairly good means of me piggy-backing of the VBB authentication system?
Reply With Quote
  #4  
Old 03-12-2006, 03:09 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

a. That timeout is configurable. The default is 20 minutes, but it can be anything the administrator specifies.
b. A referer can be faked.
c. An IP address is not a sufficient means of authenticating, especially only the first three octets which can be used for a pool of DHCP addresses.
Reply With Quote
  #5  
Old 03-12-2006, 04:06 PM
NeilFawcett NeilFawcett is offline
 
Join Date: Mar 2006
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by filburt1
a. That timeout is configurable. The default is 20 minutes, but it can be anything the administrator specifies.
b. A referer can be faked.
c. An IP address is not a sufficient means of authenticating, especially only the first three octets which can be used for a pool of DHCP addresses.
What I'm after here is a reasonably realistic way of using the registration system of VBB to authenticate users, not a system that would be used by the CIA

The above three suggestions used in combination would mean that someone could potentially get their session id, and give it to someone else, but it would only work if they did so within 20 minutes, and the other person was in their local area. But in general it's pretty tight? It would also mean they were risking the other person going into their VBB account itself!

Can you maybe suggest what might work, rather than what won't?

Am I right in saying that if someone has cookies enabled then the session id is held in cookies? As such could I only include the session id in my link from VBB to my software if cookies are disabled?


So my software would first of all interrogate cookies for the session id, and then failing that look for it in the URL. This would make it even more secure?


Any suggestions/help would be most appreciated...
Reply With Quote
  #6  
Old 03-14-2006, 11:57 PM
Carnage Carnage is offline
 
Join Date: Jan 2005
Location: uk
Posts: 760
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i think there is a cookie vb stores that you could look for as an extra check, i'm not 100% sure but i think it stores something like:

Code:
md5(customer_number . md5(md5(md5(password) .  salt)))
you could find out exactly what it is thats stored and use that
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 07:52 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.04006 seconds
  • Memory Usage 2,216KB
  • 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
  • (2)bbcode_quote
  • (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_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