Wireshark - Malware traffic Analysis

Hack eXPlorer
14 Sept 201916:00

Summary

TLDRIn this episode of 'Hack Explored,' the host delves into packet analysis using Wireshark, a vital skill for security professionals. They guide viewers through using Wireshark to analyze network traffic, focusing on identifying indicators of compromised systems, such as IP addresses and domain names. The demonstration includes filtering HTTP traffic, exporting objects, and using tools like VirusTotal to check for malware. The video concludes with tips on blocking malicious files and sites, and further learning resources are suggested for mastering network analysis.

Takeaways

  • 📚 The video is an educational tutorial on packet analysis using Wireshark, a leading network traffic analyzer.
  • 👨‍🏫 It is aimed at security professionals, including beginners, and provides step-by-step guides for mastering the tool.
  • 🔍 Wireshark is popular for troubleshooting network issues and can reveal interesting events happening on a network.
  • 🔑 The script explains how to collect I/O CS, which are forensics data pieces collected during analysis and can indicate compromised systems.
  • 🚫 It demonstrates using IP addresses and domain names to block malicious activity detected within a network.
  • 🖥️ The tutorial covers how to use Wireshark to analyze network traffic captures, either locally or from sample captures online.
  • 📈 The video guides viewers on how to enhance the default view in Wireshark to make analysis easier, such as by modifying the time display format.
  • 📊 It emphasizes the importance of understanding the protocols used in a traffic capture and how to filter traffic to focus on specific protocols like HTTP.
  • 🔎 The script details how to add and modify columns in Wireshark to better understand the source, destination, and nature of network traffic.
  • 🛠️ It shows how to export HTTP objects from a capture to find and save files that may be infected, such as executables or Java files.
  • 🛡️ The tutorial suggests using VirusTotal to check the downloaded files for malware by uploading them or checking their hashes.
  • 🔗 Finally, the video provides a method to identify the infected machine's hostname, IP address, and MAC address from the captured data.

Q & A

  • What is the main topic of the video?

    -The main topic of the video is packet analysis using Wireshark, a network traffic analyzer, and its importance for security professionals.

  • Why is packet analysis an important skill for security professionals?

    -Packet analysis is important for security professionals to troubleshoot network issues, discover events happening on a network, and collect forensics data known as IoCs (Indicators of Compromise).

  • What is Wireshark and how is it used in the video?

    -Wireshark is a leading network traffic analyzer used in the video to demonstrate how to analyze network traffic, filter specific protocols, and collect data to investigate potential security threats.

  • What is an IoC (Indicator of Compromise) and how can it be used?

    -An IoC is a piece of forensic data collected during analysis, such as IP addresses, domain names, and user agents, which can be used to detect and prevent attacks by identifying compromised systems.

  • How can an IP address be utilized in cybersecurity?

    -In cybersecurity, if an IP address is detected as spreading malware, it can be immediately blocked to prevent further threats to the network.

  • What is the purpose of the 'protocol hierarchy' in Wireshark?

    -The protocol hierarchy in Wireshark provides a summary of the protocol activity within a traffic capture, helping users understand the types of protocols used and focus on relevant sections for analysis.

  • How can Wireshark filters help in narrowing down the analysis?

    -Wireshark filters allow users to display only the traffic of interest, such as HTTP requests, which helps in focusing the analysis on specific activities and reducing the amount of data to be examined.

  • What is the significance of adding custom columns in Wireshark for analysis?

    -Adding custom columns in Wireshark can make the interface more meaningful and understandable by displaying specific information relevant to the analysis, such as source and destination ports, URLs, and hostnames.

  • How can Wireshark be used to identify and save infected files from a network traffic capture?

    -Wireshark can be used to identify file downloads through HTTP requests, and the 'export objects' feature can be utilized to save the files for further analysis, such as checking for malware.

  • What is the role of VirusTotal in the context of the video?

    -VirusTotal is used in the video to check the downloaded files for any infections by uploading the files or their hashes to determine if they are malicious.

  • How can the information collected from Wireshark be used to prevent future attacks?

    -The information collected, such as infected file hashes and IP addresses, can be used to block malicious traffic within the network and conduct investigations on compromised systems to ensure they are cleaned and secure.

  • What additional resources are mentioned in the video for learning more about packet analysis and Wireshark?

    -The video mentions 'Wireshark Network Analysis' by Laura Chappell as a book for learning more about packet analysis, and 'malware_traffic_analysis.net' as a website with exercises related to traffic analysis.

