MCPcopy Create free account
hub / github.com/geekcomputers/Python / findPassword

Function findPassword

BruteForce.py:4–27  ·  view source on GitHub ↗
(chars, function, show=50, format_="%s")

Source from the content-addressed store, hash-verified

2
3
4def findPassword(chars, function, show=50, format_="%s"):
5 password = None
6 attempts = 0
7 size = 1
8 stop = False
9
10 while not stop:
11 # Obtém todas as combinações possíveis com os dígitos do parâmetro "chars".
12 for pw in product(chars, repeat=size):
13 password = "".join(pw)
14
15 # Imprime a senha que será tentada.
16 if attempts % show == 0:
17 print(format_ % password)
18
19 # Verifica se a senha é a correta.
20 if function(password):
21 stop = True
22 break
23 else:
24 attempts += 1
25 size += 1
26
27 return password, attempts
28
29
30def getChars():

Callers 1

BruteForce.pyFile · 0.85

Calls 2

productFunction · 0.85
functionFunction · 0.85

Tested by

no test coverage detected