網路攻擊與封包分析- Wireshark

45
Security Camp 2012 網路攻擊與封包分析- Wireshark 講師:鄭毓芹 博士生 服務單位:國立成功大學電機系 E-mail[email protected]

Transcript of 網路攻擊與封包分析- Wireshark

Page 1: 網路攻擊與封包分析- Wireshark

Security Camp 2012

網路攻擊與封包分析- Wireshark

講師:鄭毓芹 博士生

服務單位:國立成功大學電機系

E-mail:[email protected]

Page 2: 網路攻擊與封包分析- Wireshark

2 Security Camp 2012

Agenda

n  Basics n What is “Network Security Analysis” ? n How useful for your security activities? n Who Uses Network Analyzers

n  Tool Introduction n About Wireshark n Sniffer Positioning n Features & Panels

n  Exercise

Page 3: 網路攻擊與封包分析- Wireshark

3 Security Camp 2012

What is “Network Security Analysis” ?

n  Important activities for incident responders and security analyst

n  Currently data just travels around your network like a train. With a packet sniffer, get the ability to capture the data and look inside the packets to see what is actually moving along the tracks.

Page 4: 網路攻擊與封包分析- Wireshark

4 Security Camp 2012

What is “Network Security Analysis” ?

n  Related to many security activities n Network monitoring

n To detect on-going incident n Network forensics:

n To find evidence in the specific incident n Malware analysis:

n To find capability of malware such as “sending important data to malicious servers” or “Bot command & control”

n  Process of capturing, decoding, and analyzing network traffic

Page 5: 網路攻擊與封包分析- Wireshark

5 Security Camp 2012 5

Who Uses Network Analyzers n  System administrators

n  Understand system problems and performance n  Intrusion detection

n  Malicious individuals (intruders) n  Capture cleartext data n  Passively collect data on vulnerable protocols

n  FTP, POP3, IMAP, SMATP, rlogin, HTTP, etc. n  Capture VoIP data

n  Mapping the target network n  Traffic pattern discovery

n  Actively break into the network (backdoor techniques)

Page 6: 網路攻擊與封包分析- Wireshark

6 Security Camp 2012

Network security analysis –Flow based

n  Feature n Focus on network flow/traffic instead of each packet

n Good approach to get high level overview or accounting

n  Tools n Netflow / sFlow n MRTG/RRDTool

Page 7: 網路攻擊與封包分析- Wireshark

7 Security Camp 2012

Network security analysis –Packet based

n  Feature n Focus on each packet or group of packets n Can analyze thoroughly but high cost

n  Tools / Techniques n Tcpdump n Wireshark / tshark

Page 8: 網路攻擊與封包分析- Wireshark

8 Security Camp 2012

Network security analysis –Packet based (Cont.) n  Capture packet

n Don’t use Wireshark to capture packets n Avoid running Wireshark with root privilege n Use more simple program instead

n E.g. tcpdump, dumpcap

n  Analyze packet: n Wireshark is the best friend for this purpose.

Page 9: 網路攻擊與封包分析- Wireshark

9 Security Camp 2012

Tool Introduction: About Wireshark

n  Wireshark is free and open-source tool n  Run on many OSs

n Windows / Linux / *BSD / Solaris and others n  User Interface

n GUI - Packet list / Packet details / Packet Bytes n CUI – tshark (Command line modes)

n  Many Features n Search / Filter/ Colorize / Statistics / others

n  Vulnerability: http://www.wireshark.org/security/

Page 10: 網路攻擊與封包分析- Wireshark

10 Security Camp 2012 10

n  Decodes over 750 protocols n  Compatible with many other sniffers n  Plenty of online resources are available n  Supports command-line and GUI interfaces

n  TSHARK (offers command line interface) has three components

n  Editcap n  Mergecap n  text2pcap

Tool Introduction: About Wireshark (Cont.)

Page 11: 網路攻擊與封包分析- Wireshark

11 Security Camp 2012 11

Tool Introduction: Sniffer Positioning

Page 12: 網路攻擊與封包分析- Wireshark

12 Security Camp 2012

Hub

Tool Introduction: Sniffer Positioning (Cont.)

Page 13: 網路攻擊與封包分析- Wireshark

13 Security Camp 2012

Switches

Tool Introduction: Sniffer Positioning (Cont.)

Page 14: 網路攻擊與封包分析- Wireshark

14

Wireshark (and WinPcap) Wireshark – Application for Sniffing Packets

WinPcap – open source library for packet capture