Outlines

00:00

🔍 Introduction to Packet Analysis with Wireshark

The video script introduces packet analysis as a crucial skill for security professionals, focusing on the use of Wireshark, a leading network traffic analyzer. It assures beginners that step-by-step guides are available and emphasizes learning to master the tool. The script mentions the importance of packet analysis in cybersecurity for identifying network events and collecting forensic data, such as IP addresses and domain names, which can indicate compromised systems. The video demonstrates how to use Wireshark to analyze a specific packet capture from malware traffic, highlighting the tool's capabilities in local network traffic capture and analysis of sample captures available online. It also covers basic navigation in Wireshark, such as modifying the display for easier analysis and understanding the protocols involved in a traffic capture.

05:00

📚 Enhancing Wireshark Display and Filtering HTTP Traffic

This paragraph delves into customizing the Wireshark interface to enhance analysis by removing unnecessary information like packet numbers and adjusting the time display format to show date and time of network events. It discusses the use of the statistics menu to understand the types of protocols present in a traffic capture, with a focus on IP version 4 and HTTP activity, indicating web traffic. The script provides a step-by-step guide on applying filters to show only HTTP traffic and further refining the display by adding columns for source and destination ports, and the URL path of HTTP requests. This approach narrows down the analysis to relevant traffic, making it easier to identify specific activities such as file downloads.

10:01

🛠 Analyzing Malware Downloads and Collecting File Hashes

The script explains how to analyze a packet capture containing a malware download, instructing viewers on how to find and export HTTP objects, which represent downloaded files. It emphasizes the importance of identifying file types associated with malware, such as Java archives, executables, and shockwave objects, and saving them with appropriate file extensions for further analysis. The use of VirusTotal to check the files for malicious content is introduced, along with the recommendation to use file hashes for this purpose to maintain data confidentiality. The paragraph also covers how to extract file hashes using a tool from Nero soft and how to use these hashes to search for malicious files on VirusTotal, identifying infected files and their respective hashes.

15:02

🔎 Investigating Infected Systems and Preventive Measures

The final paragraph wraps up the investigation by identifying the URL domain and IP address of the infected site, as well as the IP address, hostname, and MAC address of the infected machine, all extracted from the Wireshark analysis. It discusses the implications of the findings, such as blocking infected file hashes within a network, preventing access to malicious sites and IP addresses, and conducting further investigations on potentially compromised machines. The script concludes with recommendations for further learning, including a book by Laura Chappell, the founder of Wireshark, and a website for additional exercises in network traffic analysis. It also cautions viewers to handle packet captures containing live viruses with care, such as by using a sandbox environment.

Mindmap

Keywords

💡Packet Analysis

Packet analysis is the process of examining the data packets transmitted over a network to identify patterns, diagnose issues, or detect malicious activity. In the context of the video, packet analysis is an essential skill for security professionals to master, particularly when using tools like Wireshark to investigate network traffic and identify potential security threats.

💡Wireshark

Wireshark is a widely used network protocol analyzer that allows users to capture and interactively browse the traffic running on a computer network. The video emphasizes Wireshark as the leading tool for network traffic analysis, demonstrating its use in examining and filtering network packets to uncover activities such as malware downloads.

💡IoCs (Indicators of Compromise)

Indicators of Compromise (IoCs) are pieces of evidence that threat actors have compromised a system or network. The script mentions IoCs as forensics data collected during analysis, such as IP addresses and domain names, which can be used to identify and block malicious activity on a network.

💡Malware

Malware refers to malicious software designed to infiltrate, damage, or perform unauthorized actions on a computer system. The video discusses the detection of malware through packet analysis, particularly by identifying suspicious network traffic patterns and file downloads.

💡HTTP Traffic

HTTP (Hypertext Transfer Protocol) traffic pertains to the data transmitted over the HTTP protocol, which is the foundation of data communication for the World Wide Web. The script uses HTTP traffic as an example to demonstrate how to filter and analyze web-related activities that might involve malware downloads.

