-
Notifications
You must be signed in to change notification settings - Fork 0
/
crack-stego.py
executable file
·51 lines (41 loc) · 1.27 KB
/
crack-stego.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env python2
import subprocess
import sys
import itertools
import string
def cat_file(s):
print "Message: " + open(s).read()
def run_openstego(word):
cmd = ["openstego", "extract", "-sf", "hide.png", "-p", word]
outp = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
if "Extracted" in outp:
print "[+] found bro!"
print outp
cat_file("message.txt")
return True
return False
def main():
movies = open('movies.txt','r').read()
lines = []
words = []
lines = movies.split("\n")
words = movies.split()
# brute each word
print "[i] bruting all words in movies.txt"
for word in words:
if run_openstego(word):
print "Password: %s" % word
sys.exit(0)
# brute each movie verbatim
print "[i] bruting all lines in the movies.txt"
for line in lines:
if run_openstego(line):
print "Password: %s" % line
sys.exit(0)
# brute a four letter word
print "[i] about to brute all four letter comboz..."
for b in itertools.product(string.ascii_lowercase + string.ascii_uppercase + string.digits, repeat=4):
if run_openstego(''.join(b)):
print "Password: %s" % ''.join(b)
sys.exit(0)
main()