2012 the botnet traffic forensics system

50
The Botnet Traffic Forensics System Canaan Kao 國立清華大學通訊工程所 博士候選人 [email protected]

Transcript of 2012 the botnet traffic forensics system

Page 1: 2012 the botnet traffic forensics system

The Botnet Traffic Forensics System

Canaan Kao

國立清華大學通訊工程所 博士候選人

[email protected]

Page 2: 2012 the botnet traffic forensics system

Who am I?

A programmer (寫程式的人).

C/C++, Win32 SDK, Linux Kernel Programming.

A CEH.

(傳說中的駭客好人卡)

意外地參與了教育部的

Anti-Botnet 計畫,籌備了

三屆的 BoT 研討會。

(還有擔任二屆的講員….)

2012/09/07 The Botnet Traffic Forensics

System

2

Page 3: 2012 the botnet traffic forensics system

大綱

0. About Anti-Botnet Project

1. Botnet Detection

2. Known and Unknown

3. DEMO

4. Summary

2012/09/07 The Botnet Traffic Forensics

System

3

Page 4: 2012 the botnet traffic forensics system

0. About Anti-Botnet Project

2012/09/07 The Botnet Traffic Forensics

System

4

Page 5: 2012 the botnet traffic forensics system

0. About Anti-Botnet Project

依照行政院研考會規劃,分五類:

ANA,資安訊息情報,例如:相關攻擊手法與防禦資訊

INT,入侵事件情報(已確定事件、非網站)

包含打別人與被打

需附證據、學校收到要處理。

EWA,資安預警情報(不確定事件)

當學校收到這個不一定要處理。

DEF, Web 相關情報(已確定事件、網站相關)

需附證據、學校收到要處理。

FBI,事件回饋情報 (不常用)

2012/09/07 The Botnet Traffic Forensics

System

5

Page 6: 2012 the botnet traffic forensics system

1. Botnet Detection

2012/09/07 The Botnet Traffic Forensics

System

6

1. Compromise

and put some things

2. Social Engineering/SPAM

3. Browsing

4. Infection

5. Join Botnet/

Data Leakage

Web Servers/

Landing Site/

跳板 Cracker/Bot Master C&C Server

End Users

Anti-botnet Mechanism

Page 7: 2012 the botnet traffic forensics system

0. About Anti-Botnet Project

2012/09/07 The Botnet Traffic Forensics

System

7

Page 8: 2012 the botnet traffic forensics system

0. About Anti-Botnet Project

2012/09/07 The Botnet Traffic Forensics

System

8

Page 9: 2012 the botnet traffic forensics system

0. About Anti-Botnet Project

2012/09/07 The Botnet Traffic Forensics

System

9

Page 10: 2012 the botnet traffic forensics system

0. About Anti-Botnet Project

2012/09/07 The Botnet Traffic Forensics

System

10

Page 11: 2012 the botnet traffic forensics system

0. About Anti-Botnet Project

2012/09/07 The Botnet Traffic Forensics

System

11

Page 12: 2012 the botnet traffic forensics system

0. About Anti-Botnet Project

這樣做 rule 的方法是對的,但是,有個問題?

2012/09/07 The Botnet Traffic Forensics

System

12

Page 13: 2012 the botnet traffic forensics system

0. About Anti-Botnet Project

2012/09/07 The Botnet Traffic Forensics

System

13

Page 14: 2012 the botnet traffic forensics system

0. About Anti-Botnet Project

天下武功 無堅不摧 唯快不破

2012/09/07 The Botnet Traffic Forensics

System

14

Page 15: 2012 the botnet traffic forensics system

0. About Anti-Botnet Project

2012/09/07 The Botnet Traffic Forensics

System

只能靠火雲邪神了

15

Page 16: 2012 the botnet traffic forensics system

0. About Anti-Botnet Project

2012/09/07 The Botnet Traffic Forensics

System

16

Rule Matching with Known Rule Set

(snort)

Traffic to Rule Converter

Rule Matching with the Known and New Rules

(snort)

Hit/Miss