💡File Hashes

File hashes are unique fixed-size strings generated from the content of a file, used to verify its integrity or identify malicious files. The video script describes the process of extracting file hashes from downloaded files and checking them against databases like VirusTotal to determine if they are infected.

💡VirusTotal

VirusTotal is an online service that analyzes files and URLs for viruses, worms, and other types of threats and malicious content. In the script, VirusTotal is used to check the file hashes collected from the Wireshark analysis to ascertain if the files are malicious.

💡DHCP

DHCP (Dynamic Host Configuration Protocol) is a network management protocol used to dynamically assign IP addresses and other network configuration parameters to devices on a network. The video mentions using DHCP requests to find hostname information related to network activity.

💡IP Address

An IP address is a numerical label assigned to devices connected to a computer network that uses the Internet Protocol for communication. The script discusses identifying and blocking IP addresses associated with the spread of malware as part of the network security analysis.

💡MAC Address

A MAC (Media Access Control) address is a unique identifier assigned to network interfaces for communications on the physical network segment. The video script describes finding the MAC address of an infected machine as part of the investigative process using Wireshark.

💡Sandbox

A sandbox is a security mechanism for separating running programs, usually to mitigate system access from software bugs and vulnerabilities. The script advises running suspicious files in a sandbox environment to safely analyze them without risking infection.

Highlights

Introduction to packet analysis as an essential skill for security professionals.

Using Wireshark, the world's leading network traffic analyzer, for mastering packet analysis.

Availability of step-by-step guides for beginners in Wireshark.

Wireshark's role in troubleshooting network issues and discovering security events.

Collection of I/O CS, indicators of compromised systems, during network analysis.

Utilizing IP addresses and domain names to block malware spread in a network.

Demonstration of analyzing specific I/O CS from a network traffic capture.

Explanation of Wireshark's capabilities for local capture and analysis of sample packet captures.

Customization of Wireshark's display for easier analysis by removing unwanted features.

Using the protocol hierarchy in Wireshark to understand traffic protocols.

Filtering HTTP traffic in Wireshark to focus on web-related activities.

Adding custom columns in Wireshark for a clearer analysis interface.

Identifying file downloads in a packet capture and exporting them for further analysis.

Using VirusTotal to check downloaded files for malicious content.

Extracting file hashes for security analysis using tools like HashCalc.

Investigating the source of infection by identifying URLs and IP addresses.

Determining the hostname and MAC address of the infected machine using DHCP analysis.

Preventative measures such as blocking file hashes and IP addresses within a network.

Recommendation of resources for further learning on network analysis and Wireshark.

Emphasis on the importance of running packet captures in a sandbox environment for safety.

Transcripts

play00:00

hi guys welcome to hack explored in this

play00:03

episode we'll be talking about packet

play00:04

analysis which is an important skill

play00:07

that a security professional should

play00:08

master and we'll be using the world's

play00:10

leading network traffic analyzer pie

play00:13

shop so if you're a beginner don't worry

play00:15

there's a lot of step-by-step guides

play00:17

over here and along the way we'll be

play00:21

learning a lot how to master this tool

play00:23

so continue watching and not come to my

play00:26

channel and don't malva traffic

play00:33

analysis with buy shock why shack is a

play00:36

popular tool for troubleshooting network

play00:38

riddle issues but in cybersecurity

play00:40

you can disco many interesting events

play00:42

that is happening on a network for

play00:44

example we can collect lot of i/o CS

play00:47

which are known as indication of

play00:49

compromised iosys in simply explained

play00:52

these are pieces of forensics data that

play00:54

we collected during your analysis

play00:56

example IP addresses domain names news

play00:59

agents and all the rest of things that

play01:01

are here which can be some of the iOS's

play01:04

that can be collected during a cyber

play01:06

investigation how can we use the IP

play01:08

address if an IP address is detected as

play01:11

spreading malware to our network we can

play01:14

immediately block it same thing goes for

play01:16

a domain name collection of iOS's will

play01:19

help organization to detect and prevent

play01:23

attacks in this demonstration we'll be

play01:25

looking at some specific io seized from

play01:28

a network traffic capture so let's jump

play01:32

into Wireshark washa can be used in two

play01:34

ways

play01:35

one is you can perform a local capture

