Windows のパスワードを解読する方法

LinuxWindowsのdual boot環境で、Linux側からwindows側のパスワードを解読する方法についてメモ

ツールのインストール

作業は全て Linux 側で行います。

windowsのパスワードの解析を行うツールとしては、 ophcrack を用意します。
まず、 http://ophcrack.sourceforge.net/からソースコード ophcrack-3.0.1.tar.bz2 を入手。続けて、作業を簡略化するために、GUI無しで、コンパイルします。インストールはしません

$ cd /tmp
$ tar xvfj ophcrack-3.0.1.tar.bz2
$ cd ophcrack-3.0.1
$ ./configure --disable-gui
$ make

起動方法は ophcrack-3.0.1/src 以下に移動して ./ophcrack を起動

$ cd /tmp/ophcrack-3.0.1/src
$ ./ophcrack

続けて、テーブルファイルをdownloadします。URL は http://ophcrack.sourceforge.net/tables.php
今回は tables_xp_free_small.zip を使いました。

downloadしたら、 /tmp/table などの適当なディレクトリに展開。

$ mkdir /tmp/table
$ cd /tmp/table
$ unzip tables_xp_free_small.zip

windows 領域の マウント

ntfs-3g を使います。 fedora なら以下の手順で、まず必要なパッケージをインストール

$ sudo yum install ntfs-3g

マウント。windows の system32 ディレクトリがあるパーティションをマウントします。

$ sudo mount -o ro /dev/sda1  /mnt

"-o ro" は読み込み専用(read only)でマウントするためのオプションです。これで、操作ミスをしても windows側のファイルは壊れなくなります。

ophcrack の実行

$ cd /tmp/ophcrack-3.0.1/src
$ ./ophcrack -w /mnt/windows/system32/config  -t /tmp/table 

"-w "オプションで windows/system32/config ディレクトリの場所
"-t "オプションで テーブルファイルを展開したディレクト
を指定します。

数秒から、数分でパスワードの解析が終り、コンソールに結果が出力されます。

4 hashes have been found in the encrypted SAM found in /mnt/windows/system32/config

Opened 4 table(s) from /tmp/table.
0h  0m  0s; Found empty password for 2nd LM hash #*
0h  0m  0s; Found empty password for user Guest (NT hash #*)
0h  0m 12s; Found password ****** for 1st LM hash #0in table XP free small #* at column *****.
0h  0m 12s; Found password ****** for user Administrator (NT hash #*)
0h  0m 12s; search (100%); tables: total 4, done 0, using 4; pwd found 2/2.

Results:

username / hash                  LM password    NT password
Administrator                    ******          ******
Guest                            *** empty ***  *** empty ***

私の環境では12秒で、パスワードが解読できてしまいました(汗