Hit

Miss

Traffic Selector

Botnet Detection

Rule Verification

Rule Optimization

End

Manual Processing

Known Rule Set

Input

Adding New Rules into Known Rule Set

Malign TrafficInput

Start

Malign TrafficInput

Hit/Miss

Hit

Miss

End

Need to Refine?

New Produced and Integrated

Rule Set

Benign TrafficInput

Optimized Rule Set

Produced

Yes

No

Page 17: 2012 the botnet traffic forensics system

0. About Anti-Botnet Project

RuleGen Demo?

2012/09/07 The Botnet Traffic Forensics

System

17

Page 18: 2012 the botnet traffic forensics system

0. About Anti-Botnet Project

2012/09/07 The Botnet Traffic Forensics

System

18

Page 19: 2012 the botnet traffic forensics system

0. About Anti-Botnet Project

製作 Anti-Botnet IDS rule

目前的 Botnet IDS Rule 組成為(共4,040條Rule)

1,654 條自製 (由真實bot活體網路行為轉譯)

–至今年止已側錄6,234隻Malware及Bot

2,386 條 國外公開的 botnet rule

格式採用 Snort Rule Format (Open Source)

2012/09/07 The Botnet Traffic Forensics

System

19

Page 20: 2012 the botnet traffic forensics system

0. About Anti-Botnet Project

Botnet Rule 下載者來源分佈

2012/1-2012/6來自世界各地 IP 499 個

20 2012/09/07 The Botnet Traffic Forensics

System

Page 21: 2012 the botnet traffic forensics system

0. About Anti-Botnet Project

Botnet Rule 下載者來源分佈

2012/1-2012/6來自台灣 IP 184 個

21 2012/09/07

The Botnet Traffic Forensics

System

Page 22: 2012 the botnet traffic forensics system

1. Botnet Detection

2012/09/07 The Botnet Traffic Forensics

System

22

1. Compromise

and put some things

2. Social Engineering/SPAM

3. Browsing

4. Infection

5. Join Botnet/

Data Leakage

Web Servers/

Landing Site/

跳板 Cracker/Bot Master C&C Server

End Users

Anti-botnet Mechanism

Page 23: 2012 the botnet traffic forensics system

1. Botnet Detection

The Botnet Traffic Forensics

System

23 2012/09/07

Page 24: 2012 the botnet traffic forensics system

Botnet IDS 與一般的IDS要分工合作(如下),防禦外侮與保護 servers,不是 Botnet IDS 的責任。

Botnet IDS 應該要

得到第一手的

使用者網路行為

才能精準判斷

內賊是誰!!

1. Botnet Detection

Botnet IDS的防禦位置

24 The Botnet Traffic Forensics

System

2012/09/07

Page 25: 2012 the botnet traffic forensics system

1. Botnet Detection

Botnet IDS的防禦位置

簡單地說:

IDS 與 Botnet IDS 必須要分工合作

如上圖所示

IDS 要盡量放外面去抵擋外侮

Botnet IDS 要盡量放裡面去觀察使用者的網路行為

Botnet IDS 對於隱藏於LAN 端的 DNS/Proxy/SMTP

servers 後面的 Bot Host 沒有偵測能力。

DNS/Proxy/SMTP servers 會成為代罪羔羊。

所以要盡量把 DNS/Proxy/SMTP servers 放到

Botnet IDS 的 WAN 端。

The Botnet Traffic Forensics

System

25 2012/09/07

Page 26: 2012 the botnet traffic forensics system

2. Known and Unknown

如果說,我們對 Malware 進行動態分析,利用對 memory 的鑑識,可以規避加殼,取得 Malware 的本相以進行分析與歸類。

那 Malware 的 Traffic 是否一樣有跡可尋,可以依照其網路行為對 Malware 進行分門別類,而無視於其檔案的型態?

不管這隻 Malware 是否有加殼

不管是 EXE or PDF.

2012/09/07 The Botnet Traffic Forensics

System

26

Page 27: 2012 the botnet traffic forensics system

2. Known and Unknown

Botnet/Malware 的通訊經常偽裝成許多既有的協定。

例如:IRC、HTTP and P2P

因為獨創一格的通訊協定反而容易被發現

27 2012/09/07 The Botnet Traffic Forensics

System

27

Page 28: 2012 the botnet traffic forensics system

2. Known and Unknown

在這裡唱歌的,不一定都是神經病

用 TCP 80 port 的不一定是HTTP。

用UDP 53 port的不一定是 DNS。

2012/09/07 The Botnet Traffic Forensics

System

28

Page 29: 2012 the botnet traffic forensics system

2. Known and Unknown 正常的 HTTP Request and Response

2012/09/07 The Botnet Traffic Forensics

System

29

Page 30: 2012 the botnet traffic forensics system

2. Known and Unknown (1)非對稱式 (Client/Server 只有一邊是用HTTP)

2012/09/07 The Botnet Traffic Forensics

System

30

Page 31: 2012 the botnet traffic forensics system

2012/09/07 31 The Botnet Traffic Forensics

System

3. Known and Unknown (2)對稱式(Server and Client 都用 HTTP)

這不是 RAR~~~~~!

Page 32: 2012 the botnet traffic forensics system

2012/09/07 32 The Botnet Traffic Forensics

System

3. Our Approach (3)參數異常型(HTTP Request 異常)

Page 33: 2012 the botnet traffic forensics system

2012/09/07 33 The Botnet Traffic Forensics

System

3. Our Approach (4)只使用 Port 80但是內容非 HTTP協定

Page 34: 2012 the botnet traffic forensics system

2. Known and Unknown

格式正常的 DNS Query

2012/09/07 The Botnet Traffic Forensics

System

34

Page 35: 2012 the botnet traffic forensics system

2. Known and Unknown

格式異常的 DNS Query

2012/09/07 The Botnet Traffic Forensics

System

35

Page 36: 2012 the botnet traffic forensics system

2. Known and Unknown

目前Malware的偽裝行為跟正常網路行為還是有些差別。

只要有心,還是可以分辨出來。

但是這些分辨的方法,未必有漂亮的數學模型。

很多都是靠經驗與苦工。

這些細微的異常,是識別 Malware Traffic 與

Normal Application 的關鍵,但常常因為它們對 Servers/Network 來說是 Harmless 而被忽略。

2012/09/07 The Botnet Traffic Forensics

System

36

Page 37: 2012 the botnet traffic forensics system

2. Known and Unknown

過去的偵測方式

主要偵測目標 主要實做方式 優點 缺點

AV-based Malware

Files 針對 HTTP、FTP、SMTP 與

POP3 用 proxy

的方式攔截檔案,沿用主機端的掃毒方式。

較精確 1. 慢

2. 若病毒本體沒有出現在

Traffic 中,則無法察覺

3. 對於已經中毒發作的Host

缺乏偵測能力

IDS-based Harmful

behavior for

servers

主要先偵測 Port

Scan、Flood、SPAM、Exploits

再反推其源頭。

假設其源頭為

bot。

1. 快

2. 當Traffic中無病毒本體也適用

3. 對於已經中毒發作的Host

具有偵測能力

1. 對於

Harmless 的

Malware 行為無法偵測

2. 無法精確推斷惡意是否為Malware所為

37

2012/09/07 The Botnet Traffic Forensics

System

37

Page 38: 2012 the botnet traffic forensics system

2. Known and Unknown

現在的偵測方式

現在的偵測方式: The state of the art

AV+IDS+VM

加IDS解決了

對於已經中毒發作的Host 缺乏偵測能力

可以偵測 Harmful 行為

加VM增強了

對未知型 Malware 的偵測能力.

但是

因為傳統 AV 和 VM 都需要把 packets 還原成檔案才有辦法動作,所以依然是慢

對於 Harmless 的 Malware 行為無法偵測

38

2012/09/07 The Botnet Traffic Forensics

System

38

Page 39: 2012 the botnet traffic forensics system

2. Known and Unknown

我們目前除了能夠建立 “harmful” 的行為模型外,也能夠建立 “harmless

but malicious” 的行為模型,針對未知的網路行為進行相似度的比對,可以發預警防範於未然。

2012/09/07 The Botnet Traffic Forensics

System

39

Page 40: 2012 the botnet traffic forensics system

2. Known and Unknown:網路行為

不同的族群

40

2012/09/07 The Botnet Traffic Forensics

System

40

Page 41: 2012 the botnet traffic forensics system

2. Known and Unknown:網路行為

Based on known Malware to find the unknown ones.

Old->New

異中求同

擱置差異

共創雙贏?

2012/09/07 The Botnet Traffic Forensics

System

41

Page 42: 2012 the botnet traffic forensics system

2. Known and Unknown:

The Family

相同族群

42

2012/09/07 The Botnet Traffic Forensics

System

42

Page 43: 2012 the botnet traffic forensics system

2. Known and Unknown:

The Family

四個不同 MD5 的 Malware

0daf294cb73024bee7312932fa70e997

Trojan-Downloader.Win32.Agent.solm

7108b98a3c83022c42ee1375ec569a3b

Trojan-Downloader.Win32.Agent.sqai

83d2ab4747ff0d9b47bce98690312680

Trojan-GameThief.Win32.Frethoq.doh

C3e7d7960590baaefbc72d601e0b6d73

Cannot be detected by AV

43 2012/09/07 The Botnet Traffic Forensics

System

Page 44: 2012 the botnet traffic forensics system

2. Known and Unknown: The challenge: DGA

DGA: Domain Generation Algorithm

簡單地說,就是 Client (bot) 和 Server (bot master)

會依照特定的 time slot或是在特定的條件下,使用特定(非固定)的domain names 進行轉址通訊。

這會增加 RuleGen 自動採碼的困難。

在 A 時間所採到的 domain name / signature 無法適用於 B 時間。

對策:

使用逆向工程找出其 Algorithm

鎖 IPs, 如果不常換的話….

其他…

2012/09/07 The Botnet Traffic Forensics

System

44

Page 45: 2012 the botnet traffic forensics system

2. Known and Unknown: The challenge: DGA

2012/09/07 The Botnet Traffic Forensics

System

45

Page 46: 2012 the botnet traffic forensics system

2. Known and Unknown: The challenge: DGA

2012/09/07 The Botnet Traffic Forensics

System

46

Page 47: 2012 the botnet traffic forensics system

3. DEMO

The Botnet Traffic Forensics System (BETA)

https://solomon.botnet.tw

Powered by

The Anti-Botnet Project of TANet

BroadWeb Corp.

Please report bugs/problems to

canaan at totoro.cs.nthu.edu.tw

2012/09/07 The Botnet Traffic Forensics

System

47

Page 48: 2012 the botnet traffic forensics system

3. DEMO

建議使用方式 (for自我檢查):

1. 睡覺前關閉大部分的應用程式

只留下 IE 開著

2. 開 WireShark 錄自己本機的封包

注意:有些 Malware 可能會偵測

WireShark running 就不發作

3. 睡醒後把錄到的 pcap 送到 Solomon

目前有 size 限制 10M.

2012/09/07 The Botnet Traffic Forensics

System

48

Page 49: 2012 the botnet traffic forensics system

4. Summary

科技一直不斷地進步,網路攻擊的手法也一直不斷的翻新,與時俱進,成為防禦端不可避免的功夫。

Malware 透過加殼,可以快速變化出許多不同的實體,但是本相相同,所以會有相同的網路行為,Botnet 網路行為鑑識是可行的。

因為 Malware 數量的快速增加,使得自動化分析成為必要的手段。

DGA 會是新一代自動化採碼與分析的挑戰。

2012/09/07 The Botnet Traffic Forensics

System

49

Page 50: 2012 the botnet traffic forensics system

Thanks for your attention

Q&A

As the host of heaven cannot be numbered, neither the sand of the

sea measured. Jer33:22

2012/09/07 The Botnet Traffic Forensics

System

50