play01:37

of the network traffic and analyze it or

play01:39

there are a lot of sites which offers

play01:41

you sample packet captures for analysis

play01:43

I'm using a packet capture from malware

play01:46

traffic analysis dotnet I've given the

play01:48

link below so I'm using one of the

play01:50

capture sample given by them click open

play01:52

the basic things are you can see the

play01:54

source and the destination IPS which are

play01:56

connected watch protocols they are using

play01:58

and info will provide you more

play02:00

information

play02:01

but this default view we can enhance it

play02:05

we can add more features or remove some

play02:07

unwanted features to make our analysis

play02:09

easier so the first thing I'm going to

play02:11

do is make the display

play02:13

easier to move I won't be needing the

play02:14

number of packets so I'm going to remove

play02:16

the packet number and I cut length I'm

play02:19

gonna remove that so I'm going to do

play02:21

some modifications for the time this

play02:23

time is in seconds I'll be changing this

play02:26

view at the time display format into

play02:29

date and time of which will show you the

play02:32

date and time of the network event so

play02:35

let's add on columns as we go on one of

play02:38

the first things that you have to do

play02:40

when you receive a capture like this is

play02:42

understand what type of protocols that

play02:44

are used inside this traffic capture for

play02:46

example if you go to the statistics menu

play02:49

which we'll be using a lot to get

play02:51

summarized information first things that

play02:53

I go is the protocol hierarchy so this

play02:57

window shows a summary of what protocol

play03:00

activity that we see for example we see

play03:02

some in IP version 6 traffic IP version

play03:05

4 which is 98% so I'm interested in this

play03:08

section this is where all the things are

play03:10

happening inside that also we see some

play03:13

TCP and UDP traffic so UDP normally we

play03:17

can use to get machine related

play03:19

information such as DHCP and DNS

play03:22

requests and here where we can see the

play03:25

application level traffic according this

play03:27

graph we can see there is lot of HTTP

play03:30

activity hypertext Transfer Protocol

play03:32

activity which indicates this is

play03:35

something related to web traffic if I

play03:39

give you an example in this malware

play03:41

traffic analysis dotnet this packet

play03:43

capture is all about user downloading a

play03:46

malware so definitely we will be finding

play03:49

in the hypertext Transfer Protocol so in

play03:52

the normal view you can see all the

play03:54

protocols since we are interested in HD

play03:57

traffic I am going to use a filter you

play04:00

can type a filter over here or you can

play04:03

use this window and just right click and

play04:06

apply this section as a window so I'm

play04:08

telling by sharp to show me only the

play04:10

HTTP traffic if I close this window the

play04:12

HTTP traffic and all the related traffic

play04:16

over here but I'm going to filter out

play04:17

like this so I'm going to use a method

play04:19

called HTTP dot request so the HTTP

play04:23

request filter will show me only the

play04:25

gate

play04:26

the post requests that are made from the

play04:28

source to the destination you can see we

play04:31

have a narrowed down a search more so

play04:33

you have a less number of traffic to

play04:36

analyze now right now to make the

play04:40

interface more meaningful and more

play04:41

understandable I can add more columns

play04:44

for example we can see a source and a

play04:48

destination and the request that is made

play04:50

but we can see only the URL path and

play04:53

this destination IP address won't be

play04:55

meaningful in this second section of

play05:00

this vile Shack you can see all the

play05:02

protocol literary information I'm either

play05:04

using the hypertext Transfer Protocol

play05:06

section and if you go inside here you

play05:08

can see this will contain the actual

play05:10

hostname so right-click and apply this

play05:13

sub column now you can see clearly where

play05:17

did this sauce connect to we can add

play05:22

some more information into the column

play05:24

display to make it more information for

play05:25

example when I am doing this I get the

play05:28

source port and I'm going to get it from

play05:33

here

play05:34

the source port and I'm going to add

play05:37

another column called G s T port I'll

play05:42

make this spiotti

play05:44

to make the column no short I'll make

play05:47

this is our C port okay and here you can

play05:52

select the destination port from here

play05:55

click OK

play05:57

yeah the ports normally will show in the

play06:00

corner you can drag and move them or you

play06:04

can also go to column preferences and I

play06:09

want it right over here so this will

play06:13

make my life more easy to make it clear

play06:16

you can align these data to left or

play06:18

right according to your preferences so

play06:19

now we have more information so this is

play06:22

how you set up your column display - in

play06:25

order to make you analyst is more easier

play06:27

so we can see the time and the source

play06:28

and destination ports and the sites that

play06:30

they are connected to all of these data

play06:32

are derived from the packet data that we

play06:34

have right now as I told you this packet

play06:37

capture is containing a Mel

play06:39

download or we can see according to the

play06:41

HTTP request only this machine accessed

play06:45

Internet I will see what are the

play06:48

questions that we are looking into it so

play06:49

we all want to find the fitted file

play06:52

download it and there hashes I'm going

play06:54

in this order I'm going to answer all of

play06:56

these questions so first we will see how

play06:59

to find the infected files are

play07:00

downloaded you can see all the file

play07:03

requests from here but if you want to

play07:06

get the actual file you need to go to

play07:08

file and this option called export

play07:10

objects and you can see all the HTTP

play07:14

objects which were down ordered in this

play07:16

packet capture there's lot of content

play07:18

types

play07:18

I'll sort them out you can see

play07:21

application in give HTML in JavaScript

play07:25

when you're looking for malware the tag

play07:29

that you are use is content type and the

play07:31

application type over here there are

play07:33

three different categories of

play07:34

applications you download a Java file it

play07:37

makes X download which could be a Exe or

play07:40

executable microsoft download and

play07:42

Shopville fref these are the main ways

play07:46

of fected file can be downloaded other

play07:49

than this there could be word files

play07:51

which is having a macro as direct

play07:53

executables these files are the most

play07:55

suspicious one I'm going to click on the

play07:56

file and I'm going to click Save yeah

play08:00

this is the Java Kuip I'll add the dot

play08:03

jar extension for this and I'm going to

play08:06

take a sample of this so this was

play08:09

executable so I'm going to say X E and

play08:12

this is a shockwave object so I'm going

play08:15

to save this as a dart establish a file

play08:19

that's not only to rename this one but I

play08:22

need to identify the file later so

play08:24

that's I'm adding the exchange for the

play08:25

files but remember the application

play08:28

content type is the thing that you had

play08:31

looked for when if you are looking for

play08:32

any malware PDF and Microsoft our file

play08:35

downloads are also suspicious so I'm

play08:37

going to open my Explorer window and go

play08:40

to my wife investigation and go to

play08:42

sample download so you can see these are

play08:45

the three files are downloaded now we

play08:48

have to see whether these are malicious

play08:50

in this situation we can use the

play08:53

virustotal we can upload the files and

play08:56

see if these are infected I don't

play08:59

recommend uploading the files directly

play09:01

because imagine this is Microsoft Word

play09:04

document which is having any

play09:05

confidential data and if you upload it

play09:08

your data is out of the organization

play09:10

envira started as option where they

play09:13

accept the hash of the file until it is

play09:15

malicious or not so in this type of

play09:18

situations it's better to have a file

play09:20

ready to answer your questions so first

play09:24

of all what are the infected files and

play09:25

their hashes so how do you get the hash

play09:28

out file so you have a lot of tools one

play09:30

of the main tools that I love is offered

play09:32

by Nero soft I'll post the link for this

play09:36

file in the description window so this

play09:38

very useful tool to extract the file

play09:40

hashes from a given file so we have the

play09:44

file name and the file hashes so I'm

play09:47

going to copy the file hashes it's very

play09:48

easy all the file hashes at one these

play09:50

are the ones that I should check I'll

play09:52

copy the md5 version of this go to my

play09:56

notepad editor and just paste the hash

play09:58

or so here so first of all we have

play10:00

collected the hashes which we are going

play10:03

to check for any virus good information

play10:05

let me jump into my virus total window

play10:08

and search see it will accept the I'll

play10:11

hash let's check if it is malicious

play10:14

so it's infected so this is a mug this

play10:20

has infected let's check for the other

play10:24

file and paste it over here hmm that

play10:32

seems to be file that is safe but just

play10:37

to be safe I'll down or this one

play10:47

and you can see we have another infected

play10:51

fire which is swf okay it's WF I'll just

play11:01

copy this one back again I believe it's

play11:04

