[THM][Note] Incident handling with Splunk
https://tryhackme.com/room/splunk201
Task4
One suricata alert highlighted the CVE value associated with the attack attempt. What is the CVE value?
考え方)
- Splunkの使い方に慣れる意味でじっくり試しながらやっていくのがいい。
- このタスクでは検索の方法と必要な項目の追加などの操作を覚え、調査範囲を絞り込んでいく。

- フィルターに指定した、「suricata」はIDSのログソース
- src_ipは、webに多数アクセスがあったものを選択してみる


- IDSではシグネチャを観たい。
- 項目に、「signature」を追加

What is the CMS our web server is using?
考え方)
- URLから判断。

What is the web scanner, the attacker used to perform the scanning attempts?
考え方)

- http_user_agentをフィルターに追加して、結果をよく読む。

- 拡張HTTPヘッダーに書かれている。
What is the IP address of the server imreallynotbatman.com?
考え方)
- 左の項目リストより、「dest_ip」で検索

Task5
What was the URI which got multiple brute force attempts?
考え方)
- 「フィルター条件 | 正規表現による抽出 | 帳票カラムの指定」による、「|」(パイプ)を使用したフィルータチェインの流れを理解する。
- 正規表現は他のツールや言語でもよく使用されるので、基本的な構文は理解しておく。
- 答えを導くために使用するフィルター構文は以下。
index=botsv1 sourcetype=stream:http dest_ip="192.168.250.70" http_method=POST form_data=*username*passwd* | rex field=form_data "passwd=(?<a>\w+)" | table _time src_ip uri http_user_agent
- 分解してフィルターの内容を見ていくと、
これがフィルター)
index=botsv1 sourcetype=stream:http dest_ip="192.168.250.70" http_method=POST form_data=*username*passwd*
次の「|」の後が正規表現による抽出)
rex関数を使用して、fieldで抽出の対象となるフィールドを指定して、最後に正規表現で必要な箇所のみ抽出している。
rex field=form_data "passwd=(?<a>\w+)"
最後の「|」の後が帳票カラムの指定)
前のフィルターや正規表現の結果として持っているカラム名から、表示させたいものだけを指定している。
table _time src_ip uri http_user_agent

Against which username was the brute force attempt made?
考え方)
- フィルターを以下のように修正。
- 2箇所修正したが、どこを変えたか考えてみる。
index=botsv1 sourcetype=stream:http dest_ip="192.168.250.70" src_ip="23.22.63.114" http_method=POST form_data=*username*passwd* | rex field=form_data "username=(?<a>\w+)" | table _time src_ip uri http_user_agent a form_data

What was the correct password for admin access to the content management system running imreallynotbatman.com?
考え方)
- 今まで調査で正しいIPとブルートフォースのIPの2つの接続が確認されている。
- 正しいIPの方でフィルターする。
index=botsv1 sourcetype=stream:http dest_ip="192.168.250.70" src_ip="40.80.148.42" http_method=POST form_data=*username*passwd* | rex field=form_data "passwd=(?<a>\w+)"
| table _time src_ip uri a

How many unique passwords were attempted in the brute force attempt?
考え方)
- 今までフィルター結果の画面の、「統計情報」のタブの部分に検索結果件数が出ている。
What IP address is likely attempting a brute force password attack against imreallynotbatman.com?
fter finding the correct password, which IP did the attacker use to log in to the admin panel?
考え方)
- 今まで調査でブルートフォースのsrc_ipが複数と、通常のログインのsrc_ipが1件ということがわかっている。
- 攻撃者はブルートフォースを使用して、1つのパスワードを発見したと想定。
- その後、そのパスワードを使用して機械的なログインではなく、通常のログインをしたと想定。
- ログにより、通常のsrc_ipが怪しいと考えられる。
Task6
Sysmon also collects the Hash value of the processes being created. What is the MD5 HASH of the program 3791.exe?
考え方)
- とてもわかり易くキャプチャ付きで説明をしてくれているので、1つ1つの流れを理解しながら手順通りに進める。
- 3791.exeのMD5のハッシュ値ということで、以下のフィルター式に持っていければOK。
index=botsv1 "3791.exe" sourcetype=xmlwineventlog EventCode=1 CommandLine="3791.exe"

Looking at the logs, which user executed the program 3791.exe on the server?
考え方)
- 同じログから辿れる

Task7
Fortigate Firewall ‘fortigate_utm’ detected SQL attempt from the attacker’s IP 40.80.148.42. What is the name of the rule that was triggered during the SQL Injection attempt?
考え方)
- 与えられたキーワード、「fortigate_utm」、「192.168.250.70」、「SQL Injection」をもとに、以下のフィルターを導き出す。
index=botsv1 imreallynotbatman.com sourcetype=fortigate_utm dest_ip="192.168.250.70" sql

Task9
Based on the data gathered from this attack and common open-source intelligence sources for domain names, what is the email address that is most likely associated with the P01s0n1vy APT group?
考え方)
- 答えがあるのではなく、推測しないといけないので結構難しい。
- 「ヒント」をクリックすると、otx.alienvault.comを使えとある。

- ここからわかったドメインと、名前からメアドを推測。
課題)
- 一般のwhoisでは出てこなかった(匿名希望によるPRIVACY)情報が、なぜotxでは出てきているのか、otxのサービスを理解する必要がありそう。
Task10
What is the HASH of the Malware associated with the APT group?
考え方)
- threadminerのページの情報から探す。

What is the name of the Malware associated with the Poison Ivy Infrastructure?
考え方)
- 上記と同じページの、Fine nameを確認する。