Bugku——十六進位制與數字比較
阿新 • • 發佈:2018-12-19
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