原文鏈接:https://blogs.jpcert.or.jp/en/2020/11/elf-plead.html
譯者:知道創宇404實驗室翻譯組
前言
在過去的一篇文章中,我們介紹了Linux惡意軟件ELF_TSCookie,它被一個攻擊組織BlackTech使用。這個組織也使用其他影響Linux操作系統的惡意軟件。我們之前介紹的Windows的PLEAD模塊也有Linux版本(ELF_PLEAD)。本文將ELF_PLEAD模塊與PLEAD模塊進行了比較。
PLEAD模塊和ELF_PLEAD的對比
ELF_PLEAD和PLEAD模塊許多部分是共享代碼的,并且包括通信在內的大多數功能都是相似的。圖1顯示了PLEAD模塊和ELF_PLEAD的主要功能的比較。
從處理流程來看,這兩種惡意軟件非常相似。下面將從以下幾個方面介紹ELF_PLEAD的特點:
- Configuration
- Communication protocol
- Commands
Configuration
ELF_PLEAD具有大小為0x1AA的配置。圖2是配置示例。它包含C&C服務器和加密密鑰之類的信息。(有關配置的詳細信息,請參閱附錄A。)
該配置經過RC4加密,加密配置之前的32字節字符串是加密密鑰本身。圖3是加密配置及其密鑰的示例。
Communication protocol
PLEAD模塊使用HTTP協議與其C&C服務器通信,ELF_PLEAD使用其自定義協議。除此之外,他們的數據格式和交換加密密鑰的方法幾乎相同。圖4描述了ELF_PLEAD執行的通信流。
首次通信時,ELF_PLEAD交換RC4密鑰的一部分。之后,由交換機生成的RC4密鑰將用于隨后的通信。發送的數據經過RC4加密,然后進行LZO壓縮。(有關通信協議的詳細信息,請參見附錄B。)
Commands
ELF_PLEAD配備有5個命令組,如下所示。(有關命令功能的詳細信息,請參見附錄C。在某些示例中,命令編號可能會有所不同。)
- CFileManager(組號0):用于文件操作的命令
- CFileTransfer(組號1):用于發送/接收文件的命令
- CRemoteShell(組號2):遠程Shell的命令
- CPortForwardManager(組號3):代理模式的命令
- No name(組號0xFF):用于惡意軟件控制的命令
很明顯,這些功能與PLEAD模塊幾乎相同。
總結
我們已經確認,BlackTech使用了針對Linux OS和Windows OS的各種惡意軟件,包括TSCookie,PLEAD和KIVARS。如果您在Windows環境中發現了此類惡意軟件,建議也檢查Linux環境。
附錄A:ELF_PLEAD配置
| Offset | Description | Remarks |
|---|---|---|
| 0x000 | RC4 Key | Used for encrypting communication |
| 0x004 | ID | |
| 0x024 | Port number 1 | |
| 0x026 | Port number 2 | |
| 0x028 | Port number 3 | |
| 0x02A | C&C server 1 | |
| 0x0AA | C&C server 2 | |
| 0x12A | C&C server 3 |
在某些示例中,配置格式可能會有所不同。
附錄B:交換數據的內容
| Offset | Length | Contents |
|---|---|---|
| 0x00 | 4 | RC4 Key (Key4) |
| 0x04 | 4 | Hash value |
| 0x08 | 4 | RC4 key (Key1) |
| 0x0C | 2 | Length of data sent |
| 0x0E | 2 | Length of data at offset 0x10 before compression |
| 0x10 | - | Encrypted data (RC4 +LZO) (See Table A-2 for details.) |
| Offset | Length | Contents |
|---|---|---|
| 0x00 | 2 | 0xFF |
| 0x02 | 4 | RC4 key (Key2) |
| 0x06 | - | Random data (at least 128 bytes) |
| Offset | Length | Contents |
|---|---|---|
| 0x00 | 4 | RC4 key (Key4) |
| 0x04 | 4 | Hash value |
| 0x08 | 4 | RC4 key (Key1) |
| 0x0C | 2 | Length of data sent |
| 0x0E | 2 | Length of data at offset 0x10 before compression |
| 0x10 | - | Encrypted data (RC4 +LZO) (See Table A-4 for details.) |
| Offset | Length | Contents |
|---|---|---|
| 0x00 | 2 | 0x01FF |
| 0x02 | 4 | RC4 key (Key3) |
附錄C:ELF_PLEAD命令
| Value | Contents |
|---|---|
| 4 | Send random data |
| 5 | Reconnect |
| 6 | Restart |
| 7 | End |
| 8 | End |
| 9 | Change socket |
| 11 | Change C2 server |
| Value | Contents |
|---|---|
| 32 | Send list of files |
| 37 | Send file size, mode, timestamp |
| 39 | Change file name |
| 41 | Delete file/directory |
| 43 | Upload file |
| 45 | Execute file |
| 49 | Create directory |
| 51 | Move file |
| 53 | Delete directory |
| Value | Contents |
|---|---|
| 64 | Send file/directory information |
| 67 | Create directory |
| 70 | Download file |
| 71 | Send file information |
| 75 | Upload file |
| Value | Contents |
|---|---|
| 80 | Launch remote shell |
| Value | Contents |
|---|---|
| 96 | Set up proxy |
| 100 | Connect proxy |
| 102 | Send proxy data |
| 104 | - |
| 106 | - |
| 108 | End proxy |
附錄D:C&C服務器
mx.msdtc.tw
附錄E:惡意軟件哈希值
- 5b5f8c4611510c11d413cb2bef70867e584f003210968f97e0c54e6d37ba8d8d
- ca0e83440b77eca4d2eda6efd9530b49ffb477f87f36637b5e43f2e428898766
本文由 Seebug Paper 發布,如需轉載請注明來源。本文地址:http://www.bjnorthway.com/1401/
暫無評論