Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import multiprocessing
- import subprocess
- class PyCrack:
- def __init__(self, slice):
- self.pwrd = multiprocessing.Array('c', '\n' * 512)
- self.lock = multiprocessing.Lock()
- self.workers = []
- for entry in slice:
- worker = multiprocessing.Process(target=self.logic, args=(entry,))
- self.workers.append(worker)
- def logic(self, entry):
- if entry == "":
- return
- try:
- args = ["steghide", "extract", "-sf", "meow.wav", "-p", "%s" % entry]
- proc = subprocess.Popen(args, stdin=-1, stdout=-1, stderr=-1)
- out, err = proc.communicate()
- if "could not extract" not in err:
- self.set(entry)
- except:
- pass
- def set(self, entry):
- self.lock.acquire()
- self.pwrd.value = entry
- self.lock.release()
- def run(self):
- for worker in self.workers:
- worker.start()
- for worker in self.workers:
- worker.join()
- return self.pwrd.value.strip()
- def main():
- wordlist = "/usr/share/wordlists/rockyou.txt"
- wordlist = [o.strip() for o in open(wordlist).readlines()]
- while len(wordlist) % 8:
- wordlist.append("")
- for n in xrange(0, len(wordlist), 8):
- slice = wordlist[n:n+8]
- procs = []
- print "%02i/%02i" % ((n/8)+1, len(wordlist)/8)
- crack = PyCrack(slice)
- pwrd = crack.run()
- if len(results):
- print "\nPASSWORD: %s\n" % pwrd
- sys.exit()
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement