Threat Hunting – A proactive Method to Identify Hidden Threat


According to ISO 27005, a threat is defined as a potential cause of an incident that may cause harm to systems and organization. Software attacks, theft of intellectual property, identity theft, sabotage, and information extortion are examples of information security threats. As a result, most of the organization chose active threat hunting practice to defend their organization from the network's unknown threat.

Table of Content
What is Threat Hunting?
Why threat hunting is important?
Who is threat hunter?
What Are the IOCs?
Threat Hunting Plan
·         Design Your Network for Hunting
·         Get your Team Ready
·         Know your Enterprise
·         Collect Hunt Data
·         Know Your Adversary TTP
·         Threat Intelligence Feeds
·         Create Hypothesis
·         Hunt Cycle
·         Measuring Success
·         Resources

What is threat hunting?
Threat hunting is a proactive offense approach that security professionals use with the aid of Intel Threat. It consists of iteratively scanning through networks to detect compromise indicators (IoCs) and threats such as Advanced Persistent Threats (APTs) which bypass your existing security framework.

Analysts monitor, detect, and delete active opponents in a network. They do this as early as possible in order to minimize damage and to reduce the time needed to identify a suspected threat.
Threat hunting tools and techniques are used by researchers to monitor and detect hidden activities. An example of a threat hunting Framework is, implemented N-SOC as part of a next-generation SIEM framework.

The SANS Institute authors expand on the cyber threat hunting process, calling it an active defense strategy consisting of:

Intelligence: The process of collecting data, turning the data into usable information, analyzing the potentially competing sources of that information to produce tactical defense strategy.
Offense: The countermeasures organizations may take to defend against cyberattacks, in particular Advanced Persistent Threats (APT).

Why threat hunting is Important?
Threat hunting's main purpose is to reduce the time needed to find signs of threats who have already breached the IT infrastructure. Since zero-day and Advanced Persistent Threats (APT) continue to challenge security staff, researchers are implementing threat analysis tools and approach to discover threats more efficiently. Through discovering these imprints as soon as possible, the risk of breaches can be reduced on the enterprise.
Other benefits of threat hunting include:
• Identification of gaps in visibility necessary to detect and respond to a specific attacker TTP.
• Classification of gaps in finding.
• Advancement of new monitoring use cases and detection analytics.
• Exposing new threats and TTPs that response to the threat intelligence process.
• Recommendations on new preventive measures.

Who is threat hunter?
A threat hunter is a security professional who is skilled to recognize, isolate and defuse APTs by using manual or AI based techniques because such threats can not be detect by network monitoring tools. He may hunt for insider provocations or outside intruders to uncover risks posed by malicious actor typically employees, or outsiders, including a criminal organization.
Threat hunting activity is mainly related to the NSOC, which represents the Next Generation Security Operations Center, because the threat hunter reports to the threat hunting team manager for hidden threats, who reports to the Chief Information Security Officer (CISO) and is further reported to the SOC manager for integration with the Security Operations Center (SOC) 

What Are the IOCs?

Threat Intelligence feeds can aid in this phase by defining specific vulnerability identifying common indicators (IOCs) and suggesting measures necessary to prevent threat or breach.
Some of the most common indicators of compromise include:
·         A case would be when the intrusion that attacks an organizational host that established a connection with attacker such as IP addresses, URLs and Domain names
·         An example will be a phishing campaign based on an unwilling user clicking on a connection or attachment and a harmful instruction being activated such as Email addresses, email subject, links and attachments.
·         An instance would be an attempt by an external host that has already been detected for malicious behaviour such as Registry keys, filenames and file hashes and DLLs.

Threat Hunting Plan
The cyber threat hunting team should be answerable to these questions before planning for the operation.
1.       What is it that you hunt? You have to select exactly which adversaries you're chasing for. 
o   Exploitation? 
o   Lateral movement? 
o   Exfiltration?
2.       Where are you going to find the opponent/adversaries/IOC?
3.       How would you consider an opponent/adversaries/IOC?
4.       When will you find it?
The Chief Information Security Officer (CISO) should prepare a complete checklist that would be required for effective threat hunting before beginning the threat hunting operation within the company. This helps the team define the resources and tools used in the project and create a parallel strategy as the backup plan if the primary process fails.



It is important to considered that the proactive threat hunting should be conduct in well secure environment where Chief information Security Office arrange all network essential equipment required in the activity, such as given below.
·         Segmentation : Security Zones
·          NTP : Network Time Protocol
·          Protection/Detection : FW/IDS/IPS/DLP/Proxy
·          Tapping : Dump PCAP Data
·          Visibility : Enable Logging as required





