vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Help with vB hack... (https://vborg.vbsupport.ru/showthread.php?t=63444)

MeTaL_oRgY 04-04-2004 08:42 PM

Help with vB hack...
 
Hey dudes, wuzup!?... well, I need some help with a Hack someone helped me with.. It?s a login hack for my website so ppl have to login before being able to see some pages on my site. I wnated it to share the db with the forums so ppl didin?t had to register twice.

ok, here are the files I have:

other.php
PHP Code:

<?php 
// Other.php 
//############################### start logout ############################### 
if ($action=="logout") { 
  include(
"foro/global.php"); 
  
vbsetcookie("bbuserid","",1); 
  
vbsetcookie("bbpassword","",1); 
  
vbsetcookie("bbstyleid","",1); 

  if (
$bbuserinfo[userid] > 0) { 
    
$DB_site->query("UPDATE user SET lastactivity='".(time()-$cookietimeout)."',lastvisit='".time()."' WHERE userid='$bbuserinfo[userid]'"); 
  } 


  
//$DB_site->query("UPDATE session SET userid=0 WHERE sessionhash='".addslashes($session[sessionhash])."'"); 
  
$DB_site->query("DELETE FROM session WHERE sessionhash='".addslashes($session[dbsessionhash])."'"); 

  if (
$bbuserinfo[userid] > 0) { 
    
// make sure any other of this user's sessions are deleted (incase they ended up with more than one) 
    
$DB_site->query("DELETE FROM session WHERE userid='$bbuserinfo[userid]'"); 
  } 

  
$session['sessionhash']=md5(uniqid(microtime())); 
   
$session['dbsessionhash']=$session['sessionhash'];

  
$DB_site->query("INSERT INTO session  (sessionhash,userid,host,useragent,lastactivity,styleid) VALUES ('".addslashes($session['sessionhash'])."','0','".addslashes($session['host'])."','".addslashes($session['useragent'])."','".time()."','0')"); 
  
vbsetcookie("sessionhash",$session['sessionhash'],0); 

  
//header("Location: $url"); set this to the page to go back to 



// ############################### start login ############################### 
if ($action=="login") { 
  include(
"foro/global.php"); 
  
$userid 0
  if (isset(
$username)) { 
    
// get userid for given username 
    
if ($user=$DB_site->query_first("SELECT userid,username,password,cookieuser FROM user WHERE username='".addslashes(htmlspecialchars($username))."'")) { 
      if (
$user['password']!=md5($password)) {  // check password 
        
print("Incorrect Password/Contrase?a incorrecta."); 
        exit; 
      } 
      
$userid=$user[userid]; 
    } else { 
// invalid username entered 
      
print("Incorrect Username/Nombre de usuario incorrecto"); 
      exit; 
    } 

    if (
$user['cookieuser']==1) { 
      
vbsetcookie("bbuserid",$user['userid']); 
      
vbsetcookie("bbpassword",$user['password']); 
    } 

    
$DB_site->query("DELETE FROM session WHERE sessionhash='".addslashes($session[dbsessionhash])."'"); 

    
$session['sessionhash']=md5(uniqid(microtime())); 
     
$session['dbsessionhash']=$session['sessionhash'];

    
$DB_site->query("INSERT INTO session  (sessionhash,userid,host,useragent,lastactivity,styleid) VALUES ('".addslashes($session['sessionhash'])."','".intval($userid)."','".addslashes($session['host'])."','".addslashes($session['useragent'])."','".time()."','$session[styleid]')"); 
    
vbsetcookie("sessionhash",$session['sessionhash'],0); 
    
$username $user['username']; 
  } 

  
$url=ereg_replace("sessionhash=[a-z0-9]{32}&","",$url); 
  
$url=ereg_replace("\?sessionhash=[a-z0-9]{32}","",$url); 
  
$url=ereg_replace("s=[a-z0-9]{32}&","",$url); 
  
$url=ereg_replace("\?s=[a-z0-9]{32}","",$url); 

  if (
$url!="" and $url!="foro/index.php" and $url!=$HTTP_REFERER) { 

    if (
strpos($url,"?")>0) { 
      
$url.="&s=$session[dbsessionhash]"
    } else { 
      
$url.="?s=$session[dbsessionhash]"
    } 
     
    
//header("Location: $url"); set this to the page to go back to 
  
} else { 
    
$bbuserinfo=getuserinfo($userid);//header("Location: $url"); set this to the page to go back to 



?>

moa.php
PHP Code:

<?php 
include("foro/global.php"); 
if(
$bbuserinfo['userid']==0){ 
///Means they are not logged in 
//so it prints login box 
print(
    <form action=other.php method=post> 
    <tr> 
    <td nowrap><font face=\"verdana,arial,helvetica\" size=1 >Login with username and password:</font></td><br>
    </tr><tr> 
    <td nowrap> 
    <input type=hidden name=action value=login> 
    <input type=text class=bginput name=username size=7> 
    <input type=password class=bginput name=password size=7> 
    <input type=submit class=bginput value=Login!></td> 
    </tr> 
    </form> 
"
); 
}else{ 
///they are logged in so it let's 
//them log out, you can put "protected" 
//stuff here 
include("emulacion/roms2.htm");
     


?>

They work right when u do not include em to the home.php page:
( http://zelda.wi3k.net/moa.php )
excepting that after login in they redirect u to the other.php file instead of the moa.php page, but this is a small problem...

the problem comes when I include the moa.php file with the home.php file...
demo: http://zelda.wi3k.net/home2.php?id=moa.php

though it works (the login box appears if someone isn?t logged in and if they are logged in then prints the "emulacion/roms.hmt" page.... ) It gave this error:

loged in it gaves me this error:
PHP Code:

WarningCannot modify header information headers already sent by (output started at /usr/home/wi3knet/public_html/zelda/home.php:8in /usr/home/wi3knet/public_html/zelda/foro/admin/functions.php on line 2020 

Not logged gaves this:
PHP Code:

WarningCannot modify header information headers already sent by (output started at /usr/home/wi3knet/public_html/zelda/home.php:8in /usr/home/wi3knet/public_html/zelda/foro/admin/functions.php on line 2020

Warning
Cannot modify header information headers already sent by (output started at /usr/home/wi3knet/public_html/zelda/home.php:8in /usr/home/wi3knet/public_html/zelda/foro/admin/functions.php on line 2020 

my question is, is there a way of fixing this WITHOUT using frames? I really don?t like frames XD... so, is there a way?.... someone plz help T_T

P.S. If someone could help with the redirection problem also, it would be AWSOME!!
P.S. 2: as u can see, I?m totally newbie at programming, this scripts were NOT written by me... I?m just asking for some suggestions here....

MeTaL_oRgY 04-05-2004 04:18 PM

I managed to have the login box on the menu in a iframe, I really dont care about it :P excepting that when someone logs-in the iframe turns white cuz it goes to other.php instead of moa.php.....

but I still canĀ“t get rid of the header error, PLZ hELP!! T____T


All times are GMT. The time now is 08:45 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.01223 seconds
  • Memory Usage 1,779KB
  • 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
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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