Last active
August 29, 2015 13:56
-
-
Save Torxed/9208781 to your computer and use it in GitHub Desktop.
Temp
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
from threadimg import * | |
class worker(Thread): | |
def __init__(self, filehandle, password, crackflag): | |
Thread.__init__(self) | |
self.fh = filehandle | |
self.pwd = password | |
self.cracked = crackflag | |
self.start() | |
def run(self): | |
if not self.cracked: | |
zfh = zipfile.ZipFile(self.fh) | |
try: | |
zfh.extractall(pwd=self.pwd) | |
print('Extracted:',self.pwd) | |
cracked = self.pwd | |
exctept: | |
pass | |
cracked = False | |
zipcontent = StringIO.StringIO() | |
with open('crackme.zip', 'rb') as fh: | |
zipcontent.write(fh.read()) | |
for password in ('notworking', 'aanl0', '12345'): | |
worker(zipcontent, password, cracked) | |
while len(enumerate()) > 1: | |
pass #waiting for threads to finish | |
print(cracked) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment