Last active
January 29, 2019 23:33
-
-
Save netspooky/f9d9a425a0be8ad60781e397a64e5d41 to your computer and use it in GitHub Desktop.
This file contains 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
import subprocess | |
import sys | |
import os | |
archive = sys.argv[2] | |
passfile = sys.argv[1] | |
f = open(passfile, "r") | |
for line in iter(f): | |
trypass = line.strip('\n') | |
#print "Trying: " + trypass | |
FNULL = open(os.devnull,'w') | |
p = subprocess.call(['/usr/bin/7z','t','-p'+trypass,archive],stdout=FNULL,stderr=subprocess.STDOUT) | |
if p == 0: | |
print "Correct Password is: " + trypass | |
break | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment