Slapdash Safeguards

にわか仕込みのセキュリティ

Blue Team Labs Online - Krampus Writeup

シナリオ

The North Pole is under attack. Santa's network has been breached, and a rogue daemon named Krampus is suspected. Krampus has been recruiting disgruntled elves on a forum, sharing a malicious tool designed to control Santa's systems.

Using a RAM dump from one of Santa's helpers turned insider, recover their forum password, access the hidden site, and download the tool used in the attack. Analyze it to uncover the IP address of Krampus's Command-and-Control (C2) server and stop the sabotage.


Q1) What is the URL of the forum used by the insider? (Format: URL)(6 points)

ラボで与えられている解析対象はmemdump.memというメモリダンプファイルのみ。

まずOSプロファイル情報を取得しようとしたが、Volatilityが使えない環境だった。

そこで memdump.memstrings コマンドで文字列として吐き出し、http:// でgrepしてURLを探してみた。 これはBTLOを進めていく上で得た愚直な力技である。

strings memdump.mem | grep "http://"

結果に undergroundforum.io というフォーラムらしきURLが含まれていたので回答。

スクリーンショット 2026-03-05 214526

Answer: http://undergroundforum.io


Q2) What is the username and password used to access the forum? (Format: Username, Password)(7 points)

スクリーンショット 2026-03-05 214831

フォーラムにアクセスすると認証が必要だとわかった。引き続き strings の結果から認証情報を探した。

username でgrepしたところそれっぽい文字列を発見。%40 はURLエンコードで @ に対応するため、デコードして入力したところログインに成功した。

strings memdump.mem | grep "username"

スクリーンショット 2026-03-05 215402

スクリーンショット 2026-03-05 215526

Answer: SnowHacker, Moon@2024


Q3) After downloading the tool created by Krampus and analyzing the script, what is the value of qQnZFFhoGvbrgs? (Format: Value)(6 points)

フォーラムからツールをダウンロードし、前問のパスワードで解凍すると、中身は .hta ファイルだった。

スクリーンショット 2026-03-05 215838

難読化されたスクリプトが含まれていたが、最初のほうは単に変数を当てはめる単純なものだった。 デコードを進めることで変数 qQnZFFhoGvbrgs の値を取得できた。

Answer: WScript.Shell


Q4) What method and scripting language are being used to run system commands and manipulate objects? (Format: Method, Scripting Language)(6 points)

スクリプトの12行目あたりを読み進めると、run() メソッドと PowerShell の呼び出しが確認できたので回答してみると正解だった。

Answer: Run, PowerShell


Q5) What encoding format is used in the file to obfuscate part of the PowerShell command? (Format: Encoding Format)(6 points)

スクリプト内のPowerShellコマンドの一部が難読化されていた。見た目からもすぐ判断できるが、Base64エンコードが使われていた。

Answer: Base64


Q6) In the encoded script, which function is used to write specific bytes into allocated memory as part of the injection process? (Format: Function Name)(6 points)

スクリーンショット 2026-03-05 221906

Base64部分をすべてデコードし、スクリプト全体を読める形にした。

メモリ操作に関係する関数を探したところ、memset を発見した。memset はメモリ領域を特定の値で埋める関数であり、インジェクション処理の一部として使われていると判断した。

Answer: memset


Q7) What is the MD5 hash of the binary data obtained from the decoded shellcode? (Format: MD5)(6 points)

Hexコード部分をCyberChefでデコードしたうえで、シェルコードをHex変換し、そのバイナリデータのMD5ハッシュを取得した。

スクリーンショット 2026-03-05 222821

Answer: 9bdf69740670b8793c622a9a8fd5e4f1


Q8) What IP address and port does the shellcode attempt to connect to when emulated with Speakeasy? (Format: IP:PORT)(7 points)

Speakeasyが何なのか知らなかったため、フォーラムに戻って情報を確認した。 しかし、何も手がかりはない。そもそもSpeakeasyはツールなのではないかと思い、whichで探すと見つかった。

スクリーンショット 2026-03-05 224337

/usr/bin/speakeasy に存在することがわかった。 Speakeasyは「モデル化されたWindowsランタイム上でバイナリ、ドライバ、シェルコードを実行するWindowsマルウェアエミュレーションフレームワーク」だそう。

スクリーンショット 2026-03-05 224529

シェルコードをSpeakeasyでエミュレートしたところ、接続先のIPアドレスとポートを取得できた。

python3 speakeasy -t shellcode.bin

スクリーンショット 2026-03-05 224750

Answer: 51.79.49.174:443


おまけ

今回解析対象となったhtaファイルをvirustotalで検索した結果

image https://www.virustotal.com/gui/file/516dc31057adc9148619dd4402ab634167f4daa9ab6d633a5a8804a47a4bd218