def cracking_threads(fn, port, config):
global FOUND
global THREADS
th = []
sem = threading.BoundedSemaphore(config.concurrency)
with open(config.wordlist, "r") as f:
for i, password in enumerate(f.readlines()):
password = password.replace("\n", "")
# log.debug(" -- Testing '%s'" % password)
if FOUND is not None:
break
# Launch password
t = threading.Thread(target=find_password_sem, args=(fn, sem, config.target, port, config.user, password, None, ))
th.append(t)
sem.acquire()
t.start()
if (i % 500) == 0:
log.info(" >> %s passwords tested" % i)
# Wait for ending
for x in th:
x.join()
if FOUND is not None:
log.error(" - Password found: %s" % FOUND)
# ----------------------------------------------------------------------
评论列表
文章目录