LoginSignup
5
5

More than 3 years have passed since last update.

centos7でfcrackzipを使う

Last updated at Posted at 2019-06-19

CentOS7でインストールしてた記事がなかったので

ゴール

  • パスワード付きzipのパスワードを突き止める

準備

frackzipをインストール

マニュアルはここ
https://centos.pkgs.org/7/forensics-x86_64/fcrackzip-1.0-1.el7.x86_64.rpm.html

$ wget https://forensics.cert.org/cert-forensics-tools-release-el7.rpm
$ sudo rpm -Uvh cert-forensics-tools-release*rpm
$ yum --enablerepo=forensics install fcrackzip
$ fcrackzip --version

デモ用パスワード付きzipを作成

  1. 「hello」と書いた himitsu.txt を用意
  2. himitsu.txt を パスワード 12345 として himitsu.zip を作成
$ echo hello > himitsu.txt
$ zip -e --password=12345 himitsu.zip himitsu.txt
$ rm himitsu.txt

デモ

$ fcrackzip -u -c 1 -l 5 himitsu.zip

PASSWORD FOUND!!!!: pw == 12345

説明

今回は以下の条件が分かっていることを前提として、fcrackzipのオプションを設定しました。
1. パスワードが数値だけであること
2. パスワードが5文字であること

-u ... unzipする
-c 1 ... 1は数値を指定。他に、文字列ならa、記号なら!など
-l 5 ... 桁数を5に指定。仮に最小値5、最大値10なら 5-10で指定

詳細のウサゲは以下

$ fcrackzip --help
USAGE: fcrackzip
          [-b|--brute-force]            use brute force algorithm
          [-D|--dictionary]             use a dictionary
          [-B|--benchmark]              execute a small benchmark
          [-c|--charset characterset]   use characters from charset
          [-h|--help]                   show this message
          [--version]                   show the version of this program
          [-V|--validate]               sanity-check the algortihm
          [-v|--verbose]                be more verbose
          [-p|--init-password string]   use string as initial password/file
          [-l|--length min-max]         check password with length min to max
          [-u|--use-unzip]              use unzip to weed out wrong passwords
          [-m|--method num]             use method number "num" (see below)
          [-2|--modulo r/m]             only calculcate 1/m of the password
          file...                    the zipfiles to crack

-c !で記号を指定すると、なぜか以下のようなエラーが標準出力される

sh: -c: line 0: unexpected EOF while looking for matching `"'
sh: -c: line 1: syntax error: unexpected end of file

ダブルクオーテーションが無害化されていない? :thinking:

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5