The officer should build a team of professional those are spontaneous in doing their job as per the situation requirements and know the situational awareness.
Skill of a threat hunter
Proactively hunts for known adversaries—He is capable to identify the pattern of malicious code used by famous attackers that matches to threat intel feeds or blacklist of known program.
Prevent the attack by identifying unknown threats Threat hunters evaluate the computer system by means of constant surveillance. They choose behavioral analysis to identify abnormalities that indicate a threat.
Implements the incident response proposal—Hunters collect as much information as possible when they identify a threat before conducting an incident response strategy to nullify it. This could be used to refine the response plan and prevent future attacks.




3.                 Know your Enterprise
Group members should be mindful of the organization's jewel crown by knowing the valuable assets and recognizing threat carriers that might affect the company. They should be able to calculate the effect of risk by prioritizing the unknown threat within the network.
Hence, they should be able to classify the following checklist for their organization:
o    Identify Assets
o    Know Threats to Your Assets
o    Prioritize ( High Value / Critical Assets First )
o    Baselining – Know what is normal ?


The Threat Hunters team aims to evaluate Tactics, Techniques, and Procedures (TTPs) that are learned from the indicators with the help of a process known as "Attack Tree Analysis" that includes defining certain measures an attacker can take to break the networks of an organization (Schneier, 1999). "The Lockheed Martin Cyber Kill Chain," which describes one way of determining where an adversary's actions occurred in the attack chain. Intruders also follow these steps on the Cyber Kill Chain while striving to get into a network or web server.
A cyber kill chain is a ‘Lockheed Martin’ model that uncovers the phases of a cyber-attack from early reconnaissance to the objective of data exfiltration: Flow Data NetFlow PCAP DNS Proxy Logs FW/SW/Routers.



5.                 Collect Hunt Data
When conducting the threat hunting task, the collection of hunting data is a very valuable phase in which one must collect the malicious data from the logs created in the network by monitoring the security equipment installed in the network in order to filter packets. Indeed, this phase is the big contribution in providing threat Intel feeds.
Through analyzing logs at each grade, the specialist may recognize the unknown threat carriers that would be active over a long period of time in the network and may constitute a threat of zero day.



6.                 Threat Intelligence Feeds
 CTI is focused on the data collection and analysis to identify potential or current threats to an IT infrastructure. This helps organizations to proactively defend critical infrastructure or intellectual property of an entity from cyber-attacks by using open source intelligence (OSINT), social media intelligence (SOCMINT), human intelligence (HUMINT), deep and dark web technological intelligence or intelligence Security teams look for Indicators of Compromise (IoCs) for persistent threats and zero-day (recently discovered) exploits.
The cyber threat intel Feeds can be categorized in two broad categories:
Free Available: Open Source, OSINT, Social Listing
Paid: Private, Government, commercial vender

The intelligence feeds are continual streams of credible information about existing or potential threats, and bad actors. The researchers are collecting security data from several sources on IoCs such as abnormal behavior and suspicious domains and IP addresses. They can then correlate the information and process it to generate reports of threat intelligence and management.

7.                 Create Hypothesis



8.                 Hunting cycle
The team should follow a common framework at the time of threat hunting which defines the threat hunting cycle process. It is a closed loop that forms a model process for effective hunting which defines four vital stages.



Hypothesis: – Cyber threat hunting is started by making informative beliefs, about the different types of adversarial effects or behaviors that exist in your business network.
Investigate via tools & technique: - Hypotheses are examined via multiple tools and techniques to Identifying relationship between different data sets. An analyst can use these to discover new malicious patterns in their data and reconstruct complex attack paths to reveal an attacker’s Tactics, Techniques, and Procedures (TTPs).
Uncover new pattern & TTP: - A hunter often uses manual methods, tool-based workflows or analytics to discover the specific patterns or anomalies that may be detected in an investigation. What you will find in this phase is a critical part of a hunt's success criteria. Even if an anomaly or intruder is not detected, you want to be able to rule out the existence of a particular strategy or compromise. Essentially, this step acts as the step of "proving or disproving the hypothesis."
Inform Enrich & Analytic: - Lastly, effective hunts form the basis for guiding and empowering predictive analytics. Do not waste time doing the same hunts over and over with your squad. If you discover an indicator or pattern that may reoccur in your system, automate its monitoring to keep your team focused on the next new hunt. Hunting information can be used to upgrade existing monitoring systems, which could include modifying SIEM rules or signatures for analysis.
9.                 Measuring Success
Once the hunting operation cycle has been completed, it is important to evaluate the finding and the assign task KRA to measure the success matrix.
·         Number of Incidents by severity
·         Number of Compromised Hosts
·         Dwell Time of Incidents Discovered.
·         Logging Gaps Identified and Corrected
·         Vulnerabilities Identified
·         Insecure Practices Identified and Corrected
·         Hunts Transitioned to Analytics
·         New Visibilities Gained
·
Resources:

