Supersqli
打开页面初步筛查这是一道 SQL 注入题。
测试发现存在基础注入点:
1' or 1=1 #
接下来查询字段数,确定字段数为 2:
1' order by 2 #
尝试查询数据库信息,发现 database() 等常见函数被过滤。但未过滤分号,可利用堆叠注入配合 show tables 查看表结构:
1';show tables ;#
成功查询到一个特殊表 1919810931114514。查询该表列信息发现含 flag,但 select 关键字被过滤。此时可利用 handler 语句代替 select 进行数据读取:
1';handler `1919810931114514` open as `a`;handler `a` read next;#
成功拿到 flag。
Warmup
页面提示存在 source.php。访问后获取源代码进行审计。
访问 hint.php 提示 flag 位于 ffffllllaaaagggg。
代码审计
<?php highlight_file(__FILE__); //代码高亮
class emmm {
public static function checkFile(&$page) //checkFile 用于检查文件参数是否合法
{
$whitelist = ["source"=>"source.php","hint"=>"hint.php"];
if (! isset($page) || !()) {
;
;
}
((, )) {
;
}
= (, , ( . , ));
((, )) {
;
}
= ();
= (, , ( . , ));
((, )) {
;
}
;
;
}
}
(! ([]) && ([]) && emmm::([])) {
[];
;
} {
;
}


