Then:fcrackzip -v -u -D -p ~/wordlist.txt [insert your path to targetzip here]
your issue seems to be that you aren't clarifying in the command where the files are located. I did half the work by helping you put the words list in your user home directory, and then calling it in the second command. Now you just need to get the path to the zipfile and it *should* do its thing.
Things to note, the '~' symbol is short for /home/{your username} and the '>' symbol redirects the terminal output of a command and sends it to a file in this case.
that worked pretty well! But the output words are listed directly in the terminal, how can I let all that output into a .txt-file, or whatever is needed to feed fcrackzip with?
Python script that extracts all unique character combinations (excluding spaces) from the pdf and then tries them out, printing the result if successful. Depending on the length of the book that'll take a while
Only as a side note and since we are dealing with academia.
A quite similar approach using pdfgrep in a bunch of articles searching for a DOI (digital object identifier), building a list of words / DOI can be used to feed into a scihub terminal application.
I see the post is deleted now, does that mean you found a solution, /u/rado_sphere? If not, I hope this Python script will help:
#!/usr/bin/env python
import sys
from zipfile import ZipFile
if len(sys.argv) != 3:
print(f'Usage: {sys.argv[0]} zip-file wordlist-file')
sys.exit()
f_zip = sys.argv[1]
f_words = sys.argv[2]
candidates = []
with open(f_words, 'r') as f:
for l in f.readlines():
candidates.append(l.strip())
with ZipFile(f_zip, 'r') as zf:
print(f'Trying {len(candidates)} candidates...')
first_file = zf.namelist()[0]
for c in candidates:
try:
zf.read(first_file, pwd=c.encode())
print(f'Found potential password: {c}')
resp = input('Keep searching? [Y/n]: ')
if resp.lower() in ['n', 'no']:
break
except:
continue
print('Exiting')
In case you haven't used Python scripts much before, you need to save it to a file (let's call it script.py) and then do chmod +x script.py to make it executable. Then you can run it with:
./script.py zipFile.zip possiblePasswords.txt
I haven't tested the script extensively, but it did work with the sample .zip file provided by that fcrackzip repo.
Thanks so much for the answer, I deleted the post because it wasnt at all the problem that I thought… It wasnt a password problem, i was just using the wrong extractor because the zip file was packed with winzip, which xarchiver was unable to handle. So to avoid confusion I deleted the post ❤️
28 comments
You can get all words with a simple shell script using poppler and grep.
Then use it as a dictionary for fcrackzip
do u know if that syntax is correct?
first:
pdftotext ~/sample.pdf - | grep -P -o "(\p{L}|\w|\d)+" | sort -u > ~/wordlist.txtThen:
fcrackzip -v -u -D -p ~/wordlist.txt [insert your path to targetzip here]your issue seems to be that you aren't clarifying in the command where the files are located. I did half the work by helping you put the words list in your user home directory, and then calling it in the second command. Now you just need to get the path to the zipfile and it *should* do its thing.
Things to note, the '~' symbol is short for
/home/{your username}and the '>' symbol redirects the terminal output of a command and sends it to a file in this case.EDIT: didnt see your update comment.
when I use it as described I always get:
any idea whats wrong with the .txt file/path? I just dont get it...
Probably. https://manpages.ubuntu.com/manpages/trusty/man1/fcrackzip.1.html
thank u for ur answer!
Is it possible to just install that .deb-package manually? https://debian.pkgs.org/10/debian-main-amd64/fcrackzip_1.0-9_amd64.deb.html
Im using debian bullseye and it seems like a debian package is only available for sid in the debian repos..
Have you checked backports?
that worked pretty well! But the output words are listed directly in the terminal, how can I let all that output into a .txt-file, or whatever is needed to feed fcrackzip with?
Just put "> filename.txt" at the end of the command
Python script that extracts all unique character combinations (excluding spaces) from the pdf and then tries them out, printing the result if successful. Depending on the length of the book that'll take a while
Okay, the book is about 180 pages.. so there is no such tool on github or so, that lets me do this? I have no scripting creation experience..
Daft question, but you are looking at page 111 of the book and not page 111 of the PDF?
Yes, to make sure I checked the page of the book (111 printed in right bottom corner) as well as the page 111 of the pdf… 😞
I'd be tempted to see if you can find an earlier revision of that book, and see if it differs.
Only as a side note and since we are dealing with academia. A quite similar approach using pdfgrep in a bunch of articles searching for a DOI (digital object identifier), building a list of words / DOI can be used to feed into a scihub terminal application.
I see the post is deleted now, does that mean you found a solution, /u/rado_sphere? If not, I hope this Python script will help:
In case you haven't used Python scripts much before, you need to save it to a file (let's call it script.py) and then do
chmod +x script.pyto make it executable. Then you can run it with:I haven't tested the script extensively, but it did work with the sample .zip file provided by that fcrackzip repo.
Thanks so much for the answer, I deleted the post because it wasnt at all the problem that I thought… It wasnt a password problem, i was just using the wrong extractor because the zip file was packed with winzip, which xarchiver was unable to handle. So to avoid confusion I deleted the post ❤️
Ah, I see. It can definitely be a bother to deal with all the different archive formats :)
What book?