tejash1991

ZIP-FILE PASSWORD CRACKER

Jan 20th, 2013
2,111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.36 KB | None | 0 0
  1. #!/usr/bin/env python
  2. import os
  3. import sys
  4. import zipfile
  5. import optparse
  6. from threading import Thread
  7. if os.getuid() != 0:
  8.   print 'requires root privileges.'
  9.   sys.exit(1)
  10. print """
  11.  *****************************************************************
  12.  \tZIP-FILE PASSWORD CRACKER \t
  13.  \tWRITTEN BY : TEJASH PATEL \t
  14.  \tFACEBOOK : https://www.facebook.com/tejash1991\t
  15.  \tYOUTUBE CHANNEL : https://www.youtube.com/user/tejash443\t
  16.  *****************************************************************
  17. """
  18. def extract(zipFile, zippassword):
  19.     try:
  20.         zipFile.extractall(pwd=zippassword)
  21.         print '[+] password Found' + ':' + zippassword + '\n'
  22.     except:
  23.         pass
  24. def main():
  25.     parser = optparse.OptionParser("usage "+"-z <zipfile> -d <dictionary>")
  26.     parser.add_option('-z', dest='zipname', type='string', help='specify zip file')
  27.     parser.add_option('-d', dest='dicname', type='string', help='specify dictionary file')
  28.     (options, args) = parser.parse_args()
  29.     if (options.zipname == None) | (options.dicname == None):
  30.         print parser.usage
  31.         exit(0)
  32.     else:
  33.         zipname = options.zipname
  34.         dicname = options.dicname
  35.         zipFile = zipfile.ZipFile(zipname)
  36.         zippassFile = open(dicname)
  37.         for line in zippassFile.readlines():
  38.             zippassword = line.strip('\n')
  39.             t = Thread(target=extract, args=(zipFile, zippassword))
  40.             t.start()
  41. if __name__ == '__main__':
  42.     main()
Advertisement
Add Comment
Please, Sign In to add comment