Sparge parola de pe o arhiva zip

0

Buna ziua doamnelor si domnilor si bine v-am regasit. Ma numesc Zero Davila, iar astazi vom sparge o parola al unei arhive de tip zip utilizand un dictionar si un script de python.

import zipfile
import optparse
from threading import Thread
def extractFile(zFile, password):
try:
zFile.extractall(pwd=password)
print ‘[+] Parola identificata ‘ + password + ‘\n’
except:
pass
def main():
parser = optparse.OptionParser(“utilizare %prog “+\
“-f <zipFile> -d <dict>”)
parser.add_option(‘-f’, dest=’zname’, type=’string’,\
help=’specify zip file’)
parser.add_option(‘-d’, dest=’dname’, type=’string’,\
help=’specify dictionary file’)
(options, args) = parser.parse_args()
if (options.zname == None) | (options.dname == None):
print parser.usage
exit(0)
else:
zname = options.zname
dname = options.dname

zFile = zipfile.ZipFile(zname)
passFile = open(dname)

for line in passFile.readlines():
password = line.strip(‘\n’)
t = Thread(target=extractFile, args=(zFile, password))
t.start()
if __name__ == ‘__main__’:
main()

Leave A Reply

Your email address will not be published.