[极客大挑战 2019] BuyFlag
本题考点:
- php 弱比较
- cookie 修改
- 科学计数法
# 1. 解题过程
点击 menu 进到 payflag 页面:
F12 看到代码
<!-- | |
~~~post money and password~~~ | |
if (isset($_POST['password'])) { | |
$password = $_POST['password']; | |
if (is_numeric($password)) { | |
echo "password can't be number</br>"; | |
}elseif ($password == 404) { | |
echo "Password Right!</br>"; | |
} | |
} | |
--> |
那么直接 post 提交 password 就行了。弱比较 就 404aa。
把 cookie 中的 user 改为 1 ,就是 Cuit's students 了。
之后用科学计数法,来购买 flag。绕过长度限制。
# 2. 知识补充
php 的科学计数法,格式
1.12E8 ------------- 112000000 1.12E3 ------------- 1120 1.12E2 ------------- 112 1.12E0 ------------- 1.12 1.12E-1 ------------ 0.112 1.12E-2 ------------ 0.0112 1.12E-8 ------------ 0.0000000112 0.112E1 ------------ 1.12 0.112E2 ------------ 11.2 0.112E4 ------------ 1120 0.112E-2 ----------- 0.001120000.112E-2 -------- 0.00112
0000.112000E-2 ----- 0.00112
.112E-2 ------------ 0.00112
.112E2 ------------- 11.2