Message from Python discussions
December 2018
— Exercise 1:
Write a function that returns hello wolrd without using print or pprint
Since after 3.7, dictionary keeps track of the order of insertion, is there still need of collections.OrderedDict
?
— Hi IAM new to python
— Import zipfile
import optparse
from threading import Thread
def crackfile(zfile, password):
try:
zfile.extractall(pwd=password)
print '[+] Password is :' + password + '\n'
print '[+] Congratulations... File extracted !'
return True
except:
pass
def readpassword():
for line in passwordfile.readlines():
global password
password = line.strip('\n')
t = Thread(target=crackfile, args=(zfile, password))
t.start()
def main():
parser = optparse.OptionParser("usage :"+\
"-f <target zip file> -d <dicctionary list>")
parser.add_option('-f', dest='zipfilename', type='string',\
help='password protected zip file')
parser.add_option('-d', dest='dictionaryname', type='string',\
help='dictionary list(.txt)')
(options, arg) = parser.parse_args()
print '\t\t\t ######################################'
print '\t\t\t ## ##'
print '\t\t\t ## Author : Sandeep Saini ##'
print '\t\t\t ## Version : V0.1zPC ##'
print '\t\t\t ######################################'
global passwordfile
global zfile
if (options.zipfilename == None) | (options.dictionaryname == None):
print parser.usage
exit(0)
else:
zipfilename = options.zipfilename
dictionaryname = options.dictionaryname
zfile = zipfile.ZipFile(zipfilename)
passwordfile = open(dictionaryname)
readpassword()
if not crackfile(zfile, password):
print '[-] Sorry... Paasword Could not found'
print '[+] Here is the solution : Try with diffrent dictionary list!'
main()
— ׳import zipfile
import optparse
from threading import Thread
def crackfile(zfile, password):
try:
zfile.extractall(pwd=password)
print '[+] Password is :' + password + '\n'
print '[+] Congratulations... File extracted !'
return True
except:
pass
def readpassword():
for line in passwordfile.readlines():
global password
password = line.strip('\n')
t = Thread(target=crackfile, args=(zfile, password))
t.start()
def main():
parser = optparse.OptionParser("usage :"+\
"-f <target zip file> -d <dicctionary list>")
parser.add_option('-f', dest='zipfilename', type='string',\
help='password protected zip file')
parser.add_option('-d', dest='dictionaryname', type='string',\
help='dictionary list(.txt)')
(options, arg) = parser.parse_args()
print '\t\t\t ######################################'
print '\t\t\t ## ##'
print '\t\t\t ## Author : Sandeep Saini ##'
print '\t\t\t ## Version : V0.1zPC ##'
print '\t\t\t ######################################'
global passwordfile
global zfile
if (options.zipfilename == None) | (options.dictionaryname == None):
print parser.usage
exit(0)
else:
zipfilename = options.zipfilename
dictionaryname = options.dictionaryname
zfile = zipfile.ZipFile(zipfilename)
passwordfile = open(dictionaryname)
readpassword()
if not crackfile(zfile, password):
print '[-] Sorry... Paasword Could not found'
print '[+] Here is the solution : Try with diffrent dictionary list!'
main()
׳
— Cant copy it here send me pm
— Its givinf me admin message
— I think ur problem is a spelling error at the bottom
It should be “sorry...password could not be found, life sucks, move on”
— ?!
— Any software expert here. I want to crack software
— Today is your lucky day, check Liron he’s cracking zip files, maybe he can give you a hand
— ?!