Slapdash Safeguards

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

Blue Team Labs Online - Carulean Writeup

🔗 https://blueteamlabs.online/home/investigation/lintro-17165b66f0

シナリオ

Google Chromeを装ったトロイの木馬の .deb パッケージを解析し、マルウェアの詳細・攻撃者の情報・永続化手法を明らかにする。

Q1) What is the Filesize of the trojan deb file in bytes? [Use Commandline] (5 points)

コマンドラインでファイルサイズを確認する。

ls -l google-chrome-stable.deb

Answer: 86207032


Q2) Submit the Magic Number of the Malicious executable (include any 0's) (5 points)

まず .deb ファイルを展開し、中身の実行ファイルを探す。ついでに正規の .deb パッケージも展開して差分を確認する。

dpkg-deb -x google-chrome-stable.deb extracted/

/usr/bin を確認すると、正規パッケージには存在しない Google-Chrome という実行ファイルを発見した。xxd でマジックナンバーを取得する。

スクリーンショット 2026-03-29 145454

xxd extracted/usr/bin/Google-Chrome | head -1

スクリーンショット 2026-03-29 144458

ELFバイナリのマジックナンバーを確認できた。

Answer: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00


Q3) What is the modified version number of the Google Chrome debian package creator? (5 points)

dpkg-deb でパッケージのメタ情報を確認する。

dpkg-deb --info google-chrome-stable.deb

出力内のバージョン番号フィールドを確認した。

スクリーンショット 2026-03-29 144804

Answer: 100.1


Q4) Submit MD5 hash of the malicious executable embedded in to the Google Chrome debian package? (5 points)

展開済みの不審な実行ファイルのMD5ハッシュを取得する。

md5sum extracted/usr/bin/Google-Chrome

Answer: 87b04290ad2470dd60a06f085d433c46


Q5) Submit Attacker's IP address and port (10 points)

まず正規 .deb との差分を確認したが、目ぼしい情報は得られなかった。

ここで、不審な .deb ファイルには追加の圧縮フォルダが含まれていることに気づき展開してみると、control ファイルの中に攻撃者のメールアドレスが記載されていた(→ Q6参照)。

ラボのタグにstrace コマンドがあったので、IPアドレスの特定には、strace コマンドを使用した。実際に不審な実行ファイルを動かしてシステムコールを追跡することで、接続先を確認する。

スクリーンショット 2026-03-29 152332

chmod 777 extracted/usr/bin/Google-Chrome
strace extracted/usr/bin/Google-Chrome

出力の中から connect システムコールを確認し、接続先IPとポートを取得できた。

Answer: 172.16.0.5:443


Q6) What is the email id of the maintainer of the trojan? (5 points)

Q3の調査で取得したパッケージのメタ情報を参照。

スクリーンショット 2026-03-29 144804

maintainerという項目に avengersofmoon[at]xyzboss[dot]com と記載があり、これがmaintainerのemail id だと推測。

Answer: avengersofmoon@xyzboss.com


Q7) A new file was added to the disk to achieve persistence. What is the name of the file with extension including the path? (10 points)

.deb パッケージのインストールスクリプトである postinst ファイルの中身を確認する。

スクリーンショット 2026-03-29 152830

内容を読むと、systemdのサービスファイルを /etc/systemd/system/ に追加し、systemctl で有効化している痕跡が確認できた。これが永続化の手法と推測。

Answer: /etc/systemd/system/Google-Chrome-Stable.service


Q8) What is the amount of time(seconds) specified by the author to wait before attempting to restart the startup service? (5 points)

Q5・Q6の調査で展開した圧縮 .deb 内の control ファイルを確認すると、RestartSec=10 の記述が含まれていた。

スクリーンショット 2026-03-29 145714

Answer: 10


まとめ

今回は悪意ある .deb パッケージの解析を通じて、マルウェアがどのようにして正規ソフトウェアに偽装し、systemdサービスを使って永続化を行うかを学ぶことができた。straceコマンドは使用したことがなかったので新たな知見を得られた。