vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   sessionhash and idhash (https://vborg.vbsupport.ru/showthread.php?t=100285)

marcelk1809 11-07-2005 06:31 AM

sessionhash and idhash
 
Where does vb 3.5.1 make the sessionhash and the idhash ???

need to know it, to add sessions of users that visit the site without being in the forums

Marco van Herwaarden 11-08-2005 03:16 PM

this is done in class_core.php.

monotreme 01-04-2006 04:12 PM

Classic example of a glib unhelpful answer.

I KNOW it's done in class_core.php but that code is so forking obtuse and there's so many layers that it takes a couple of HOURS of intense code backtracing to find where the stuff actually originates.

idhash I have discovered.
it comes from SESSION_IDHASH
and to get that you md5 ($_SERVER['HTTP_USER_AGENT'] . $registry->alt_ip);

And if you want to know what alt_ip is you must duplicate the function fetch_alt_ip
which uses optional headers to see if a proxy requester leaked any info about where they really came from. But they are optional. Really sneaky people will turn it all off.

That's a reasonably good way to id people, but if you have a NAT'd group with RFC addys and they all have the same useragent and the same user is logged into several identical stations in a NAT
subnet it might cause trouble so you need the sessionhash.

I'm still working on actually COMPUTING the correct session hash. So far I've found that an alias for it is the 's' variable and that when its inserted in the db it is found in
$vbulletin->session->vars['sessionhash']

Now if I can just figure out how and when that forking thing is computed in the first place I'm home free.

war_bird 07-28-2006 11:00 PM

id hash i have discovered;

$ipadress=getenv("REMOTE_ADDR");
$ses_idhash=md5($_SERVER['HTTP_USER_AGENT'].$ipadress);

Paul M 07-29-2006 12:43 PM

From class_core ;

PHP Code:

function fetch_sessionhash()
{
    return 
md5(TIMENOW SCRIPTPATH SESSION_IDHASH SESSION_HOST vbrand(11000000));



Quote:

Originally Posted by monotreme
I KNOW it's done in class_core.php but that code is so forking obtuse and there's so many layers that it takes a couple of HOURS of intense code backtracing to find where the stuff actually originates.

It took about 5 minutes. :)

iansmith 08-08-2007 09:16 PM

Anyone figure out the formulea for creating an idhash? The above post (old) is for sessionid which is not the same thing.

I am trying to create a login by adding an entry to the session table from outside vb and the idhash seems to be the sticking point.

janitor123 07-31-2010 11:22 PM

I know that this reply is to a very, very old post but I wanted to put here an answer that I found for others that may be looking for it. This is taken from the DrupalVB module to auto login to Drupal. This module sets cookies for vBulletin to look for.

I am using this module with Drupal 6.17 and vBulletin 3.8.4 PL2

The below is in PHP
Code:

$idhash = md5($_SERVER['HTTP_USER_AGENT'] . $vbuser['userid']);
$sessionhash = md5($now . request_uri() . $idhash . $_SERVER['REMOTE_ADDR'] . user_password(6));


Speysider 08-01-2010 05:42 AM

Have you joined to just go around bumping threads?

aussiev8 10-31-2010 08:54 AM

They made it much easier now


PHP Code:

    function fetch_sessionhash()
    {
        return 
md5(uniqid(microtime(), true));
    } 



All times are GMT. The time now is 04:01 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.03552 seconds
  • Memory Usage 1,731KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete