惡意網站與網頁掛馬 實作課程 Taiwan Honeynet Project 資安分析師鄭毓芹
網站探測 (Capture-HPC) 網路封包 (Wireshark) 網站探測結果 探測紀錄資訊 惡意程式樣本 (Wireshark) 瀏覽路徑分析 掛馬檔案擷取 惡意程式行為分析 防毒軟體偵測 cwsandbox virustotal 掛馬分析 Rhino Javascript Interpreter
Phase 1: 惡意網站探測
Capture-HPC Architecture Computer B Vmware Server Computer A VMWare API URLs Capture Server Guest Operating System (WinXp SP2) Capture Client Request Capture Application Revert Capture BAT Request Response Malware Site
系統行為分析工具 運行於 Win 32 OS Capture-BAT 介紹 使用 API hooking 來監控 Registry, Process 與 File 狀態的變化 提供 exclusion lists 來過濾正常的事件 提供系統行為監控的 log, 幫助後續分析 註 : Capture-HPC 以 Capture-BAT 為基礎, 進行發展, 控制 Client Application 對 Remote Server 探測, 藉由 Capture-BAT 來對整體系統狀態改變進行監控 :
Step 1: 安裝步驟 : 桌上型主機 安裝 Java 執行環境 安裝 Capture-HPC Server 安裝 VMware-Server 1.0.6 Step 1: 本機電腦 ( 任何 OS 皆可 ), 安裝 Vmware server,vmware-serverinstaller-1.0.6-91891.exe 開啟 Firewall Port 902 (By Pass) Step 2: Vmware 將會開啟 Port 902 接受 Capture Server 的命令進行探測, 因此本機電腦防火牆須開啟 Port 902 載入 Guest OS (WinXP Sp2) Step 3: 安裝 Guest OS 於 VMware Server 上,Guest OS 限定是 Windows XP SP2, 其他版本會有問題 ( 網路連接選擇 Custom VMnet8 (NAT)) 停止防毒軟體
安裝步驟 : Guest OS (WinXP SP2) Capture-HPC Client 運作於虛擬機器 Guest OS 中 Step 1: 安裝 Vmware Tools Step 2: 安裝 Micosoft Visual C++ 2008 Redistributable Libraries (SP0) vcredist_x86.exe Step 3: GuestOS(WinXP SP2) 中, 安裝 winpcap 4.0.2 Step 4: 安裝 Capture-Client 程式,CaptureClient-Setup.exe Step 5: 安裝其他需要的程式,ex: Wireshark Firefox Step 6: 設定登入帳號密碼 ( 開始 控制台 使用者帳戶 新增密碼 ) Step 7: 關閉 Windows Update ( 控制台 自動更新 關閉自動更新 ) Step 8: 瀏覽器功能與安全性設定 安裝 Adobe Flash Player IE: 工具 快顯封鎖程式 關閉 IE: 網際網路選項 安全性 自訂等級 啟用功能 IE: 隱私權 接受所有的 Cookies 清除 Cache 與暫存檔 Step 9: 安裝完所有需要的工具與修改設定後, 一定要做 Take Snapshot ( 千萬要記得!)
Step 2: Capture-HPC Server 設定說明編輯 : config.xml 檔案 分為兩大部分 : Global options 與 Virtual Machine 資訊 Global options < global collect-modified-files="true client-default= iexplore iexplore bulk -> iexplore client-default-visit-time= 300 capture-network-packets-malicious="true" capture-network-packets-benign="false" send-exclusion-lists= false" terminate= false" group_size="10" 8
vm_stalled_after_revert_timeout= 300 HPC Server 送出 vix api,hpc- Client 最長回應時間 revert_timeout= 300 HPC Client 執行 revert 時, 最常多久之內要完成 client_inactivity_timeout= 60 送出 Ping 資訊, 等待回應 vm_stalled_during_operation_timeout= 300 HPC Server 送出 URL,HPC- Client 最長回應時間 same_vm_revert_delay= 6 送出 revert 給同一台 vmware 上有多個 HPC- Client 時,delay 時間 different_vm_revert_delay= 24 送出 revert 給不同 vmare 上的 HPC-Client, delay 時間 /> 9
Virtual Machine Server <virtual-machine-server type= vmware-server address= VMware Server 所在主機 IP port= 902 (Listen Port) username= VMware Server 所在主機登入帳號 password= VMware Server 所在主機登入密碼 "> <virtual-machine vm-path= Vmware 上 GuestOS 路徑 C:\Virtual Machines\xxx\Windows XP Professional.vmx" client-path= HPC-Client 程式路徑 C:\Progra~1\Capture\CaptureClient.bat" username= GuestOS 登入帳號 HPC password= GuestOS 登入密碼 HPC@nchc /> </virtual-machine-server> 10
執行 java -Djava.net.preferIPv4Stack=true jar CaptureServer.jar -s < 控制端 IP Lisening address>:<ip Listening port> -f input_url.txt 11
Log Information on Capture-Server Safe.log : the clear and deemed benign URLs Process.log : visiting information for URLs Error.log : URLs that could not be visited States.log: the performance of the Capture-System Malicious.log : the list of deemed malicious URLs Server_timestamp.log : a list of state changes for visiting each URLs Server_timestamp.zip: the files with modified or deleted off on the client machine during the interaction with a malicious servers
參考文件列表 Capture-Client Readme Capture-Server Readme Capture Communication Protocol Capture FAQ : https://projects.honeynet.org/capture-hpc/wiki/faq Preprocessor_README TroubleshootingGuide 13