wireshark

37
Wireshark By Kasun Dinesh Madusanke hSenid Lanka: Wireshark

Upload: kasun-madusanke

Post on 15-Apr-2017

330 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Wireshark

hSenid Lanka: Wireshark

Wireshark

By Kasun Dinesh Madusanke

Page 2: Wireshark

2

hSenid Lanka: Wireshark

Topics Network Analysis and Sniffing

Network Analyzer

Network Analyzer Components

Who Uses Network Analyzers

Introduction to Wireshark

Features of Wireshark

Page 3: Wireshark

3

hSenid Lanka: Wireshark

Topics Cont. Applications of Wireshark

Display Filtering

Capture Filtering

Packet Colorization

Demo (Wireshark GUI)

Wireshark Command Line

Demo (Wireshark Command Line)

Page 4: Wireshark

4

hSenid Lanka: Wireshark

Network Analysis and Sniffing

• Process of capturing, decoding, and analyzing network traffic.

o Why is the network slow.o What is the network traffic pattern.o How is the traffic being shared between nodes.

• Also known as,o traffic analysis, protocol analysis, sniffing,

packet analysis, eavesdropping, etc.

Page 5: Wireshark

5

hSenid Lanka: Wireshark

Network Analyzer• A combination of hardware and software tools which can detect, decode, and manipulate

traffic on the network.o Passive monitoring (detection) - Difficult to

detect.o Active (attack).

• Available both free and commercially.

Page 6: Wireshark

6

hSenid Lanka: Wireshark

Network Analyzer Cont.

• Mainly software-based (utilizing OS and NIC).

o Also known as sniffer.o A program that monitors the data traveling through the network passively.

• Common network analyzers,o Wireshark / Etherealo Windumpo Etherpeak o Dsniff and much more…

Page 7: Wireshark

7

hSenid Lanka: Wireshark

Network Analyzer Components• Hardware

o Special hardware devices Monitoring voltage fluctuation Jitter (variation in the delay of received packets)

Jabber (failure to handle electrical signals) CRC and Parity Errors

o NIC Card• Capture driver

o capturing the data

Page 8: Wireshark

8

hSenid Lanka: Wireshark

Network Analyzer Components Cont.

• Buffer

o memory or disk-based.

• Real-time analysis

o analyzing the traffic in real time; detecting any

intrusions.

• Decodero making data readable.

Page 9: Wireshark

9

hSenid Lanka: Wireshark

Who Uses Network Analyzers• System administrators

o Understand system problems and performance.

• Malicious individuals (intruders) o Capture clear text data. o Passively collect data on vulnerable protocols.

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

o Traffic pattern discovery.

o Actively break into the network (backdoor

techniques).

Page 10: Wireshark

10

hSenid Lanka: Wireshark

Introduction to Wireshark?

• It is a packet sniffer Computer application (open source program).

• Initiated by Gerald Combs under the name Ethereal.

• First version was released in 1998.

• The name Wireshark was adopted in June 2006.

Page 11: Wireshark

11

hSenid Lanka: Wireshark

Introduction to Wireshark? Cont.

• Has a GUI front-end and many more information sorting and filtering options.

• “eWeek” Labs named Wireshark one of "The Most Important Open-Source Apps of All Time" as of May 2, 2007.

• Supports command-line and GUI interfaces.

Page 12: Wireshark

12

hSenid Lanka: Wireshark

How Wireshark Works?

Page 13: Wireshark

13

hSenid Lanka: Wireshark

Wireshark User Interface

Page 14: Wireshark

14

hSenid Lanka: Wireshark

Features of Wireshark• It is cross-platform.

• “Understands” the structure of different network protocols.

• Capture live packet data from a network interface.

• Open files containing packet data captured with other packet capture programs

(tcpdump/WinDump/Network General Sniffer®).

• Save packet data captured.

Page 15: Wireshark

15

hSenid Lanka: Wireshark

• Display packets with very detailed protocol information.

• Export some or all packets in a number of capture file formats.

• Filter packets on many criteria.

• Search for packets on many criteria.

• Create various statistics.

Features of Wireshark Cont.

Page 16: Wireshark

16

hSenid Lanka: Wireshark

Applications of Wireshark

• network administrators use it to troubleshoot network problems.

• network security engineers use it to examine security problems.

• developers use it to debug protocol implementations.

• people use it to learn network protocol internals.

Page 17: Wireshark

17

hSenid Lanka: Wireshark

Applications of Wireshark Cont.

• Exposing VOIP problems.

• Supports Malware Detection.

• Helps recognize DOS attack.

• Wireshark isn't an intrusion detection system.

• Wireshark will not manipulate things on the network, it will only "measure" things from it.

Page 18: Wireshark

18

hSenid Lanka: Wireshark

Display Filtering• By arranging the display sort field/order changed.

o Sort order of time/packet numbero Sort order per IP/MAC address of source/destinationo Sort order per protocol

• By marking specific packets manually.

• By configuring filters for,o Addresso Protocolo Frame lengtho String

Page 19: Wireshark

19

hSenid Lanka: Wireshark

Display Filtering Cont.Some basic filter field examples

• ip.src Source IP address• ip.dst Destination IP address• ip.addr IP address (source or destination)• eth.dst Destination MAC address• udp, sip, HTTP, H225, H245• H263.dbq, sip.Method, h323.fastStart, rtp.payload, diameter.User-Name…

Page 20: Wireshark

20

hSenid Lanka: Wireshark

Display Filtering Cont.Filter Comparison operators

• English operators

• C-like operators

Equal (eq) Not equal (ne) Greater than (gt)

Less than (lt) Greater than or equal (ge) Less than or equal (le)

Equal (==) Not equal (!=) Greater than (>)

Less than (<) Greater than or equal (>=) Less than or equal (<=)

Page 21: Wireshark

21

hSenid Lanka: Wireshark

Display Filtering Cont.Some simple filter examples

• ip.addr == 234.78.12.78

• ip.src != 10.0.0.2

• sip.Method == REGISTER

• h263.unrestricted_motion_vector == 0

• sip.from.addr == "sip:[email protected]

• h245.masterSlaveDetermination

Page 22: Wireshark

22

hSenid Lanka: Wireshark

Display Filtering Cont.Display filter logical operators

and && Logical and

or || Logical or

xor ^^ Logical XOR

not ! Logical Not

[…] Substring operator

Page 23: Wireshark

23

hSenid Lanka: Wireshark

Capture Filtering• When capturing packets are stored in temporary files on the computer.

• We can configure Wireshark to capture packets directly to a single or multiple files.

• For heavy traffic network capturing or long time capturing the file/buffer sizes might overwhelm the computer or might even crash it.

• To prevent accumulating huge file/files, if we know what we are looking for we should apply capture filtering.

Page 24: Wireshark

24

hSenid Lanka: Wireshark

Capture Filtering Cont.Capture filter syntax by examples

• host 192.168.122.23 Capture packets from/to IP address 192.168.122.23

• src host 10.0.0.5Capture packets from IP 10.0.0.5

• tcp port 23 and host 10.0.0.5• ether src 00:11:6b:80:47:96• tcp port 23 and not src host 10.0.0.5

Page 25: Wireshark

25

hSenid Lanka: Wireshark

Packet Colorization

• A very useful mechanism available in Wireshark is packet colorization.

• You can set up Wireshark so that it will colorize packets according to a display filter.

• This allows you to emphasize the packets you might be interested in.

Page 26: Wireshark

26

hSenid Lanka: Wireshark

Packet Colorization Cont.

• There are two types of coloring rules in Wireshark:

temporary rules that are only in effect until

you quit the program.

permanent rules that are saved in a

preference file so that they are available

the next time you run Wireshark.

Page 27: Wireshark

27

hSenid Lanka: Wireshark

Coloring Rules-Default

Page 28: Wireshark

28

hSenid Lanka: Wireshark

After Changing the Coloring Rule for TCP

Page 29: Wireshark

29

hSenid Lanka: Wireshark

Demo(Wireshark GUI)

Page 30: Wireshark

30

hSenid Lanka: Wireshark

Wireshark Command Line

Page 31: Wireshark

31

hSenid Lanka: Wireshark

TShark

• You can start Wireshark from the command line/terminal.

• TShark is a terminal oriented version of Wireshark designed for capturing and displaying packets.

• Use when an interactive user interface isn’t necessary or available.

• It supports the same options as Wireshark.

Page 32: Wireshark

32

hSenid Lanka: Wireshark

Some Commands of TShark

• tshark -D

List available capture interfaces.

• tashark -i

Capture all the interfaces.

• tshark -i <interface_name>

Captures only a given interface.

• tshark -c <packet_count>

Captures specific number of packets.

Page 33: Wireshark

33

hSenid Lanka: Wireshark

• tshark -a <condition>

conditions:

duration:NUM - stop after NUM seconds.

filesize:NUM - stop this file after NUM KB.

files:NUM - stop after NUM files.

• tshark -Y <display_filter>

Add a display filter for the capturing.

Some Commands of Tshark Cont.

Page 34: Wireshark

34

hSenid Lanka: Wireshark

• tshark –n

Disable all name resolutions (default: all enabled).

• tshark -N

Enable specific name resolution(s).

• tshark -w <file_path>

write captured data to a file.

• tshark –r <file_path>

Read a file contains captured packet details.

Some Commands of Tshark Cont.

Page 35: Wireshark

35

• tshark -v

display the version.

• tshark -h

Display help.

o tshark -Y "ip.addr==10.0.0.34"

-w:/users/hsenid/desktop/mycap.pcap

o tshark -Y "ip.src==10.0.0.34 and ip.dst==239.255.255.250" -r C:/users/hsenid/desktop/mycap.pcap"

Some Commands of Tshark Cont.

Page 36: Wireshark

36

hSenid Lanka: Wireshark

Demo(Wireshark Command Line)

Page 37: Wireshark

hSenid Lanka: Wireshark

Thank You!