「John the Ripper」の版間の差分

提供: セキュリティ
移動: 案内検索
行98: 行98:
 
下記のハッシュを含んだファイル hash.txt を用意します。
 
下記のハッシュを含んだファイル hash.txt を用意します。
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Administrator:500:5FE055EE93CA7DB048D7645CD4E30C86:4FEBC2EC1E27A3168F24289B5850F48D:::
+
Administrator:500:01fc5a6be7bc6929aad3b435b51404ee:0cb6948805f797bf2a82807973b89537:::
 
</syntaxhighlight>
 
</syntaxhighlight>
  
行111: 行111:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 +
[[LMハッシュ]]と[[NTLMハッシュ]]のどちらのモードで動かすか、指定しないと警告が出て、自動的に選択されます。
 +
 +
[[NTLMハッシュ]]を指定する場合。
 +
<syntaxhighlight lang="bash">
 +
$ john --format=nt hash.txt
 +
Loaded 6 password hashes with no different salts (NT MD4 [128/128 X2 SSE2-16])
 +
XXXX            (Administrator)
 +
</syntaxhighlight>
 +
 +
[[LMハッシュ]]を指定する場合。
 +
<syntaxhighlight lang="bash">
 +
$ john --format=nt2 hash.txt
 +
Loaded 6 password hashes with no different salts (NT v2 [SSE2i 12x])
 +
Remaining 2 password hashes with no different salts
 +
</syntaxhighlight>
  
 
== 関連項目 ==
 
== 関連項目 ==

2013年4月14日 (日) 12:13時点における版

読み方

John the Ripper
じょん ざ りっぱー

概要

インストール

FreeBSDにインストールする場合

ports コレクションからインストールする場合

cd /usr/ports/security/john
sudo make install clean

pkgコマンドでインストールする場合

sudo pkg install john

portmasterコマンドでインストールする場合

sudo portmaster -y -d /usr/ports/security/john

portinstallコマンドでインストールする場合

sudo portinstall /usr/ports/security/john

CentOSにインストールする場合

CentOSyum コマンドでインストールする場合。

sudo yum -y --enablerepo=rpmforge install john


$JOHN/dynamic.conf: No such file or directory

Linux で上記のエラーメッセージがでる場合は、下記の対応をします。 /etc/john.conf のファイルの下記の部分をコメントアウトすることで、メッセージがでなくなります

.include <dynamic.conf>

コマンドラインオプション

% john
John the Ripper password cracker, ver: 1.7.9-jumbo-5_omp [freebsd-x86-any]
Copyright (c) 1996-2011 by Solar Designer and others
Homepage: http://www.openwall.com/john/
 
Usage: john [OPTIONS] [PASSWORD-FILES]
--config=FILE             use FILE instead of john.conf or john.ini
--single[=SECTION]        "single crack" mode
--wordlist=FILE --stdin   wordlist mode, read words from FILE or stdin
                --pipe    like --stdin, but bulk reads, and allows rules
--encoding=NAME           the input data is in a 'non-standard' character.
                          encoding. NAME = utf-8, koi8-r, and others. For a
                          full list, use --encoding=LIST
--rules[=SECTION]         enable word mangling rules for wordlist mode
--incremental[=MODE]      "incremental" mode [using section MODE]
--markov[=LEVEL[:opts]]   "Markov" mode (see documentation)
--external=MODE           external mode or word filter
--stdout[=LENGTH]         just output candidate passwords [cut at LENGTH]
--restore[=NAME]          restore an interrupted session [called NAME]
--session=NAME            give a new session the NAME
--status[=NAME]           print status of a session [called NAME]
--make-charset=FILE       make a charset file. It will be overwritten
--show[=LEFT]             show cracked passwords [if =LEFT, then uncracked]
--test[=TIME]             run tests and benchmarks for TIME seconds each
--users=[-]LOGIN|UID[,..] [do not] load this (these) user(s) only
--groups=[-]GID[,..]      load users [not] of this (these) group(s) only
--shells=[-]SHELL[,..]    load users with[out] this (these) shell(s) only
--salts=[-]COUNT[:MAX]    load salts with[out] COUNT [to MAX] hashes
--pot=NAME                pot file to use
--format=NAME             force hash type NAME: des/bsdi/md5/bf/afs/lm/
                          dynamic_n/bfegg/dmd5/dominosec/epi/hdaa/ipb2/krb4/
                          krb5/mschapv2/mysql-fast/mysql/netlm/netlmv2/netntlm/
                          netntlmv2/nethalflm/md5ns/nt/phps/po/xsha/crc32/
                          hmac-md5/lotus5/md4-gen/mediawiki/mscash/mscash2/
                          mskrb5/mssql/mssql05/mysql-sha1/nsldap/nt2/oracle11/
                          oracle/phpass-md5/pix-md5/pkzip/raw-md4/raw-md5thick/
                          raw-md5/raw-sha1/raw-sha/raw-md5u/salted-sha1/sapb/
                          sapg/sha1-gen/raw-sha224/raw-sha256/raw-sha384/
                          raw-sha512/xsha512/hmailserver/sybasease/trip/ssh/pdf/
                          rar/zip/dummy
--subformat=LIST          get a listing of all 'dynamic_n' formats
--save-memory=LEVEL       enable memory saving, at LEVEL 1..3
--mem-file-size=SIZE      size threshold for wordlist preload (default 5 MB)
--field-separator-char=C  use 'C' instead of the ':' in input and pot files
--fix-state-delay=N       performance tweak, see documentation
--nolog                   disables creation and writing to john.log file
--crack-status            emit a status line whenever a password is cracked

使い方

FreeBSD

sudo john /etc/master.passwd

Linux

sudo sh -c 'unshadow /etc/passwd /etc/shadow > /root/passwdfile'
sudo john /root/passwdfile

Windowsパスワードのクラック

Windowsのパスワードハッシュパスワードクラックの例です。

ハッシュは、PwDump などを利用して用意します。 詳しくは、 Windowsアカウントのパスワードをクラッキングする方法 を参考にしてください。 下記のハッシュを含んだファイル hash.txt を用意します。

Administrator:500:01fc5a6be7bc6929aad3b435b51404ee:0cb6948805f797bf2a82807973b89537:::

パスワードクラックします。

john hash.txt

パスワードを表示します。

john --show hash.txt

LMハッシュNTLMハッシュのどちらのモードで動かすか、指定しないと警告が出て、自動的に選択されます。

NTLMハッシュを指定する場合。

$ john --format=nt hash.txt
Loaded 6 password hashes with no different salts (NT MD4 [128/128 X2 SSE2-16])
XXXX             (Administrator)

LMハッシュを指定する場合。

$ john --format=nt2 hash.txt
Loaded 6 password hashes with no different salts (NT v2 [SSE2i 12x])
Remaining 2 password hashes with no different salts

関連項目