0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【TryHackMe】Crack The Hash Level 2:Walkthrough

0
Posted at

概要

TryHackMe「Crack The Hash Level 2」のWalkthroughです。

Task2

Q1.What kind of hash it is?

haitiを使用し、ハッシュ値からハッシュタイプを検索します。

$ ./haiti 741ebf5166b9ece4cca88a3868c44871e8370707cf19af3ceaa4a6fba006f224ae03f39153492853
RIPEMD-320 [JtR: dynamic_150]
IPMI 2.0 RAKP HMAC-SHA1 [HC: 7300]
Umbraco HMAC-SHA1 [HC: 24800]
WPA-EAPOL-PBKDF2 [HC: 2500]
WPA-EAPOL-PMK [HC: 2501]

A.RIPEMD-320

Q2.What is Keccak-256 Hashcat code?

Hashcatのハッシュタイプ一覧ページで、Keccak-256に対応するコードを調べます。

image.png

A.17800

Q3.What is Keccak-256 John the Ripper code?

下記ページから、該当のハッシュタイプコードを、検索します。

image.png

A.raw-keccak-256

Task3

Q1.Which option do you need to add to the previous command to search into local archives instead of remote ones?

A.-l

Q2.what is the path where is stored the wordlist?

rockyouワードリストをダウンロードします。

$ sudo python3 wordlistctl.py fetch rockyou -d

ダウンロード後に、ワードリストのパスを調べます。

$ sudo python3 wordlistctl.py search -l rockyou

-==[ wordlistctl by blackarch.org ]==--
    > /usr/share/wordlists/passwords/rockyou.txt (139.92 Mb)

A./usr/share/wordlists/passwords/rockyou.txt

Q3.What is the name of the first wordlist in the usernames category?

usernamesカテゴリのワードリストを検索します。

$ python3 wordlistctl.py list -g usernames       
--==[ wordlistctl by blackarch.org ]==--
                                                                                                                     
[+] available wordlists:

   0 > CommonAdminBase64 (1.05 Kb)
   1 > multiplesources-users-fabian-fingerle (164.59 Kb)
   2 > familynames-usa-top1000 (7.12 Kb)
   3 > femalenames-usa-top1000 (6.94 Kb)

(省略)

A.CommonAdminBase64

Task4

Q1.What was the password?

ワードルールを設定します。

$ cat /usr/share/john/john.conf| grep -3 "List.Rules:THM01"

[List.Rules:THM01]
$[0-9]$[0-9]

ハッシュ値を解析し、パスワードを特定できました。

$ john T4Q1_hash.txt --format=raw-sha1 --wordlist=/usr/share/seclists/Passwords/Common-Credentials/10k-most-common.txt --rules=THM01 
Using default input encoding: UTF-8
Loaded 1 password hash (Raw-SHA1 [SHA1 256/256 AVX2 8x])
No password hashes left to crack (see FAQ)

$ john T4Q1_hash.txt --show                                      
?:moonligh56

1 password hash cracked, 0 left

A.moonligh56

Task5

Q1.Crack the following md5 hash with the wordlist generated in the previous steps.

Mentalistを使用し、生成するワードリストをカスタマイズします。
process->Full Wordlistからワードリストファイルを出力します。

image.png

生成したワードリストでハッシュ値を解析します。

$ john ../Task5Q2_hash.txt --wordlist=dog2.txt --format=Raw-MD5
Using default input encoding: UTF-8
Loaded 1 password hash (Raw-MD5 [MD5 256/256 AVX2 8x3])
Warning: no OpenMP support for this hash type, consider --fork=2
Press 'q' or Ctrl-C to abort, almost any other key for status
mOlo$$u$         (?)     
1g 0:00:00:00 DONE (2025-11-09 04:22) 33.33g/s 8066p/s 8066c/s 8066C/s aDvanced..yOrk$hire
Use the "--show --format=Raw-MD5" options to display all of the cracked passwords reliably
Session completed.

A.mOlo$$u$

Q2.What is the last word of the list?

cewlでWebページから、ワードリストを作成します。

cewl -d 2 -w $(pwd)/example.txt https://example.org

ただ、以前のexample.orgと、2025/11/09現在のexample.orgの内容をが変わるため、ここは他Writeupを参考にします。

以前のexample.org

image.png

2025/11/09現在のexample.org

image.png

A.information

Q3.Crack this md5 hash with combination.txt.

ttpassgenをダウンロードします。

$ python -m pip install ttpassgen

pin.txtabc.txtを生成します。

$ ttpassgen --rule '[?d]{4:4:*}' pin.txt
mode: combination rule mode, global_repeat_mode: ?, part_size: 0 Bytes, dictlist: [], input dict file encoding: None
raw rule string: [?d]{4:4:*}, analyzed rules: ['[?d]{4:4:*}']
estimated display size: 50.0 KB, generate dict...
100%|████████████████████████████████████████████████████████████████████| 10000/10000 [00:00<00:00, 99538.51 word/s]
generate dict complete.
                                                                                                                     
┌──(.venv)─(kali㉿kali)-[~/Crack-The-Hash-Level2]
└─$ ttpassgen --rule '[?l]{1:3:*}' abc.txt
mode: combination rule mode, global_repeat_mode: ?, part_size: 0 Bytes, dictlist: [], input dict file encoding: None
raw rule string: [?l]{1:3:*}, analyzed rules: ['[?l]{1:3:*}']
estimated display size: 74.54 KB, generate dict...
100%|███████████████████████████████████████████████████████████████████| 18278/18278 [00:00<00:00, 156095.49 word/s]
generate dict complete.

pin.txtabc.txtを基に、さらにワードリストcombination.txtを生成します。

┌──(.venv)─(kali㉿kali)-[~/Crack-The-Hash-Level2]
└─$ ttpassgen --dictlist 'pin.txt,abc.txt' --rule '$0[-]{1}$1' combination.txt
mode: combination rule mode, global_repeat_mode: ?, part_size: 0 Bytes, dictlist: ['pin.txt', 'abc.txt'], input dict file encoding: None
raw rule string: $0[-]{1}$1, analyzed rules: ['$0', '[-]{1}', '$1']
estimated display size: 1.64 GB, generate dict...
100%|██████████████████████████████████████████████████████████| 182780000/182780000 [00:42<00:00, 4324277.98 word/s]
generate dict complete.

combination.txtを使用して、ハッシュ値を解析します。

┌──(.venv)─(kali㉿kali)-[~/Crack-The-Hash-Level2]
└─$ john Task5Q3_hash.txt --wordlist=combination.txt --format=Raw-MD5 
Using default input encoding: UTF-8
Loaded 1 password hash (Raw-MD5 [MD5 256/256 AVX2 8x3])
Warning: no OpenMP support for this hash type, consider --fork=2
Press 'q' or Ctrl-C to abort, almost any other key for status
1551-li          (?)     
1g 0:00:00:02 DONE (2025-11-09 07:28) 0.4651g/s 13185Kp/s 13185Kc/s 13185KC/s 1551-g..1551-nz
Use the "--show --format=Raw-MD5" options to display all of the cracked passwords reliably
Session completed.

A.1551-li

Task6

Q1.Advice n°1 b16f211a8ad7f97778e5006c7cecdf31

Webページから平文のヒントを得られます。

ヒント

  • 男性の名前
  • 文字の先頭 or 末尾 or 両方
  • 数字 or 特殊記号

image.png

MentalistBase WordsCommon NamesMenの手順で男性の名前のワードリストを生成します。

image.png

単語ルールを定義します。

$ cat /etc/john/john.conf | grep -2 "List.Rules:T6Q1"

[List.Rules:T6Q1]
cAz"[0-9!@\#\$%^&*()\-=_+`~\[\]{}\\|/:\;'][0-9!@\#\$%^&*()\-=_+`~\[\]{}\\|/:\;'][0-9!@\#\$%^&*()\-=_+`~\[\]{}\\|/:\;'][0-9!@\#\$%^&*()\-=_+`~\[\]{}\\|/:\;'][0-9!@\#\$%^&*()\-=_+`~\[\]{}\\|/:\;']"

生成したワードリストと、設定したルールでハッシュ値を解析します。

$ john Task6Q1_hash.txt --wordlist=wordlists_menname.txt --rules=T6Q1 --format=Raw-MD5
Using default input encoding: UTF-8
Loaded 1 password hash (Raw-MD5 [MD5 256/256 AVX2 8x3])
Warning: no OpenMP support for this hash type, consider --fork=2
Press 'q' or Ctrl-C to abort, almost any other key for status
Zachariah1234*   (?)     
1g 0:00:01:22 DONE (2025-11-09 08:10) 0.01211g/s 21526Kp/s 21526Kc/s 21526KC/s Mauricio1234*..Arthur1234(
Use the "--show --format=Raw-MD5" options to display all of the cracked passwords reliably
Session completed.

A.Zachariah1234*

Q2.Advice n°2 7463fcb720de92803d179e7f83070f97

ヒント

  • 女性の名前

image.png

先ほどと同じルールで、辞書ファイルを女性の名前にします。
MentalistBase WordsCommon NamesWomenの手順で辞書ファイルを生成します。

image.png

生成したワードリストと、先ほどと同じルールでハッシュ値を解析します。

$ john T6Q2_hash.txt --wordlist=women_name.txt --rules=T6Q1 --format=Raw-MD5
Using default input encoding: UTF-8
Loaded 1 password hash (Raw-MD5 [MD5 256/256 AVX2 8x3])
Warning: no OpenMP support for this hash type, consider --fork=2
Press 'q' or Ctrl-C to abort, almost any other key for status
Angelita35!      (?)     
1g 0:00:00:00 DONE (2025-11-09 08:40) 6.666g/s 14400Kp/s 14400Kc/s 14400KC/s Leola35!..Celina35!
Use the "--show --format=Raw-MD5" options to display all of the cracked passwords reliably
Session completed.

A.Angelita35!

Q3.Advice n°3 f4476669333651be5b37ec6d81ef526f

ヒント

  • メキシコの街の名前
  • Leet表記

image.png

単語ルールは、JohnTheRipperにデフォルトで用意されている、l33tを使用します。
辞書ファイルは、seclistsのcities.txtを使用します。

$ john T6Q3_hash.txt --wordlist=/usr/share/seclists/Miscellaneous/Security-Question-Answers/cities.txt --rules=l33t --format=Raw-MD5       
Using default input encoding: UTF-8
Loaded 1 password hash (Raw-MD5 [MD5 256/256 AVX2 8x3])
Warning: no OpenMP support for this hash type, consider --fork=2
Press 'q' or Ctrl-C to abort, almost any other key for status
Tl@xc@l@ncing0   (?)     
1g 0:00:00:00 DONE (2025-11-09 08:51) 2.439g/s 3068Kp/s 3068Kc/s 3068KC/s Kr@sn0h0rivk@..Fr@ncisc0 M0r@t0
Use the "--show --format=Raw-MD5" options to display all of the cracked passwords reliably
Session completed.

A.Tl@xc@l@ncing0

Q4.Advice n°4 a3a321e1c246c773177363200a6c0466a5030afc

ヒント

  • SHA1のハッシュ値
  • ユーザ名
  • 任意の文字を大文字か小文字に変換

image.png

ユーザ名はDavid Giettapanだと分かっているので、いくつかの系式で辞書ファイルを用意します。

$ cat david_name.txt                                 
david
guettapan
davidguettapan

デフォルトルールのNTを使用し、ハッシュ値を解析します。

$ john T6Q4_hash.txt --wordlist=david_name.txt --format=Raw-SHA1 --rules=NT
Using default input encoding: UTF-8
Loaded 1 password hash (Raw-SHA1 [SHA1 256/256 AVX2 8x])
Warning: no OpenMP support for this hash type, consider --fork=2
Press 'q' or Ctrl-C to abort, almost any other key for status
DavIDgUEtTApAn   (?)     
1g 0:00:00:00 DONE (2025-11-09 09:00) 25.00g/s 178200p/s 178200c/s 178200C/s DavIDgUEttapAn..DavIDgUEtTAPAn
Use the "--show --format=Raw-SHA1" options to display all of the cracked passwords reliably
Session completed.

A.DavIDgUEtTApAn

Q5.Advice n°5 d5e085772469d544a447bc8250890949

ヒント

  • Adeleの曲の歌詞
  • 文字列を逆順

image.png

2025/11/09現在、サイトのHTML構造が変わり、lyricpassでは求められている辞書ファイルを作成できませんでした。

今回の問題に対応できるよう、new_lyricpassを新たに作成しました。

プログラムを実行し、辞書ファイルを作成します。

$ python new_lyricpass.py -a "Adele"
[+] Looking up artist Adele
[+] Found 383 songs for artist ID 2300
[+] Scraping lyrics from 383 songs...

(中略)

[+] Found lyrics for 337 songs
[+] Wrote raw lyrics to raw-lyrics-2025-11-10-08.23.39.txt
[+] Wrote 3915 passphrases to wordlist-2025-11-10-08.23.39.txt
[+] Done!

単語を逆順にするルールを作成します。

$ cat /etc/john/john.conf | grep -2 "List.Rules:T6Q5"

[List.Rules:T6Q5]
r

生成した辞書ファイルと、定義したルールでハッシュ値を解析します。

$ john T6Q5_hash.txt --wordlist=raw-lyrics-2025-11-10-08.23.39.txt --format=Raw-MD5 --rules=T6Q5 
Using default input encoding: UTF-8
Loaded 1 password hash (Raw-MD5 [MD5 256/256 AVX2 8x3])
Warning: no OpenMP support for this hash type, consider --fork=2
Press 'q' or Ctrl-C to abort, almost any other key for status
uoy ot miws ot em rof peed oot ro ediw oot si revir oN (?)     
1g 0:00:00:00 DONE (2025-11-10 08:39) 50.00g/s 556800p/s 556800c/s 556800C/s peed uoy stuc niap eht nehw tuB..)em tem dah reven uoy hsiw annog er'uoY(
Use the "--show --format=Raw-MD5" options to display all of the cracked passwords reliably
Session completed.

A.uoy ot miws ot em rof peed oot ro ediw oot si revir oN

Q6.Advice n°6 377081d69d23759c5946a95d1b757adc

ヒント

  • シント・マールテンの電話番号

image.png

辞書ファイルの生成には、pnwgenを使用します。

シント・マールテンの国番号は、+1721なので、prefix.txtにそれを追記します。

$ cat prefix.txt 
#put your prefixes here
+1721

pnwgenを実行し、辞書ファイルを作成します。

┌──(kali㉿kali)-[~/Crack-The-Hash-Level2/pnwgen]
└─$ python pnwgen.py                   
INFO:--------------------------------
Phone number Wordlist Generator v.0.5

Choose the number of digits in generated raw output:
(min 4, max 10, 7 (by default) - press ENTER)

>>> 
INFO: Generating worlist file...
INFO: 7 digits raw output chosen

INFO: Finished!!!

生成した辞書ファイルでハッシュ値を解析します。

$ john T6Q6_hash.txt --wordlist=./wordlist.txt --format=Raw-MD5                                 
Using default input encoding: UTF-8
Loaded 1 password hash (Raw-MD5 [MD5 256/256 AVX2 8x3])
Warning: no OpenMP support for this hash type, consider --fork=2
Press 'q' or Ctrl-C to abort, almost any other key for status
+17215440375     (?)     
1g 0:00:00:00 DONE (2025-11-10 09:07) 6.250g/s 34003Kp/s 34003Kc/s 34003KC/s +17215440128..+17215440511
Use the "--show --format=Raw-MD5" options to display all of the cracked passwords reliably
Session completed.

A.+17215440375

Q7.Advice n°7 ba6e8f9cd4140ac8b8d2bf96c9acd2fb58c0827d556b78e331d1113fcbfe425ca9299fe917f6015978f7e1644382d1ea45fd581aed6298acde2fa01e7d83cdbd

ヒント

  • Rockyou
  • SHA3-512
  • No mutation

image.png

rockyou.txtを使用し、ハッシュ値を解析します。

$ john T6Q7_hash.txt --wordlist=/usr/share/wordlists/rockyou.txt --format=Raw-SHA3 
Using default input encoding: UTF-8
Loaded 1 password hash (Raw-SHA3 [SHA3 512 32/64])
Warning: poor OpenMP scalability for this hash type, consider --fork=2
Will run 2 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
!@#redrose!@#    (?)     
1g 0:00:00:04 DONE (2025-11-10 09:11) 0.2392g/s 3431Kp/s 3431Kc/s 3431KC/s (Cahir!!!)..*7¡Vamos!
Use the "--show" option to display all of the cracked passwords reliably
Session completed.

A.!@#redrose!@#

Q8.Advice n°8 9f7376709d3fe09b389a27876834a13c6f275ed9a806d4c8df78f0ce1aad8fb343316133e810096e0999eaf1d2bca37c336e1b7726b213e001333d636e896617

ヒント

  • 2, 3, 4, 5回ランダムな単語を繰り返す

image.png

コメントのリンクから、ワードリストを生成するページに遷移できました。

image.png

cewlでターゲットのWebページを基に辞書ファイルを生成します。

$ cewl http://10.201.95.93/rtfm.re/en/sponsors/index.html -w Q8Wordlist.txt
CeWL 6.2.1 (More Fixes) Robin Wood (robin@digi.ninja) (https://digi.ninja/)

単語を繰り返すルールを設定します。

$ cat /etc/john/john.conf | grep -6 "List.Rules:T6Q8"

[List.Rules:T6Q8]
d
dd
ddd
dddd
ddddd

生成した辞書ファイルと、定義したルールでハッシュ値を解析します。

$ john --format=Raw-Blake2 T6Q8_hash.txt --wordlist=Q8Wordlist.txt --rules=T6Q8 
Using default input encoding: UTF-8
Loaded 1 password hash (Raw-Blake2 [BLAKE2b 512 128/128 AVX])
Will run 2 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
hackinghackinghackinghacking (?)     
1g 0:00:00:00 DONE (2025-11-10 09:28) 50.00g/s 108200p/s 108200c/s 108200C/s andand..estestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestest
Use the "--show" option to display all of the cracked passwords reliably
Session completed. 

A.hackinghackinghackinghacking

Q9.Advice n°9 $6$kI6VJ0a31.SNRsLR$Wk30X8w8iEC2FpasTo0Z5U7wke0TpfbDtSwayrNebqKjYWC4gjKoNEJxO/DkP.YFTLVFirQ5PEh4glQIHuKfA/

ヒント

  • Rockyou
  • SHA512-crypt
  • No mutation

image.png

rockyou.txtを使用し、ハッシュ値を解析します。

$ john --format=sha512crypt T6Q9_hash.txt --wordlist=/usr/share/wordlists/rockyou.txt 
Using default input encoding: UTF-8
Loaded 1 password hash (sha512crypt, crypt(3) $6$ [SHA512 256/256 AVX2 4x])
Cost 1 (iteration count) is 5000 for all loaded hashes
Will run 2 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
kakashi1         (?)     
1g 0:00:00:06 DONE (2025-11-10 09:31) 0.1461g/s 4079p/s 4079c/s 4079C/s 010292..citlali
Use the "--show" option to display all of the cracked passwords reliably
Session completed.

A.kakashi1

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?