Skip to content

Instantly share code, notes, and snippets.

@netspooky
Last active January 29, 2019 23:33
Show Gist options
  • Save netspooky/f9d9a425a0be8ad60781e397a64e5d41 to your computer and use it in GitHub Desktop.
Save netspooky/f9d9a425a0be8ad60781e397a64e5d41 to your computer and use it in GitHub Desktop.
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