the jar file yep a Java exploit infected

play11:11

Java I'll leave this hash around because

play11:17

that was also executable which was

play11:20

downloaded this could be a virus which

play11:23

was not yet discovered it could be a

play11:27

zero-day but we are not sure that we'll

play11:29

see if this the sauce is compromised

play11:32

with something we have to make sure this

play11:34

file Isis was not downloaded okay that

play11:38

is how you do use virus turtle in these

play11:40

kind of situations so the second

play11:44

question is what is the URL domain of

play11:46

the infected site let's jump back into

play11:50

Ishak we can see the application was

play11:55

downloaded from this particular hostname

play11:58

standard trust and poverty com

play12:03

okay so I'll copy this and what is the

play12:10

IP address of the inject website now we

play12:13

need the IP address of this one so that

play12:16

will be available in the Internet

play12:17

Protocol we can copy this value and

play12:23

paste it over here right and that was

play12:26

easy what is the IP address of the

play12:28

infected machine so in our case the

play12:31

infected machine is the sauce over here

play12:34

I'll copy the value over here alright so

play12:38

that was easy the next we have to find

play12:41

another two things so what is the

play12:43

hostname of the infected machine and the

play12:45

MAC address you should go to IP Ethernet

play12:48

literally information so this should be

play12:51

the source MAC address I'll copy the

play12:54

value first so I pasted it here

play12:56

I need the hostname now let me go into

play12:59

the protocol higher

play13:00

so there are many protocols which can be

play13:01

used to find the hostname I go to

play13:05

statistics and protocol hierarchy here

play13:08

you can find a lot of naming services

play13:11

and Indian protocol and the UDP protocol

play13:14

you have NetBIOS and dhcp which can also

play13:18

be used to find the back and host

play13:21

information I'll use the DHCP the most

play13:25

common way to find proc also it's easy

play13:29

you can just right click apply this as

play13:31

filter or you can just go to DHCP which

play13:37

is show you all the DHCP related

play13:39

requests so the host name of this

play13:42

particular IP so we can see there are

play13:44

two requests the inform and the request

play13:46

so normally the DHCP request we should

play13:48

find the host information so if you both

play13:52

expand this dynamic host configuration

play13:54

protocol and if you go in you can see

play13:57

the client MAC address who has requested

play13:59

which is the same MAC address that we

play14:02

found here might be a fan and if you dig

play14:05

in deeper you will be able to find the

play14:08

host name and this is another way you

play14:11

can apply this as a column and get the

play14:19

host name copy this copy value and now

play14:24

we have found a lot of information

play14:27

related to this activity so the first

play14:31

parts infected file hashes can be

play14:34

blocked inside our network using our

play14:37

wireless card so if they see this file

play14:39

hash you can easily tell the virus car

play14:42

to detect at the virus and delete it we

play14:45

can block access to these sites and IP

play14:47

addresses and we can make an

play14:50

investigation on this PC to see if it is

play14:52

infected and make sure the mother is

play14:55

cleaned so this is how we carry out a

play14:58

Wireshark investigation so if you want

play15:01

to learn more about this type of

play15:03

Investigations you can always refer to

play15:05

the why shock or 1-0-1 essential skills

play15:08

for network analysis a by Laura

play15:11

so this book will help you a lot of tips

play15:13

and tricks by using my shark so this is

play15:16

from the founder and the creator of a

play15:18

shark

play15:19

so that's information for you and again

play15:22

if you want to learn more go to malva

play15:25

traffic analysis dotnet which will have

play15:27

a lot of exercise related to the traffic

play15:30

is so there are a lot of latest things

play15:32

just down order copy make sure you run

play15:35

these on a sandbox these because these

play15:37

have over live viruses inside these

play15:39

packet captures so make sure you are

play15:43

careful when you're handling these

play15:45

things if you enjoy this video please

play15:48

give a thumbs up and please don't forget

play15:50

to subscribe and hope to bring you more

play15:53

videos like this in the future thank you

play15:55

for watching

Rate This

5.0 / 5 (0 votes)

Related Tags
WiresharkCybersecurityPacket AnalysisNetwork TrafficMalware DetectionSecurity ProfessionalProtocol HierarchyHTTP TrafficVirusTotalDigital Forensics