mirror of
https://github.com/carlospolop/hacktricks
synced 2024-11-22 12:43:23 +00:00
17 lines
367 B
Markdown
17 lines
367 B
Markdown
|
# Bruteforce hash \(few chars\)
|
||
|
|
||
|
```python
|
||
|
import hashlib
|
||
|
|
||
|
target = '2f2e2e' #/..
|
||
|
candidate = 0
|
||
|
while True:
|
||
|
plaintext = str(candidate)
|
||
|
hash = hashlib.md5(plaintext.encode('ascii')).hexdigest()
|
||
|
if hash[-1*(len(target)):] == target: #End in target
|
||
|
print('plaintext:"' + plaintext + '", md5:' + hash)
|
||
|
break
|
||
|
candidate = candidate + 1
|
||
|
```
|
||
|
|