Beginners Guide to TShark (Part 2)


In previous article we learned about the basic functionalities of this wonderful tool called TShark. If you haven’t read it until now. Click here.

TL; DR
In this part, we will the Statistical Functionalities of TShark. We will understand different ways in which we can sort our traffic capture so that we can analysis it faster and effectively.

Table of Content
·         Statistical Options
·         Protocol Hierarchy Statistics
·         Read Filter Analysis
·         Endpoints Analysis
·         Conversation Analysis
·         Expert Mode Analysis
·         Packet Distribution Tree
·         Packet Length Tree
·         Color Based Output Analysis
·         Ring Buffer Analysis
·         Auto-Stop
o   Duration
o   File Size
·         Data-Link Types

Statistical Options
TShark collects different types of Statistics and displays their result after finishing the reading of the captured file. To accomplish this, we will be using the “-z” parameter with TShark . Initially to learn about all the different options inside the “-z” parameter, we will be running the TShark  with the “-z” parameter followed by the help keyword. This gives us an exhaustive list of various supported formats as shown in the image given below.


 
Protocol Hierarchy Statistics
Using the TShark we can create a Protocol based Hierarchy Statistics listing the number of packets and bytes using the “io,phs” option in the “-z” parameter. In the case where no filter is given after the “io,phs” option, the statistics will be calculated for all the packets in the scope. But if a specific filter is provided than the TShark will calculate statistics for those packets that match the filter provided by the user. For our demonstration, we first captured some traffic and wrote the contents on a pcap file using the techniques that we learned in the part 1 of this article series. Then we will be taking the traffic from the file, and then sort the data into a Protocol Hierarchy.  Here we can observe that we have the frames count, size of packets in bytes and the Protocol used for the transmission.
tshark  -r wlan.pcap -z io,phs



Read Filter Analysis
During the first pass analysis of the packet the specified filter (which uses the syntax of read/display filters, rather than that of capture filters) has to be applied. Packets which are not matching the filter are not considered for future passes. This parameter makes sense with multiple passes. Note that forward-looking fields such as 'response in frame #' cannot be used with this filter, since they will not have been calculated when this filter is applied. The “-2” parameter performs a two-pass analysis. This causes TShark to buffer output until the entire first pass is done, but allows it to fill in fields that require future knowledge, it also permits reassembly frame dependencies to be calculated correctly. Here we can see two different analysis one of them is first pass analysis and the latter is the two-pass analysis.
tshark -r wlan.pcap -z io,phs,udp -q
tshark -r wlan.pcap -z io,phs -q -2 -R udp



Endpoints Analysis
Our next option which helps us with the statistics is the “endpoints”. It will create a table that will list all endpoints that could be seen in the capture. The type function which can be used with the endpoint option will specify the endpoint type for which we want to generate the statistics.
The list of Endpoints that are supported by TShark are:
Sno.
Filter
Description
1
“bluetooth”
Bluetooth Addresses
2
“eth”
Ethernet Addresses
3
“fc”
Fiber Channel Addresses
4
“fddi”
FDDI Addresses
5
“ip”
IPv4 Addresses
6
“ipv6”
IPv6 Addresses
7
“ipx”
IPX Addresses
8
“jxta”
JXTS Addresses
9
“ncp”
NCP Addresses
10
“rsvp”
RSVP Addresses
11
“sctp”
SCTP Addresses
12
“tcp”
TCP/IP socket pairs Both IPv4 and IPv6 supported
13
“tr”
Token Ring Addresses
14
“usb”
USB Addresses
15
“udp”
UDP/IP socket pairs Both IPv4 and IPv6 supported
16
“wlan”
IEEE 802.11 addresses

In case that we have specified the filter option then the statistics calculations are done for that particular specified filter. The table like the one generated in the image shown below, is generated by picking up single line form each conversation and displayed against the number of packets per byte in each direction as well as the total number of packets per byte. This table is by default sorted according to the total number of frames.
tshark -r wlan.pcap -z endpoints,wlan -q | head



