Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. import subprocess
  2. import sys
  3.  
  4. def main():
  5.     archive = sys.argv[1]
  6.     dictionary = sys.argv[2]
  7.     with open(dictionary, "rb") as dic:
  8.         for word in dic.read().splitlines():
  9.             stdout = subprocess.call("7z t -p'{0}' {1}".format(word.decode("utf-8"), archive), stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL, shell=True)
  10.             if stdout == 0:
  11.                 print("Password found: " + word.decode("utf-8"))
  12.                 return
  13.     print("Password not found.")
  14.  
  15. if __name__ == "__main__":
  16.     if len(sys.argv) == 3:
  17.         main()
  18.     else:
  19.         print("missing args")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement