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?

【CyberDefenders】SpottedInTheWild Lab【Walkthrough】

Last updated at Posted at 2024-10-23

はじめに

本記事は CyberDefenders(以下リンク参考)の「SpottedInTheWild Lab」にチャレンジした際のWalkthroughになります

※本チャレンジについてはRed側のペネトレというよりはBlue側の分析力を問われるものになります。
※今回のチャレンジはディスクフォレンジックメインでしたね。

チャレンジ開始前

問題について

以下の画像の「Download Lab Files」に問題ファイルのリンクがあります。
アーカイブファイルで圧縮されているので仮想環境で解凍してください。
※ホストで解凍しないでください。ディスクイメージの中には本物のマルウェアが入ってたりします。

image.png

環境

この CyberDefenders を解く際には仮想環境でマルウェア解析やメモリフォレンジックを行う環境を用意する必要があります。
今回は以下のような環境を用意しました。

今回はWindows 10の環境を利用しました。
Autopsyを基本的に使ってディスクフォレンジックを進めます。

Q1

In your investigation into the FinTrust Bank breach, you found an application that was the entry point for the attack. Which application was used to download the malicious file?

ディスクイメージをAutopsyに食わせて、とりあえずRecent Documentsを見てみます。
1.png

怪しい某Tのアプリがありますね!

Q2

Finding out when the attack started is critical. What is the UTC timestamp for when the suspicious file was first downloaded?
2024-02-02以降のタイムラインを追います。タイムラインは以下のアイコンから確認できます。
image.png
雑にFile Createのeventを追います。Telegram経由で落としてきている怪しいアーカイブがありますね。
2.png

Q3

Knowing which vulnerability was exploited is key to improving security. What is the CVE identifier of the vulnerability used in this attack?
先ほど見つけたファイルをダウンロードします。
その後、certutil --hashfileでハッシュ値を求めます。
3-1.png
このハッシュ値をVirusTotalで検索します。
3-2.png
このマルウェアが利用しているであろう脆弱性が分かります。

Q4

In examining the downloaded archive, you noticed a file in with an odd extension indicating it might be malicious. What is the name of this file?
上記のファイルをstrings.exeにかけます。
4.png
.cmdのファイルがあるようです。

Q5

Autopsyで.cmdのファイルを検索します。
5-1.png
見えにくいですが、しっかり追っていくとC2のアドレスが見えます。

更なる調査

上記.cmdファイルの中には.ps1.batファイルの記載が見えます。
5-2.png
というわけで、ついでにAutopsyで.bat.ps1ファイルを追っていきます。

まずは.batファイル
5-3.png
.ps1ファイルが見える。タイムラインでこの.ps1を追います。
フィルタをうまく利用します。
5-4.png
Base64とReverseを利用しているのがコードから判断できるので、Cybercefを利用します。
5-5.png
ぱっとコードを読んだ感じ、ラテラルムーブメントの足掛かりのためのホストを列挙しているように見える。
BL4356.txtに保存しているようなので、このファイルを探してみる。
5-6.png
列挙してそうですね。

Q6

To further understand how attackers cover their tracks, identify the script they used to tamper with the event logs. What is the script name?
更なる調査で見えてますね。そのままのファイル名です。

Q7

Knowing when unauthorized actions happened helps in understanding the attack. What is the UTC timestamp for when the script that tampered with event logs was run?
AutopsyのRun ProgramsPOWERSHELL.EXEを動かしているタイムスタンプを投入してもうまくいきませんでした。
そこでEventlogを探ってみます。Eventlogを改ざんするプログラムなのであまりディスクの中のファイルを追いたくなかったのですが、これしかもうなさそうなので。

7-1.png
Windows Powershell.evtxのEventlogファイルが見えます。

これを抽出しHayabusaにかけます。とりあえず全部のルールに引っかけます。

7-2.png

中身を確認するとEventlogを改ざんするps1はでてきてなさそうです。
7-3.png

なら直接見ます。
7-4.png
だいぶ少なかったので最初に直接見れば良かったです。
といっても、実際には大量にログがある場合もあるのでHayabusaを最初に回して絞ってみることをお勧めします。(ログの種類によってはFullのルールで回すよりはCriticalなルールで見るほうがいいです。)

Q8

We need to identify if the attacker maintained access to the machine. What is the command used by the attacker for persistence?
.cmdファイルを確認します。
8-1.png
Tasksという文字が見えますね。Persistenceはタスクスケジューラだと当たりが付くかなと思います。
といってもここら辺のコマンドをAutopsyから拾えなかったので別のアプローチをとります。

.cmdファイルを抽出し、certutil -hashfileからハッシュ値を取ります。
8-2.png
これをVirusTotalに突っ込み、Behaviorを確認します。
8-3.png
schtasks.exeを起動するProcessとかが見当たらなかったのでAnyrunも確認します。
8-4.png
コマンドラインを拾えました!

Q9

To understand the attacker's data exfiltration strategy, we need to locate where they stored their harvested data. What is the full path of the file storing the data collected by one of the attacker's tools in preparation for data exfiltration?
更なる調査で分かってしまった。

最後に

Autopsyを利用しまくるいい問題でした。
Threat Intel観点で無理矢理解いたような形の問題もありましたが、大体先人のつよつよマルウェアアナリストさんがIntelを抽出してくれてたりするので助かってます。

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?