Conversation Analysis
Let’s move on to the next option which is quite similar to the previous option. It helps us with the statistics is the “conversation”. It will create a table that will list all conversation that could be seen in the capture. The type function which can be used with the conversation option will specify the conversation type for which we want to generate the statistics.
If we have specified the filter option then the statistics calculations are done for that particular specified filter. The table generated by picking up single line form each conversation and displayed against the number of packets per byte in each direction, total number of packets per byte as well as the direction of the conversation travel. This table is by default sorted according to the total number of frames.
tshark -r wlan.pcap -z conv,wlan -q | head



Expert Mode Analysis
The TShark Statistics Module have an Expert Mode. It collects huge amount of data based on Expert Info and then print this information in a specific order. All this data is grouped in the sets of severity like Errors, Warnings, etc., We can use the expert mode with a particular protocol as well. In that case it will display all the expert items of that particular protocol.
tshark -r wlan.pcap -z expert -q | head



Packet Distribution Tree
In this option, we take the traffic form a packet and then drive it through the “http,tree” option under the “-z” parameter to count the number of the HTTP requests, their mods as well as the status code. This is a rather modular approach that is very easy to understand and analyse. Here in our case, we took the packet that we captured earlier and then drove it through the tree option that gave us the Information that a total of 126 requests were generated out of which 14 gave back the “200 OK”. It means that rest of them either gave back an error or were redirected to another server giving back a 3XX series status code.
tshark -r wlan.pcap -z http,tree -q



Packet Length Tree
As long as we are talking about the Tree option, let’s explore it a bit. We have a large variety of ways in which we can use the tree option in combination with other option. To demonstrate that, we decided to use the packet length option with the tree option. This will sort the data on the basis of the size of the packets and then generate a table with it. Now, this table will not only consist of the length of the packets, it will also have the count of the packet. The minimum value of the length in the range of the size of the packets. It will also calculate the size as well as the Percentage of the packets inside the range of packet length
tshark -r wlan.pcap -z plen,tree -q



Color Based Output Analysis
Note: Your terminal must support color output in order for this option to work correctly.
We can enable the coloring of packets according to standard Wireshark color filters. On Windows colors are limited to the standard console character attribute colors. In this option we can setup the colors according to the display filter. This helps in quick locating a specific packet in the bunch of similar packets. It also helps in locating Handshakes in the communication traffic. This can be enabled using the following command.
tshark -r color.pcap --color



Ring Buffer Analysis
By default, the TShark to runs in the "multiple files" mode. In this mode, the TShark writes into several capture files. When the first capture file fills up to a certain capacity, the TShark switches to the next file and so on. The file names that we want to create can be stated using the -w parameter. The number of files, creation data and creation time will be concatenated with the name provided next to -w parameter to form the complete name of the file.
The files option will fill up new files until the number of files are specified. at that moment the TShark will discard data in the first file and start writing to that file and so on. If the files option is not set, new files filled up until one of the capture stops conditions matches or until the disk is full.
There are a lot of criteria upon which the ring buffer works but, in our demonstration, we used 2 of them. Files and the Filesize.
files:value begin again with the first file after value number of files were written (form a ring buffer). This value must be less than 100000.
filesize:value switch to the next file after it reaches a size of value kB. Note that the filesize is limited to a maximum value of 2 GiB.
tshark -I eth0 -w packetsbuffer.pcap -b filesize:1 -b file:3



Auto-Stop
Under the huge array of the options, we have one option called auto stop. As the name tells us that it will stop the traffic capture after the criteria is matched.
Duration
We have a couple of options, in our demonstration, we used the duration criteria. We specified the duration to 10. This value is in seconds. So, the capture tells us that in the time of 10 seconds, we captured 9 packets.
tshark -i eth0 -a duration:10



File Size
Now another criterion for the auto stop option is the file size. The TShark will stop writing to the specified capture file after it reaches a size provided by the user. In our demonstration we set the filesize to 1. This value is in kB. We used the directory listing command to show that the capture was terminated as soon as the file reached the size of 1 kB.
tshark -i eth0 -w 1.pcap -a filesize:1



Data-Link Types
At last, we can also modify the statistics of the captured traffic data based on the Data-Link Types. For that we will have to use an independent parameter, “-L”. In our demonstration, we used the “-L” parameter to show that we have data links like EN10MB specified for the Ethernet Traffic and others.
tshark -L