Bugku——十六进制与数字比较
0x00 前言
今日份CTF。
2018年11月2日
题目
0x01 start
首先来看看源码
<?php
error_reporting(0);
function noother_says_correct($temp)
{
$flag = 'flag{test}';
$one = ord('1'); //ord — 返回字符的 ASCII 码值
$nine = ord('9'); //ord — 返回字符的 ASCII 码值
$number = '3735929054';
// Check all the input characters!
for ($i = 0; $i < strlen($number); $i++)
{
// Disallow all the digits!
$digit = ord($temp{$i});
if ( ($digit >= $one) && ($digit <= $nine) )
{
// Aha, digit not allowed!
return "flase";
}
}
if($number == $temp)
return $flag;
}
$temp = $_GET['password'];
echo noother_says_correct($temp);
?>
好吧,这道题其实我不会做,都是看大佬们的wp做的。
大佬是这样说的用16进制的数字去绕过就可以了。
payload
?password=0xdeadc0de