- 不正な振る舞いは、ユーザーが Notepad++ を実行すると同時に、mimeTools.dll がロードされて始まる。
- mimeTools.dll で certificate.pem ファイルを ShellCode で復号化して実行する。
- その後、BingMaps.dll->GetBingMapsFactory() 関数の内部コードを不正な ShellCode で上書きする。
- 上書きされた ShellCode は、再び explorer.exe に Thread Injection を実行する。
- 最終的には、C2 サーバーから追加の ShellCode をダウンロードして実行する。
0. Indirect Syscall
このマルウェアは、実行時点で多数の Indirect Syscall 手法を使用した。これはアンチウイルス製品を回避するための手法であり、過去に ASEC ブログでも紹介したことが[1]ある。
1. ShellCode の復号化&実行
復号化された ShellCode は、最初に実行された Notepad++ プロセスの領域に生成される。この領域には、10分ほどの時間遅延ロジックが存在するが、RCX 値を修正して簡単に回避することができるため、この記事では特に扱わないことにする。
1. Base64 Decoding 2. AES Decrypt (key: wqviIfew62w0zgP97yw9G2nqlHFKkggQ)
2. BingMaps.dll 改ざん
BingMaps.dll の EntryPoint を改ざんし、Export 関数である GetBingMapsFactory() の内部コードを ShellCode で上書きする。
1. NtCreateThreadEx() 2. NtGetContextThread() 3. NtSetContextThread() : Set RIP 4. ResumeThread()
Thread 生成後、NtGetContextThread() を利用してこの Thread のレジスタ値を取得し、RIP レジスタを GetBingMapsFactory(ShellCode で上書きされた領域)でセットする。
3. 改ざんされた GetBingMapsFactory()
BingMaps.dll の GetBingMaps Factory() 関数は、前のプロセスで ShellCode で上書きされた。新しい Thread から始まったこの関数では、VM などの解析環境を認識してプロセスを終了するプロセスが存在し、explorer.exe に Thread を挿入する役割を実行する。
- VGAuthService.exe
- vmtoolsd.exe
- ProcessHacker.exe
- x64dbg.exe
- PE-bear.exe
- CFF Explorer.exe
- Autoruns.exe
- procexp.exe
- procexp64.exe
- Procmon.exe
- Procmon64.exe
- tcpview.exe
- Dbgview.exe
- portmon.exe
1. NtAllocateVirtualMemory() : explorer.exe 内部に領域を割り当てる 2. NtWriteVirtualMemory() : その領域に ShellCode を挿入する 3. NtCreateThreadEx() : 挿入された ShellCode を Thread で実行する
この後からは、explorer.exe のメモリ領域でマルウェアが実行される。
4. Explorer.exe (Injected)
ここからは本格的に不正な振る舞いが始まる。C2 に接続して追加の ShellCode をダウンロードして実行する。
- Computer Name
- User Name
- Whether the current user is a member of the Administrator’s group
- Language
- System Time
ファイル検知 – Trojan/Win.WikiLoader.C5594131 – Trojan/Win.WikiLoader.R642896 – Trojan/Bin.ShellCode IoC [MD5] – c4ac3b4ce7aa4ca1234d2d3787323de2 : package file(npp.8.6.3.portable.x64.zip) – 6136ce65b22f59b9f8e564863820720b : mimeTools.dll – fe4237ab7847f3c235406b9ac90ca845 : certificate.pem – d29f25c4b162f6a19d4c6b96a540648c : package file(npp.8.6.4.portable.x64.zip) – 8b7a358005eff6c44d66e44f5b266d33 : mimeTools.dll – d5ea5ad8678f362bac86875cad47ba21 : certificate.pem [C&C] – hxxps://car***************.com/wp-content/themes/twentytwentytwo/nnzknr.php?id=1 – hxxps://pro**********.net/wp-content/themes/twentytwentythree/hyhnv3.php?id=1 – hxxps://www.era********.eu/wp-content/themes/twentytwentyfour/dqyzqp.php?id=1 – hxxps://www.mar**********.it/wp-content/themes/twentytwentyfour/c2hitq.php?id=1 – hxxps://osa*******.com/wp-content/themes/twentytwentythree/ovqugo.php?id=1 – hxxps://www.ala************.com/wp-content/themes/twentytwentyfour/34uo7s.php?id=1 – hxxps://13*******.org/wp-content/themes/twentytwentythree/t51kkf.php?id=1 – hxxps://alt**************.com/wp-content/themes/twentytwentyfour/c9wfar.php?id=1 – hxxps://www.am*******.com/wp-content/themes/twentyten/b9un4f.php?id=1 – hxxps://lu*******************.com/wp-content/themes/twentytwentytwo/pam8oa.php?id=1 – hxxps://www.yu*******.de/wp-content/themes/twentytwentytwo/n2gd2t.php?id=1
関連 IoC および詳細な解析情報は、AhnLab の次世代脅威インテリジェンスプラットフォーム「AhnLab TIP」サブスクリプションサービスを通して確認できる。
Categories: マルウェアの情報