Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crack.py #1

Open
adi223ujc opened this issue Jul 15, 2020 · 0 comments
Open

Crack.py #1

adi223ujc opened this issue Jul 15, 2020 · 0 comments

Comments

@adi223ujc
Copy link
Contributor

import zipfile
from time import time

'''

Zip password cracker
By Dictionary password attack
Using Python

'''

def main():
try:
myZip = zipfile.ZipFile("encrypted.zip")
except zipfile.BadZipfile:
print "There was an error opening your zip file."
return

password = ''

print "Password cracking started..."
print " "
print "For more cracker script, subscribe our channel"
print "http://youtube.com/techtipstricksbd"
print " "
print "Please wait...."
timeStart = time()
with open("passwords.txt", "r") as f:
    passes = f.readlines()
    for pass_count, x in enumerate(passes):
        password = x.strip()
        try:
            myZip.extractall(pwd = password)
            totalTime = time() - timeStart
            print "\nPassword cracking successful: %s\n" % password
            print "%i Password tried per second " % (pass_count/totalTime)
            print " "
            print "For thanking us, subscribe our channel"
            print "http://youtube.com/techtipstricksbd"
            return
        except Exception as e:
            if str(e[0]) == 'Bad password for file':
                pass # TODO: properly handle exceptions?
            elif 'Error -3 while decompressing' in str(e[0]):
                pass # TODO: properly handle exceptions?
            else:
                print e
    print "Please try another passwords list file"
    print "For more cracker script, subscribe our channel"
    print "http://youtube.com/techtipstricksbd"

if name == 'main':
main()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant