[駭客入侵手法剖析]偽裝知名通訊軟體的網路釣魚攻擊

集時安全技術團隊( InTimeSec MDR資安服務) 在監看主機時,發現使用者下載到被Blackmoon加料的社交軟體LINE。

使用者大多習慣從網頁查詢關鍵字而不會留意到點選的網址是購買廣告曝光的釣魚網站。程式執行後會安裝正常的Line通訊軟體,但也同時會Drop出惡意程式,將惡意程式寫入服務進行常駐,與駭客中繼站進行連線。

駭客入侵手法剖析

Stage 1  –  告警

分析人員發現有異常程式(OTGContainer.exe)寫入服務,在%UserProfile% \Appdata\Roaming\底下。

i. 告警資訊

透過程序樹狀圖反查後會發現OTGContainer.exe是透過執行BBC.exe(7z.exe)解壓縮所產生。

ii. 程序調查

追查BBC.exe後發現是使用者執行LINE.exe後所產生的相關檔案,LINE.exe主要帶起LINK.msi。

iii. 程序調查2

Stage 2  –  源頭

調查源頭後發現駭客透過購買google廣告方式,將假的LINE通訊軟體網站置頂,誘騙使用者點擊下載加料的LINE程式。

iv. Line釣魚網站

STAGE 3  –  MSI 安裝檔

  • LINE.exe是透過Advanced Installer [ v15.2.0.0 ]進行打包。
  • 將LINE.exe extract 出來後主要分為壓縮檔、7Z、MSI。
V. Line.exe內含檔案

Link.msi主要是執行link.dll,將壓縮檔解壓縮至指定路徑,並執行Bor32-update-flase.exe。

  • BOTorNE.DEF : %UserProfile% \Appdata\Roaming\Wperceptionsimulation
  • Microsoft.bob : C:\Users\Default\Desktop\LNKNEW\yybob
  • Gortable.org : %UserProfile% \Appdata\Roaming\LINEK(正常LINE檔案)
vi. Line.exe安裝流程

STAGE 4  –  Payload解密

  • 所有payload均使用RC4進行加密,每個payload的key都不同。
  • Loader(VNLInit_64.dll)對加密payload(Hrtfsdherheey)使用RC4進行解密,key : TCCdBpx3BJHqhMjzfTph。
vii. loader內的string(payload檔名與key)

STAGE 5  –  Blackmoon

Payload解密後為一個dll,可發現debug字串特徵” blackmoon”。

viii. blackmoon debug string

 STAGE 6  –  寫入服務

  • Hrtfsdherheey.dll會drop出test.bat,並將OTGContainer.exe(迅雷遊戲軟體)寫入服務常駐,執行Haloonoroff.exe。
  • Haloonoroff.exe會透過側載方式載入TDPCONTROL.dll,再載入cefvidf.dll解密vnetlib32。
ix 寫入常駐及載入gh0st RAT流程
ix 寫入常駐及載入gh0st RAT流程

Loader(cefvidf.dll)對加密payload(vnetlib32)使用RC4進行解密,key : HHqBAEFeH7cn6AZPgao。

Payload(vnetlib32)解密後為gh0st RAT。

x. loader內的string(payload檔名與key)

xi. 服務載入gh0st RAT流程

  • OTGContainer.exe會側載libexpat.dll,libexpat.dll會去執行先前被drop出來的test.bat。
  • Test.bat會將同路徑下檔案A跟B結合產生qvlnk.dll,接著執行Lnnloader.exe。
  • Lnnloader.exe會側載qvlnk.dll,讀取Xorapi進行解密。
  • Xorapi為libcef.dll,會Drop出rundll32.exe到C:\windows\SecurityHealthHostn.exe,並將額外payload(WGLogin.olg、NULL.bin、Ptuity.plx、Win.rbg)解密注入SecurityHealthHostn.exe記憶體。
xii. 注入SecurityHealthHostn.exe

STAGE 7  –  Gh0st RAT

Gh0st config使用 xor 63h 與add 32h進行decode,讀取同路徑下特定檔案進行decode,檔名帶有P字樣的檔案為通訊Port。

  • Lost : 8.219.230.76
  • LostP : 3078
  • LostShe : 8.218.61.58
  • LostPShe : 38992
  • ComeOn : Line
xiii. decode function

  • 封包傳輸使用sub 32h 與xor 63h做encode。
  • Magic header為 ato(\x61\x74\x6F),加密後為\x4C\x21\x5E,後面4 bytes為封包大小(\x00\x00\x02\x3B),其餘為資料。
xiv. 封包資訊

結論

駭客透過加料正常程式及購買註冊假網站,誘騙使用者下載執行惡意程式,透過多種逃避技巧躲避單位現有防護機制,進而埋入後門程式,可竊取單位機敏資訊或造成損失。

InTimeSec MDR提供專業7*24威脅偵測應變MDR資安服務 (Managed Detection And Response, MDR),做主動且即時的鑑識調查,讓駭客即便繞過傳統防護機制,還能有異常行為分析在最後一道防線進行阻擋,將單位損失壓縮到最小。

駭客入侵手法整理 MITRE ATT&CK Techniques:

策略技巧摘要說明
Resource DevelopmentAcquire Infrastructure: Malvertising(T1583.008)Hackers purchased online advertisement for a fake Line website published by them to distribute malware (a fake Line installer)
ExecutionUser Execution: Malicious File (T1204.002)The user executes LINE.exe; and Line.exe subsequently executes Bor32-update-flase.exe
PersistenceCreate or Modify System Process: Windows Service(T1543.003)Hrtfsdherheey.dll creates a new service to establish persistence on the target host
Privilege EscalationExecutable Installer File Permissions Weakness(T1574.005)Line.exe turns off UAC’s privilege elevation
Defense EvasionHijack Execution Flow: DLL Search Order Hijacking(T1574.001)OTGContainer.exe loads a malicious .dll file – libexpat.dll
Defense EvasionDeobfuscate/Decode Files or Information (T1140)cefvidf.dll decrypts payload Vnetlib32
Defense EvasionProcess Injection: Dynamic-link Library Injection(T1055.001)libcef.dll injects into the process of SecurityHealthHostn.exe
Command and ControlEncrypted Channel(T1573)gh0st RAT in the memory can evade detection by encrypted TCP communications

惡意程式移除清單 IOCs

FilenameSHA-256note
LINE.exe22c3be5cd4c244561b9e6e508357fa0fc78bbd795737037296e82b5ba589cb57MSI installer
qvlnk.dll540927469495c41abcb9af2ff5428e3c70f494ac4ee89e52495eca48f4fa983eBlackmoon dll
VNLInit_64.dll99788859c123dbd52d34505cbcb7fea0f768548dc9eceeb7348f7c50817eaf80Blackmoon loader
hrtfsdherheey70d6181f80e15c638fa2ad641834e705880e86f310296d864d5a05c02cb03f6fEncrypt Blackmoon dll
test.bat9153b4aa01053f5cc47cd77a59abeee87efa35e310e702bea56abe71b3fc8044Script
TDPCONTROL.dll413b3e6e3594be89ec548f87e1f45b5dff3b6d08d44488c87cf997462c28f20dBlackmoon hijack dll
vnetlib32c0de3305bd078b42c06b14b5cc33984070957233ea9b2d62beb5bc4635e585b7Encrypt gh0st RAT
Xorapi67a91bfcc0540f3e48c104a42bd511a2792bd4f44c5d5749d53a7b2379fee3e5Encrypt Blackmoon dll
libexpat.dlldc3aee991887a033417199b46f9feb4c9f285d11e33f9207b3bd84ecdb906b96Blackmoon dll
WGLogin.olgcb5342fb7a3f98f61aa079d8e77396a546c204a14fdc98ac8400d127f941d0b5Encrypt gh0st RAT
NULL.bin50ccb2b2ad7a709df2a548ec1000a945646814f03dd60952d361557f3f9be7bbEncrypt gh0st RAT
Ptuity.plxe0b322fdb9e1421c48ea7def682e7b431b4b34225592a1eca47573bdd03befc9Encrypt gh0st RAT
Win.rbg0e0ecf143040929969166ca5db4ae9f55d60a5c2146287686bfbd78ef4ff0259Encrypt gh0st RAT
8.219.230.76
C&C server
8.218.61.58
C&C server