集時安全技術團隊( InTimeSec MDR資安服務) 發現多家媒體相關產業遭對岸特定組織鎖定,埋入相同的GoogleDrive 後門。
GoogleDrive 後門是透過DLL側載(DLL Side-loadong)的方式執行,用正常的GoogleAPI請求方式繞過EDR系統及流量偵測,進而達到竊取受駭主機上的檔案。
駭客入侵手法剖析
Stage 1 – 常駐
發現主機被新增會定時執行的異常排程,該排程透過c:\windows\system32系統目錄下的vsshost.exe,請求GoogleAPI(www.googleapis.com)。
![](https://intimesec.com/wp-content/uploads/2024/05/image-13-1024x526.png)
Stage 2 – 運作流程
調查後發現駭客運用微軟合法程式(DesignToolsServer),具有DLL side-loading特性,將其命名為vsshost.exe,並將loader命名為hostfxr.dll放置相同路徑下做側載。
![](https://intimesec.com/wp-content/uploads/2024/05/image-14-1024x363.jpg)
hostfxr.dll具有假簽章,會將自身配置檔進行解密,取得payload檔名後再將其解密,並隨機複製系統目錄下的3個dll檔至創建好的3個C:\Windows\Microsoft.NET\Framework\microsoft-windows.{random 16 bytes}目錄下進行載入,並使用Dll hollowing手法注入payload到載入dll的.text區段。
![](https://intimesec.com/wp-content/uploads/2024/05/image-14-1024x262.png)
![](https://intimesec.com/wp-content/uploads/2024/05/image-15-1024x512.png)
Stage 3 – 配置檔
- Loader配置檔使用AES做加密,解密後可看到程式會對參數進行檢測是否為-n與vssusr(MD5型式),並取得解密payload的AES 金鑰。
- 將payload解密後可取得沒有export name的dll(後面載入模組均有相同特徵)。
![](https://intimesec.com/wp-content/uploads/2024/05/image-16-1024x102.png)
![](https://intimesec.com/wp-content/uploads/2024/05/image-17.jpg)
Offset | Data |
0~fh | MD5 checksum(check 10~34h) |
10~1Fh | AES Key |
20~2Fh | AES IV |
30~3Fh | MD5 checksum(check payload) |
40~43h | payload size |
44h ~ | encrypt payload |
![](https://intimesec.com/wp-content/uploads/2024/05/image-17.png)
Offset | Data |
0~7h | parameter check(-n) |
8~17h | parameter MD5 check(string :” vssusr “) |
18~40h | payload file name |
224~227h | payload size |
228~237h | payload AES Key |
238~247h | payload AES IV |
248~257h | payload MD5 hash |
STAGE 4 – Googledrive 後門
Payload dll內加密區塊也是使用AES進行加密,解密後分為3個區塊(GoogleDrive Config、Core與Drive)。
- GoogleDrive Config
- 內含有Mutex,Client ID、Client Secret與Refresh Token。
- Core
- 載入其他模組。
- Drive
- GoogleDrive API模組,可上傳及下載檔案。
![](https://intimesec.com/wp-content/uploads/2024/05/image-18.png)
在某些案例中可發現PDB字串。
- C:\Workspace\V3\Projects\Nal\bin\Release\nal_core_x64.pdb
- C:\Workspace\V3\Projects\Nal\bin\Release\nal_drive_x64.pdb
GoogleDrive使用者相關資訊。
- DisplayName : Andriana Chen
- EmailAddress : andrianachen0@gmail.com
![ix 查詢駭客GoogleDrive資訊](https://intimesec.com/wp-content/uploads/2024/05/image-19-1024x199.png)
結論
駭客透過常駐合法程式配合Dll side-loading手法載入後門,並使用雲端服務作為中繼站,透過多種逃避技巧躲避單位現有EDR防護機制以及流量檢測機制,進而達到良好的隱匿性,可長期任意竊取單位機敏資訊或造成損失。
InTimeSec MDR提供專業7*24威脅偵測應變MDR資安服務 (Managed Detection And Response, MDR),做主動且即時的鑑識調查,讓駭客即便繞過傳統防護機制,還能有異常行為分析在最後一道防線進行阻擋,將單位損失壓縮到最小。
駭客入侵手法整理MITRE ATT&CK Techniques:
Tactics | Techniques | Note |
Persistence | Scheduled Task/Job: Scheduled Task(T1053.005) | A scheduled task was created for persistence |
Defense Evasion | Hijack Execution Flow: DLL Side-Loading(T1574.002) | vsshost.exe loads a malicious .dll file – hostfxr.dll |
Defense Evasion | Process Injection: Process Hollowing(T1055.012) | Inject the payload into the .text section of the dll |
Command and Control | Web Service(T1102) | Conduct malicious activities through Google Drive |
惡意程式移除清單IOCs
Filename | SHA-256 | Note |
vsshost.exe | 7dd81a93e51bc2a8b41498ea9b924f84dc5041eac6c306ffb8ed232bf067cf16 | exe |
hostfxr.dll | 073b35ecbd1833575fbfb1307654fc532fd938482e09426cfb0541ad87a04f75 | loader |
DesignToolsServer.dll | 5613eaa1ba5e88fd164719db07dbae70f486c3e54e60811da3647728c1b68a92 | payload |
www.googleapi.com | C&C server |