Operating System – Windows & Unix/Linux

Network Card Drivers – Ethernet/WiFi Card

Ethernet Card

Page 15: 網路攻擊與封包分析- Wireshark

15 Security Camp 2012 15

Getting Wireshark

n  Download the program from n www.wireshark.org/download.html

n  Requires to install capture drivers (monitor ports and capture all traveling packets)

n Windows: winpcap (www.winpcap.org) n Linux: libpcap

Page 16: 網路攻擊與封包分析- Wireshark

16 Security Camp 2012 16

Running Wireshark

Page 17: 網路攻擊與封包分析- Wireshark

17 Security Camp 2012

Simple Capture

Page 18: 網路攻擊與封包分析- Wireshark

18 Security Camp 2012

Capture Options

Page 19: 網路攻擊與封包分析- Wireshark

19 Security Camp 2012 19

Details of the selected packet (#215)

Raw data (content of packet # 215)

Packet #215: HTTP packet

Page 20: 網路攻擊與封包分析- Wireshark

20 Security Camp 2012

Menu Bar

Page 21: 網路攻擊與封包分析- Wireshark

21 Security Camp 2012

Status Bar

Page 22: 網路攻擊與封包分析- Wireshark

22 Security Camp 2012 22

Filtering HTTP packets

only

Page 23: 網路攻擊與封包分析- Wireshark

23 Security Camp 2012

Right Click Filtering

Page 24: 網路攻擊與封包分析- Wireshark

24 Security Camp 2012

Follow TCP Stream

Page 25: 網路攻擊與封包分析- Wireshark

25 Security Camp 2012

Page 26: 網路攻擊與封包分析- Wireshark

26 Security Camp 2012

Protocol Hierarchy

Page 27: 網路攻擊與封包分析- Wireshark

27 Security Camp 2012

Protocol Hierarchy

Page 28: 網路攻擊與封包分析- Wireshark

28 Security Camp 2012

Conversations

Page 29: 網路攻擊與封包分析- Wireshark

29 Security Camp 2012

Conversations

Page 30: 網路攻擊與封包分析- Wireshark

30 Security Camp 2012

Expert Info

Page 31: 網路攻擊與封包分析- Wireshark

31 Security Camp 2012

Expert Info

Page 32: 網路攻擊與封包分析- Wireshark

32 Security Camp 2012

Capture Filter

Page 33: 網路攻擊與封包分析- Wireshark

Security Camp 2012

Exercise 1

FTP Traffic

Page 34: 網路攻擊與封包分析- Wireshark

34 Security Camp 2012

Exercise 1 : FTP Traffic

n  Q1: 封包擷取日期? n  Q2: Protocol analysis ? n  Q3. FTP server's IP address is n  Q4. FTP client's IP address is n  Q5. FTP Err Code 530 means n  Q4. 10.234.125.254 attempt

Page 35: 網路攻擊與封包分析- Wireshark

Security Camp 2012

Exercise 2

Malware Communication Traffic

Page 36: 網路攻擊與封包分析- Wireshark

36 Security Camp 2012

Exercise 2: Malware Communication Traffic

n  Q1. What kind of malicious activity did this malware do?

n  Q2. What is the malicious server's IP address?

Page 37: 網路攻擊與封包分析- Wireshark

Security Camp 2012

Exercise 3

Malicious HTTP Traffic

Page 38: 網路攻擊與封包分析- Wireshark

38 Security Camp 2012

n  Q1. Which site and which page were defaced?

n  site n  page

n  Q2. Which URL looks malicious? n  Q3. Which software seemed to be the target

of this exploit? n  Q4. What kind of malicioius activity was

executed after exploit?

Page 39: 網路攻擊與封包分析- Wireshark

39 Security Camp 2012

HTTP Analysis

Page 40: 網路攻擊與封包分析- Wireshark

40 Security Camp 2012

HTTP Analysis – Load Distribution

Page 41: 網路攻擊與封包分析- Wireshark

41 Security Camp 2012

HTTP Analysis – Packet Counter

Page 42: 網路攻擊與封包分析- Wireshark

42 Security Camp 2012

HTTP Analysis – Requests

Page 43: 網路攻擊與封包分析- Wireshark

43 Security Camp 2012

Export HTTP Objects

Page 44: 網路攻擊與封包分析- Wireshark

44 Security Camp 2012

Packet Length

Page 45: 網路攻擊與封包分析- Wireshark

45 Security Camp 2012

Packet Length