Author

Topic: Cracking 7zip file you have the pass to.. Almost.? (Read 1693 times)

newbie
Activity: 57
Merit: 0
Nice!  Smiley
hero member
Activity: 518
Merit: 500
Manateeeeeeees
Fixed it:

Code:
#!/usr/bin/env python
import string
mystr="peter piper picked a peck of pickled peppers"

def gen_inner(s, words):
  if(len(words) > 1):
    gen_inner(s, words[1:])
  else:
    print s

  repl = string.capitalize(words[0])
  s = string.replace(s, words[0], repl)
  if(len(words) > 1):
    gen_inner(s, words[1:])
  else:
    print s

words = mystr.split()
gen_inner(mystr, words)

This generates ALL capitalization permutations of the given string.  Then you feed them in the same way as I showed in my previous post.
hero member
Activity: 518
Merit: 500
Manateeeeeeees
Code:
#!/usr/bin/env python
import string
mystr="peter piper picked a peck of pickled peppers"

def gen(s):
  words = s.split()
  for word in words:
    yield s
    repl = string.capitalize(word)
    s = string.replace(s, word, repl)
    yield s

combinations = gen(mystr)
for i in combinations:
  print i

Output:

Code:
peter piper picked a peck of pickled peppers
Peter piper picked a peck of pickled peppers
Peter piper picked a peck of pickled peppers
Peter Piper picked a peck of pickled peppers
Peter Piper picked a peck of pickled peppers
Peter Piper Picked a peck of pickled peppers
Peter Piper Picked a peck of pickled peppers
Peter Piper Picked A peck of pickled peppers
Peter Piper Picked A peck of pickled peppers
Peter Piper Picked A Peck of pickled peppers
Peter Piper Picked A Peck of pickled peppers
Peter Piper Picked A Peck Of pickled peppers
Peter Piper Picked A Peck Of pickled peppers
Peter Piper Picked A Peck Of Pickled peppers
Peter Piper Picked A Peck Of Pickled peppers
Peter Piper Picked A Peck Of Pickled Peppers

Then it's just something like:

Code:
hank@shelob ~/tmp $ python foo.py | while read line; do echo 7z e somefile.7z -p\"$line\"; done
7z e somefile.7z -p"peter piper picked a peck of pickled peppers"
7z e somefile.7z -p"Peter piper picked a peck of pickled peppers"
7z e somefile.7z -p"Peter piper picked a peck of pickled peppers"
7z e somefile.7z -p"Peter Piper picked a peck of pickled peppers"
7z e somefile.7z -p"Peter Piper picked a peck of pickled peppers"
7z e somefile.7z -p"Peter Piper Picked a peck of pickled peppers"
7z e somefile.7z -p"Peter Piper Picked a peck of pickled peppers"
7z e somefile.7z -p"Peter Piper Picked A peck of pickled peppers"
7z e somefile.7z -p"Peter Piper Picked A peck of pickled peppers"
7z e somefile.7z -p"Peter Piper Picked A Peck of pickled peppers"
7z e somefile.7z -p"Peter Piper Picked A Peck of pickled peppers"
7z e somefile.7z -p"Peter Piper Picked A Peck Of pickled peppers"
7z e somefile.7z -p"Peter Piper Picked A Peck Of pickled peppers"
7z e somefile.7z -p"Peter Piper Picked A Peck Of Pickled peppers"
7z e somefile.7z -p"Peter Piper Picked A Peck Of Pickled peppers"
7z e somefile.7z -p"Peter Piper Picked A Peck Of Pickled Peppers"

This doesn't use recursion, so it won't generate the power set of all capitalization combinations, but it should get you started..
I'm going to continue messing around with it to try and get all capitalization combinations - it's a fun problem!
newbie
Activity: 57
Merit: 0
I am not sure if I understand what your passphrase looks like, could you give an example?

Does it look like this:

"1234(P/p)eter 1234(P/p)aul 1234(M/m)arry 1234(M/m)olly 1234(B/b)aby"

?


Edit:
If it looks like this and you are sure that you know the first, second and last word (except the capitalization) then there are only 64 possible combinations;

             2           *          2       *    (     4          *         2   )       *         2                =      64

In  this case I would suggest that you make a list of all combinations and try them manually. (I hope my math was correct here)
hero member
Activity: 696
Merit: 500
Its a 7zip exe archive on windows. If I could feed it a library and let it fiill in the holes that would be awesome I have 3.5gh to put towards it.
legendary
Activity: 1400
Merit: 1005
Well, if capitalization is completely unknown and potentially truly random, that's 2^40 of entropy right there.  Even if you're doing 1 billion attempts a second (no idea if that's possible), you'd still have 2^31 seconds to complete it, or about 68 years.

Heh?

2^40 / 1000000000 = 1100s.

MATHS FAIL.

Will update my post.
legendary
Activity: 1072
Merit: 1174
Well, if capitalization is completely unknown and potentially truly random, that's 2^40 of entropy right there.  Even if you're doing 1 billion attempts a second (no idea if that's possible), you'd still have 2^31 seconds to complete it, or about 68 years.

Heh?

2^40 / 1000000000 = 1100s.
newbie
Activity: 57
Merit: 0
windows or linux?
hero member
Activity: 696
Merit: 500
Oder of the words is semi know, the first two are known adnt the last word is known how it all fits together is not. nothing is actually missing, just the possible combinations.

5 phrases. they are numbers followed by a word.
legendary
Activity: 1400
Merit: 1005
Well, if capitalization is completely unknown and potentially truly random, that's 2^40 of entropy right there.  Even if you're doing 1 billion attempts a second (no idea if that's possible), you'd still have 2^31 seconds to complete it, or about 68 years.

Actually the capitalization is somewhat known. there are several words in the passphrase. The first letter in each word is either capitalized or not.
And the order of the words is unknown?  Any other unknowns?  How many words?
hero member
Activity: 696
Merit: 500
Well, if capitalization is completely unknown and potentially truly random, that's 2^40 of entropy right there.  Even if you're doing 1 billion attempts a second (no idea if that's possible), you'd still have 2^31 seconds to complete it, or about 68 years.

Actually the capitalization is somewhat known. there are several words in the passphrase. The first letter in each word is either capitalized or not.
legendary
Activity: 1400
Merit: 1005
EDIT:  My maths skills fail at life today.  Will be back tomorrow.
hero member
Activity: 696
Merit: 500
Hey guys Im trying to unzip a file with a 40char password. I have the password but the capitalization and possily order of the phrasing is unknown all manual entry tries have failed. Would it even be possible to crack this file under 256it encryption? Even with 99.9% of the passphrase is known?
Jump to: