2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

John the Ripper - password crackerが見つからなかったので自分で探してシェルプロファイルに追加した

Last updated at Posted at 2024-05-15

趣旨

Johnが見つからなかったので探してみました。インストールされてないならインストールしてもよかったんですが、インストールはされていたけど、ファイルの置き場がプロファイルに記載されてなくてターミナルから起動できなかったので、解決法を探してみました。

以下のBurp問題と同じ章だったので、この章読み終えるのにめちゃくちゃ時間かかってます。

実行手順

まずは探してみます。

locate john | grep bin

見つからず。

Linux内でのファイル検索を円滑にするために以下のパッケージをインストールします。

sudo apt install mlocate
sudo updatedb

次に以下のコマンドでjohnの場所を調べます。

find / -name john 2>/dev/null

実行結果。

/etc/cron.d/john
/etc/john
/usr/lib/john
/usr/sbin/john # これが該当ファイル。
/usr/share/bash-completion/completions/john
/usr/share/doc/john
/usr/share/john
/usr/share/lintian/overrides/john

リストを見ただけでは断言できないので怪しいものを実際にターミナルで起動してみるのが良いです。
以下のような場所にあるのが怪しいです。

/usr/bin
/usr/local/bin

シェルプロファイルにPATHを追加します。

nano ~/.bashrc

一番下の行に以下の文を追加して閉じます。

export PATH=$PATH:/usr/sbin

シェルコンフィギュレーションをリロードします。

source ~/.bashrc

起動してみます。

john hash.txt --wordlist=/usr/share/wordlists/rockyou.txt

完了!

おまけ

もしrockyou.txtが存在してなければ以下の2つの方法で解決できます。

1つ目。

sudo gzip -d /usr/share/wordlists/rockyou.txt.gz

2つ目:zipファイルがなければインストール。

sudo apt update
sudo apt install wordlists
sudo apt install rockyou

インストールされてるかどうか確認。

ls /usr/share/wordlists | grep rockyou
2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?