Last active
August 4, 2018 20:28
-
-
Save growlnx/eb0f3ce57528b9fad6a086a8d3228ee5 to your computer and use it in GitHub Desktop.
testador de password
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, os, subprocess as sub | |
arg = sys.argv | |
if len(arg) < 3: | |
print('bf.py <FILE>.cpt <DICT>.txt') | |
exit(1) | |
if not os.path.exists(arg[1]): | |
print('arquivo inválido') | |
exit(2) | |
wordlist = open(arg[2],'r') | |
tentativa = 0 | |
for word in wordlist: | |
cmd = ['ccrypt', '-d', arg[1], '-K', word] | |
ccrypt = sub.Popen(cmd, stdout=sub.DEVNULL, stderr=sub.DEVNULL) | |
tentativa += 1 | |
if not ccrypt.wait(): | |
print('password: {}\ntentativas: {}'.format(word, tentativa)) | |
exit(0) | |
print('password nao encontrada') | |
exit(3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment