1 thing i realised is cookies expire on my server every 30 mins on inactivity the way i got around this was setcookie function if ya smart can use it to make a update function for sessions thru cookies
Hiding Session Id
Collapse
X
-
Originally posted by djlee View Postthen if like what im guessing is default LL you pass the sid between pages in the GET header i simply find an xss hole in your site (there is one in a specific location on most LL sites that havent been security checked) and then use this that js file is then able to successfully forward the user to a php page on my site which notes the passed sid which the js file grabbed from the url prior to redirection, then forwards to back to the online user list or whatever thinking that the page just didnt load. (this was a POC, with a little messing i could have had it do all that and still display the page just fine).. i then simply send a message to the owner "hey check out my awesome sig/text/avatar/wateva in my profile, they view it, i grab their sid, jump on their account and commit mass deletion ofcourse since im using JS file with some playing and tweaking, since the JS runs client side and ur on the cookies domain before redirecton i could also steal any cookies stored too, so saving session ids to cookies is also a little bit unsecure, but its a lot more secure than other methods and with other security stuff in there saving sessions or even the uid/passhash to a cookie is perfectly finesigpic
|~~Dont forget to say thanx~~|
Comment
-
Originally posted by jsyguy23 View Postim not taken credit for what you gave me this was before you helped me when i was useing
PHP Code:session_cache_limiter('none'); ///// i put this at top of every page
session_start();
ob_start();
ini_set('url_rewriter.tags', 'ses=$ses');
session_destroy(); /// this at bottom of every page
Options +Indexes
<IfModule mod_php4.c>
php_value session.use_only_cookies 1
php_value session.use_trans_sid 0
</IfModule> /// this in haccess file
Last edited by metulj; 14.06.09, 06:51.LDSWAPWORLD sigpic
site closed.
im busy with other things in life like facebook , send me PM so i can add you
www.pinoySG.com
don't ask for help if you're not even helping yourself!
i am tired of seeing the line "best site", i want to see something NEW and UNIQUE. maybe if i find one, ill go back to my wap life again.
Comment
-
Originally posted by capofret View Postwhere do i put these??:confused: i tried it but didnt work.
<?
on every page
PHP Code:session_cache_limiter('none'); ///// i put this at top of every page
session_start();
ob_start();
ini_set('url_rewriter.tags', 'ses=$ses');
Code:Options +Indexes <IfModule mod_php4.c> php_value session.use_only_cookies 1 php_value session.use_trans_sid 0 </IfModule> /// this in haccess file [/codebox]
Comment
-
Originally posted by Spook View Postafter
<?
on every page
PHP Code:session_cache_limiter('none'); ///// i put this at top of every page
session_start();
ob_start();
ini_set('url_rewriter.tags', 'ses=$ses');
Code:Options +Indexes <IfModule mod_php4.c> php_value session.use_only_cookies 1 php_value session.use_trans_sid 0 </IfModule> /// this in haccess file [/codebox]
Comment
-
in htaccess
Code:php_value session.use_cookies 0 php_value session.use_trans_sid 0 php_flag register_globals Off php_value magic_quotes_gpc 0 php_value magic_quotes_runtime 0 php_value magic_quotes_sybase 0
PHP Code:Error_Reporting(E_ALL & ~E_NOTICE);
ini_set('arg_separator.output', '&');
ini_set('session.name', 'SID');
ini_set('session.gc_maxlifetime','3600');
@session_start();
define('SID', session_name().'='.session_id());
PHP Code:<?
$nickname = $_POST['nickname'];
$password = $_POST['password'];
$q = mysql_query("SELECT id FROM `users` WHERE `nickname` = '".$nickname."' AND `password` = '".md5($password.md5($password))."' LIMIT 1;");
if(mysql_num_rows($q) == 0)
{
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.3//EN\" \"http://www.wapforum.org/DTD/wml13.dtd\"><wml>\n";
echo "<card title=\"ERROR\" ontimer=\"index.php\"><timer value=\"15\"/><p align=\"left\">\n";
echo "You are not logged in or your session has been expired<br/>\n";
echo "</p></card></wml>";
ob_end_flush();
exit();
}
else
{
$user = mysql_fetch_array($q);
$id = $user['id'];
$_SESSION['id'] = $id;
$_SESSION['password'] = $password;
}
# other pages links
echo "<a href=\"index.php?".SID."&nocache=".$nocache."&v=".$v."\">Downloads</a><br/>\n";
?>
PHP Code:<?
# authentication for other pages
$id = $_SESSION['id'];
$password = $_SESSION['password'];
$q = mysql_query("SELECT `level` FROM `users` WHERE `id` = '".$id."' AND `password` = '".md5($password.md5($password))."';");
if(mysql_num_rows($q) == 0)
{
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.3//EN\" \"http://www.wapforum.org/DTD/wml13.dtd\"><wml>\n";
echo "<card title=\"ERROR\" ontimer=\"index.php\"><timer value=\"15\"/><p align=\"left\">\n";
echo "You are not logged in or your session has been expired<br/>\n";
echo "</p></card></wml>";
ob_end_flush();
exit();
}
else
{
$user = mysql_fetch_array($q);
$level = $user['level'];
}
?>Last edited by Anshul; 11.05.09, 11:05.
Comment
-
some of this code u may need to put on several pages i didnt as my site runs off my index page
this went at top index page under <?php
PHP Code:session_name("PHPSESID");
session_start();
PHP Code:$GetSession = fetch_array("sesid",sessions,"LOWER(username) = LOWER('$nick')");
if(empty($GetSession))$sesid = NewSessionID($nick,$_SERVER['HTTP_USER_AGENT'],ip(),subno(ip()));
else $sesid=$GetSession;
$_SESSION['username'] = fetch_array("username",members,"LOWER(username) = LOWER('$nick')");
$_SESSION['ses'] = $sesid;
$_SESSION['uid'] = fetch_array(id,members,"LOWER(username) = LOWER('$_SESSION[username]')");
PHP Code:delete(sessions,"LOWER(username) = LOWER('$_SESSION[username]')");
session_unset();
session_destroy();
Comment
-
Originally posted by synergyx2009 View Postok this code looks better but does it hide the session at all?
Code:<?php header('Content-type: application/xhtml+xml'); echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"; echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"; define( 'MC_DIR', dirname(__FILE__) . '/' ); require_once( MC_DIR. 'global.inc.php' ); require_once( MC_DIR. 'base.php' ); COMMUNITY::run_script(); ?>
R.M.C
----------
PHP Adovocate B)
Comment
-
Originally posted by synergyx2009 View Postok but wat happens if session expires after lets say 10 - 15mins. then there is nothing you can do with that hash.
Comment
Comment