Unit-5
Unit-5
1 / 137
Defense and Analysis Techniques
Memory Forensics
Honeypots
Malicious Code Naming
Automated Malicious Code Analysis Systems
Intrusion Detection Systems
2 / 137
Memory Forensics
Memory Forensics: Memory forensics involves finding and extracting forensic artifacts
from a computer’s physical memory.
Purpose: It is used to support incident response and malware analysis.
RAM State: While a system is on, random access memory (RAM) contains
critical information about the current state of the system.
Reconstruction: By capturing a full copy of RAM and analyzing it on a separate
machine, it is possible to reconstruct the original system’s state, including:
Applications the user was running.
Files or network connections that existed at the time.
3 / 137
Memory Forensics contd...
4 / 137
Why Memory Forensics Is Important
Memory Forensics Skills: Analysts with memory forensics skills are better equipped to
handle malware incidents than those without such expertise.
Malware Design: Some malware is designed to run entirely from RAM (memory
resident codes) to avoid detection on longer-term storage devices like the hard
drive.
Critical Evidence: If analysts do not examine RAM for signs of intrusion, they
may miss the most important, or even the only, evidence that malware existed on
the system.
Malware Hiding: Some malware uses API hooks to hide its own code and resources
from the operating system, typically targeting other processes on the infected system.
Limitations of API Hooks: These rootkit techniques work while the system is
running but fail against offline memory forensics tools.
Challenges for Malware Authors: To hide from offline tools, malware requires a
different set of capabilities that most authors have not implemented.
Side Effects: Similar to Newton’s law, every action in a computer system
produces a reaction. Even if attackers anticipate side effects of every API call,
they cannot continuously hide each side effect.
Clues for Investigators: Familiarity with these side effects gives investigators
clues to reconstruct what happened on the system.
5 / 137
Capabilities of Memory Forensics
Memory Forensics: Analysts can gather an extreme amount of information about the
state of a system using memory forensics.
Comparison with Live Tools: Table 5-1 compares the default capabilities of a
memory analysis framework with the corresponding tools typically used on a live
system.
Efficiency: Memory forensics frameworks can provide the same information as
10–20 standard tools used on live systems.
Rootkit Bypass: One of the key advantages of memory forensics is its ability to
bypass rootkit tricks, which many live system tools cannot overcome.
6 / 137
Capabilities of Memory Forensics contd...
7 / 137
Memory Analysis Frameworks
Factors to Consider: When selecting a memory analysis framework, the key factors
include:
Cost, the programming language for developing plug-ins, and the operating
systems the framework supports.
Reliability of the framework’s output.
Volatility Framework:
Free and Open-Source: Volatility is a free, open-source memory analysis
framework written in Python.
Cross-Platform: It runs on multiple operating systems, making it a favorite
among many iDefense engineers.
Learning from Source Code: Volatility’s open-source nature allows analysts to
learn how it works by examining the source code, gaining insights into memory
analysis techniques, such as kernel structures and parsing methods.
Understanding the Tools: Knowing how tools like Volatility work, rather than just
using them, is essential for analyzing and understanding sophisticated malware.
8 / 137
Memory Analysis Frameworks contd...
9 / 137
Dumping Physical Memory
F : win32dd.exe/fmem.dmp/s1
10 / 137
Installing and Using Volatility
Download and Installation:
Download Volatility from its home page on the Volatile Systems 3 website or
grab the latest Subversion package from Google Code.
The Volatility Documentation Project by Jamie Levy (gleeda) provides detailed
manuals for installation on Windows, Linux, and OSX.
Basic Setup:
Extract the archive and navigate to the extracted folder:
tar − xvfVolatility − 1.3.tar .gz
cdVolatility − 1.3
Invoke Volatility using Python:
pythonvolatility
Getting Help:
To learn about required arguments for individual commands, use:
pythonvolatility < command > − − help
Many commands work without arguments.
Extracting Evidence:
To extract evidence from a memory dump, use the following syntax:
pythonvolatility < command >< arguments > −fmem.dmp
11 / 137
Finding Hidden Processes
EPROCESS Object: The Windows kernel creates an EPROCESS object for every
process on the system.
The object contains a pair of pointers that identify the previous and subsequent
processes.
These pointers form a chain of process objects, known as a doubly linked list.
Visualizing a Doubly Linked List:
Think of a group of people holding hands in a circle. Each person connects to
exactly two others.
To count the people, one could start with any person and walk in either direction,
counting heads until returning to the start.
Enumerating Processes:
Tools like Process Explorer, Task Manager, and other system administration
programs enumerate processes by walking through this linked list.
This is done using API functions that follow the same methodology of walking
through the chain.
12 / 137
Finding Hidden Processes contd...
13 / 137
Finding Hidden Processes contd...
14 / 137
Finding Hidden Processes contd...
15 / 137
Finding Hidden Processes contd...
16 / 137
Finding Hidden Processes contd...
17 / 137
Finding Hidden Processes contd...
Circle Analogy: Consider the previous analogy of people joining hands to form a
circle, representing the doubly linked list of processes.
Rootkit Evasion: If one person releases both hands to step outside the circle (as
shown in Exhibit 5-2), the people on the left and right will join hands, closing the gap.
The disconnected person does not disappear but is now free to move about the
room.
If we count the people in the circle using the original method (walking the circle),
we will count one fewer person, missing the disconnected individual.
Alternate Detection: To detect the missing person, instead of relying on walking the
circle, we could use a thermal imaging device to scan the entire room, allowing us to
accurately identify all people—even those not in the circle.
Key Takeaway: This is similar to how a rootkit hides processes by unlinking them
from the doubly linked list, making them invisible to traditional enumeration methods.
18 / 137
Finding Hidden Processes contd...
19 / 137
Volatility Analyst Pack
20 / 137
Volatility Analyst Pack
21 / 137
Honeypots
22 / 137
Honeypots Contd...
23 / 137
Honeypots Contd...
24 / 137
Honeypots Contd...
25 / 137
Honeypots Contd...
26 / 137
Honeypots Contd...
27 / 137
Honeypots Contd...
Low-Interaction Honeypots:
Strengths:
Safer from compromise due to emulation.
Requires less maintenance effort.
Logs limited data, reducing analysis time.
Weaknesses:
Emulation requires knowledge of known vulnerabilities.
Cannot capture attacks on unknown vulnerabilities.
Limited data after an attack attempt due to lack of compromise.
High-Interaction Honeypots:
Strengths:
Provides more detailed information on malicious activity.
Weaknesses:
Requires more resources to analyze and maintain.
Higher risk of compromise due to real vulnerabilities.
28 / 137
Honeypots Contd...
Resource Intensive:
High-interaction honeypots require customized technologies like firewalls, IDSs, and
virtual machines.
Frequent rebuilds are necessary after compromise.
Analysis Demands:
Logs the full attack and post-compromise activity, consuming large time and resources.
System remains compromised post-attack, requiring cleansing.
Risks:
Compromised honeypots can be used by attackers to launch attacks on other systems.
Investigations may trace the attack back to the honeypot, raising potential legal
concerns.
29 / 137
Honeypots Contd...
Honeypot Solutions:
Both commercial and open-source options are available, each designed for specific use
cases.
Honeypots act primarily as decoys to divert attacks away from production systems.
Example - Specter:
A commercial low-interaction honeypot.
Advertises vulnerabilities and serves as a decoy and data collection solution.
Honeynet:
A collection of honeypots that simulate a network of systems.
Requires a ”honeywall” to capture and analyze data while containing risks posed by
high-interaction honeypots.
Honeynet Infrastructure:
The honeynet gateway is typically placed in the demilitarized zone (DMZ) to expose
vulnerable infrastructure to inbound attacks.
30 / 137
Honeypots Contd...
31 / 137
Honeypots Contd...
32 / 137
Honeypots Contd...
Entrapment:
Entrapment occurs when law enforcement induces someone to commit a crime they
wouldn’t otherwise commit.
Honeypots do not induce attackers to break in, so entrapment does not apply.
Entrapment is a defense in criminal law, but it is not grounds for a lawsuit.
Privacy:
Logging attacker activity raises privacy concerns, particularly under laws like the Federal
Wiretapping Act and Electronic Communication Privacy Act.
A logon banner stating server monitoring and activity logging typically waives privacy
concerns for attackers.
Liability:
Liability arises if a compromised honeypot is used to launch attacks on other systems.
Consultation with a legal team can help mitigate potential legal issues before deploying
a honeypot.
33 / 137
Honeypots Contd...
34 / 137
Honeypots Contd...
35 / 137
Honeypots Contd...
36 / 137
Honeypots Contd...
37 / 137
Malicious Code Naming
38 / 137
Malicious Code Naming contd...
39 / 137
Malicious Code Naming contd...
40 / 137
Malicious Code Naming contd...
41 / 137
Malicious Code Naming contd...
VirusTotal Results:
In a scan of a malicious file, 17 out of 38 (44.74%) antivirus engines detect it as
malicious.
Despite detection, none of the antivirus tools provide the true name of the virus family
or indicate its purpose (e.g., targeting banks).
Limitations of Generic Naming:
Generic names assigned to malicious files are often too vague to be useful.
The naming technique is likely to be incorrect or overly broad, failing to provide
valuable insights into the virus family or its intentions.
Ease of Naming:
Assigning a name to a malicious file is quick and easy for anyone.
This process does not require any understanding of the code or its actual purpose,
leading to potential misidentification.
42 / 137
Malicious Code Naming contd...
43 / 137
Malicious Code Naming contd...
44 / 137
Malicious Code Naming contd...
45 / 137
Malicious Code Naming contd...
46 / 137
Malicious Code Naming contd...
47 / 137
Malicious Code Naming contd...
48 / 137
Malicious Code Naming contd...
49 / 137
Malicious Code Naming contd...
50 / 137
Malicious Code Naming contd...
51 / 137
Malicious Code Naming contd...
52 / 137
Malicious Code Naming contd...
53 / 137
Malicious Code Naming contd...
54 / 137
Automated Malicious Code Analysis Systems
The massive volume of distinct pieces of malicious code exceeds the capacity of
human analysts.
Fortunately, researchers can automate much of the initial analysis.
This automation allows much greater efficiency and prioritization of analysis of
malicious code samples.
55 / 137
Automated Malicious Code Analysis Systems contd...
56 / 137
Automated Malicious Code Analysis Systems contd...
In recent years, researchers have built many AMASs that differ in capability and
analysis techniques but all operate under the same principle.
To be effective, malicious code must perform some action on the infected system,
and monitoring the malicious code’s behavior is a useful way to determine its
functionality.
Behavioral analysis cannot determine everything that malicious code is capable
of, but it can tell you what the malicious code will do under certain circumstances.
57 / 137
Automated Malicious Code Analysis Systems contd...
There are two main techniques to analyze the behavior of malicious code:
1 Passive analysis: Record the state of the system before and after the infection, then
compare these states to determine what changed.
2 Active analysis: Actively monitor and record malicious code actions during execution.
58 / 137
Passive Analysis contd...
59 / 137
Passive Analysis contd...
60 / 137
Passive Analysis contd...
After the malicious code infects the system, it must be shut down before an
external system analyzes its disk and memory to record the new ”infected” state.
An external computer may be used to record the infected system’s state to avoid
interference from the malicious code.
Malicious code often hides files and processes using rootkits, but an external
system (e.g., a virtual machine host or a system working from a copy of the
infected disk) is not susceptible to this interference.
61 / 137
Passive Analysis contd...
During the analysis stage, the external system compares the infected state to the
clean state already recorded.
AMASs can make comparisons between any features of the system that have a
state.
Common analysis features include:
File system
Windows Registry content
Running processes
Listening ports
Memory contents
62 / 137
Passive Analysis contd...
The comparison between the clean state and infected state is where the passive
analysis system shines.
The analysis typically consists of two stages (see Exhibit 5-7).
In the first stage, it compares the clean and infected states, creating a list of all
changes in the monitored features.
While the list of changes may seem sufficient, it’s important to remember that
Windows also performs thousands of tiny tasks that might change the file system.
This is especially true if the system has been rebooted since the clean state was
recorded (in analysis systems using physical hardware).
To filter out nonmalicious changes, the system uses a second stage to remove all
entries in a predefined white list.
The result is a report containing all changes relevant to the malicious code
analysis.
63 / 137
Passive Analysis contd...
64 / 137
Passive Analysis contd...
In addition to static information about the malicious code (e.g., file name, size,
and MD5), the resulting report might contain:
New files:
C:\WINDOWS\system32\lowsec\user.ds
C:\WINDOWS\system32\lowsec\local.ds
C:\WINDOWS\system32\sdra64.exe
Registry modifications:
Key: HKLM\software\Microsoft\WindowsNT\CurrentVersion\Winlogon
Old Value: \Userinit"=\C:\WINDOWS\system32\userinit.exe"
New Value: \Userinit"=\C:\WINDOWS\system32\userinit.exe,
C:\WINDOWS\system32\sdra64.exe"
65 / 137
Passive Analysis contd...
The information shows that the malicious code not only created three new files
but also altered the Windows Registry to run the file sdra64.exe when the user
logs on.
Passive analysis systems frequently include network monitoring, as long as the
monitoring occurs outside the infected system.
Network traffic is a key component of many AMASs because it includes any
external communication the malicious code might make and reveals the source of
the command-and-control (C&C) server if one exists.
In the mentioned example report, analysis of the network traffic revealed that the
URL visited was http://index683.com/varya/terms.php.
66 / 137
Passive Analysis contd...
Knowing that the malicious code visits this particular website is very valuable.
Security personnel can search proxy logs for any systems that visited this site to
pinpoint infected systems.
Blocking access to this URL will help prevent the malicious code from
conducting its malicious activity.
Malicious code cannot typically detect a passive analysis system because it does
not interfere with its operation.
However, malicious code can make passive systems ineffective by exploiting the
system’s analysis timeout.
If the system only allows the malicious code to run for three minutes before
recording the infected state, the malicious code could simply sleep for four
minutes before taking any action.
67 / 137
Passive Analysis contd...
While passive analysis is simple, it cannot tell the malicious code’s entire story.
For instance, if the malicious code creates a temporary file while installing
components and deletes it before the system captures the infected state, the
analysis report will not include this evidence.
Passive monitoring also fails to capture the timeline of the infection.
The sample report shows that the malicious code creates three files, but it does
not show the order in which they were created.
It is possible that the malicious code created sdra64.exe first, and that
executable created the additional files.
To capture this information, the system must actively monitor the malicious code.
68 / 137
Active Analysis
69 / 137
Active Analysis contd...
One way that active systems monitor malicious code activity is through API
hooking.
An API hook allows a program to intercept another application’s request for a
built-in Windows function, such as InternetOpenUrlW(), which applications use
to make requests for Web pages.
API hooking is a technique often used by rootkits, as it allows malicious code to
not only record user activity but also alter the data sent to and returned by the
API function.
A rootkit might use this to hide the presence of particular files or ensure that the
user does not stop any of its malicious code processes.
70 / 137
Active Analysis contd...
Active analysis systems can install their own rootkits that hook the APIs the
malicious code will use, allowing it to track every API call the program makes.
If malicious code can detect the AMAS processes, it could exit without taking
any actions that would reveal its functionality.
This is the primary disadvantage to active systems, but a well-written rootkit can
hide its own processes to prevent the malicious code from detecting it and
altering its behavior.
71 / 137
Active Analysis contd...
Active systems are not vulnerable to the same waiting technique that malicious
code uses to fool passive systems.
An active analysis rootkit can hook the sleep() function that malicious code
uses to delay execution and then alter the sleep time to just 1 millisecond.
Active analysis systems work in a cycle between clean and infected states, but do
not require a comparison of the clean and infected states to perform their
analysis.
After the malicious code completes execution or runs for the maximum time
allowed, the system records the activity in a report and begins restoring the
system to the clean state.
72 / 137
Active Analysis contd...
Another form of active analysis involves using an emulator rather than infecting a
traditional operating system (OS).
The most prominent emulation-based analysis system is the Norman SandBox.
Instead of installing a rootkit and hooking the Windows APIs, Norman created
software that emulates the Windows OS.
When malicious code running in the Norman SandBox calls the sleep() function,
it actually calls a Norman function that acts just like the Windows sleep()
function.
Malicious code can detect emulated systems if they do not perfectly mimic the
operating system’s API, and malicious code authors frequently attempt to evade
these systems.
73 / 137
Active Analysis contd...
74 / 137
Physical or Virtual Machines
For nonemulated AMASs, both passive and active, analysis time is spent in two
primary categories:
First, time is spent allowing the malicious code to execute.
If the runtime is too short, the analysis might miss a critical step, but the more
time allotted, the longer the system takes to generate a report.
The second major source of analysis time is restoring the infected system to a
clean state.
This must be done to prepare the system for the next analysis and makes up a
significant portion of the analysis time.
75 / 137
Physical or Virtual Machines contd...
Virtualization systems like VMWare and VirtualBox have many features that
make them excellent choices for developing an AMAS.
These programs allow a user to run one or many virtual computers on top of
another OS.
Researchers use these systems to run many analysis instances on a single physical
computer, saving time, power, and money.
Virtual machines (VM) also have the ability to store a clean “snapshot” of the
operating system.
After the analysis is complete, restoring the system to the clean snapshot
typically takes less than 30 seconds.
However, as with active analysis systems, malicious code can detect that it is
running in a VM and alter its execution path to produce an inaccurate report.
One recent example of VM-aware malicious code is Conficker, which did not
execute in VMs to increase analysis difficulty.
76 / 137
Physical or Virtual Machines contd...
Physical machines are not as simple to restore as their virtual counterparts, but
multiple options are available.
One possible solution is Faronics DeepFreeze.
DeepFreeze is a Windows program that allows administrators to revert a system
to a clean state each time it reboots.
Internet users at universities and Internet cafes commonly use DeepFreeze, where
many users access the same pool of computers.
iDefense tested DeepFreeze for use in one sandbox and found that it was not
sufficient to prevent malicious code from altering the system.
Software solutions are not reliable because malicious code can disable them or
use methods to write to the disk that the software does not monitor.
77 / 137
Physical or Virtual Machines contd...
78 / 137
Physical or Virtual Machines contd...
79 / 137
Physical or Virtual Machines contd...
Pure passive and active analysis systems are common, but a single system can
employ techniques from both categories.
iDefense is developing a new AMAS known internally as Automal, which uses a
combination of passive and active analysis with a custom rootkit.
The primary functionality of Automal is based on memory forensics using custom
plug-ins for the Volatility framework.
Memory forensics is relatively new in AMAS but allows systems to discover
critical information about data and processes hidden from tools running on an
active system and that show no evidence in features typically monitored by
passive systems.
Automal runs Volatility on a snapshot of the infected system’s memory when the
system is offline, preventing malicious code from detecting it or changing tactics.
80 / 137
Physical or Virtual Machines contd...
AMASs are valuable tools to anyone who regularly analyzes malicious code, not
just those who process thousands of samples per day.
Many organizations do not have the resources or need to develop their own
AMASs.
Fortunately, many AMASs are available free online.
Each system uses a different analysis mechanism and may return different results.
Submitting files to multiple systems can be beneficial since the combination of
resulting reports may be more complete than what a single system can produce.
Using AMAS is an excellent first step during any malicious code investigation, as
a fully automated analysis can be performed quickly with little human interaction.
81 / 137
Physical or Virtual Machines contd...
82 / 137
Intrusion Detection Systems
83 / 137
Intrusion Detection Systems contd...
There is a need for systems to detect vulnerabilities and malicious code activity
during vulnerable periods.
An IDS can satisfy this need quickly, as these devices can receive one update and
detect malicious activity across an entire network.
An IDS is a device that monitors network traffic for malicious activity.
IDS devices, referred to as sensors, detect malicious activity by searching through
traffic that traverses a network.
The IDS sensor requires access to network packets, which is possible through two
implementations: out of line and inline.
Exhibit 5-9 shows the difference in network topologies between out-of-line and
inline sensors.
84 / 137
Intrusion Detection Systems contd...
85 / 137
Intrusion Detection Systems contd...
86 / 137
Intrusion Detection Systems contd...
Both types of sensors use rules, also known as signatures, to detect malicious
activity.
IDS sensors rely on these signatures to detect malicious activity; therefore, the
effectiveness of an IDS sensor depends on the caliber of the signatures.
Most IDS vendors have different rule structures or languages, but they generally
use content matching and anomalies to detect events.
Content-matching rules use specific pattern matches or regular expressions to
search network traffic for specific strings or values associated with malicious
traffic.
These rules are very specific and require prior knowledge of the particular
malicious content within network activity.
The use of regular expressions provides flexibility to a signature by allowing it to
search for multiple variations of a string.
87 / 137
Intrusion Detection Systems contd...
The content match is static and straightforward, but the regular expression
enhances effectiveness by searching for multiple different actions.
Example HTTP request: GET
/controller.php?action=bot&entity list=&uid=1&first=1&guid=412784631&rnd=94
Content Match: \GET/controller.php?action="
Regular Expression: /GET
s/controller.php?action=(bot|loader |report)/
Sensors also detect malicious activity based on anomalous network traffic.
These anomalies include protocol-specific anomalies and traffic thresholds.
Network protocols abide by standards, and abnormalities in these standards
indicate suspicious activity.
Signature authors capitalize on these protocol abnormalities to detect malicious
activity.
Example: Exhibit 5-10 shows a protocol anomaly within the HTTP header of a
GET request generated by an infected client.
The malicious code author added fields SS and xost to the header, allowing for
easy detection by an IDS signature, as they are not part of the HTTP protocol.
88 / 137
Intrusion Detection Systems contd...
89 / 137
Intrusion Detection Systems contd...
90 / 137
Intrusion Detection Systems contd...
By name, IDS suggests that such systems simply detect inbound attempts to
gain entry to a device; in reality, they have the ability to detect much more.
An IDS device can detect any type of malicious activity that traverses a network
based on the rules used for detection, with some exceptions described later in this
section.
The success of an IDS device in detecting a particular event depends on the
accuracy and flexibility of the signatures within its rule set.
A rule set is a list of signatures that the IDS device uses to detect malicious
activity.
IDS vendors supply a rule set for their products, and many allow the creation of
custom signatures.
The signatures within these sets can detect inbound attacks on servers and
clients, malicious code infections, and propagation.
91 / 137
Intrusion Detection Systems contd...
An IDS device has the ability to detect inbound attacks on a server or client
from specially crafted signatures.
To detect these attacks, the signature author needs prior knowledge of the attack
or the vulnerability to match its network activity.
Equipped with a signature for the attack or vulnerability, the IDS sensor can
detect the activity and trigger an alert for the possible compromise on the
destination.
The IDS, however, is unable to determine if the end system was vulnerable to the
detected attack.
An investigation is pivotal to determine if the attack was successful.
Rules can also detect worm propagation via content matches or anomalies.
The content match approach requires prior knowledge of the network activity the
worm generates when it attempts to spread to other systems.
A signature match provides the source of the worm propagation, which is an
infected system that needs remediation.
An investigation of the destination in this event will determine if the worm
successfully spread to the system.
92 / 137
Intrusion Detection Systems contd...
93 / 137
Intrusion Detection Systems contd...
94 / 137
Intrusion Detection Systems contd...
95 / 137
Intrusion Detection Systems contd...
96 / 137
Intrusion Detection Systems contd...
97 / 137
Intrusion Detection Systems contd...
98 / 137
Intrusion Detection Systems contd...
In addition to IDS evasion techniques, the network environment can affect the
sensor’s ability to detect malicious activity.
Placement of the IDS sensor is key to monitoring the appropriate traffic.
Overlooking sensor placement leads to visibility issues, as the sensor will not
monitor the correct traffic.
Placement in high-traffic areas can severely affect the performance of the IDS
sensor.
Sensors in high-traffic environments require a great deal of hardware to perform
packet inspections.
Packet inspections become more resource-intensive as the amount of traffic
increases; if the sensor lacks sufficient resources, it will fail to detect malicious
traffic.
This results in the IDS failing to create an alert about the malicious activity.
99 / 137
Intrusion Detection Systems contd...
The rule set used by the IDS sensor affects the sensor’s detection performance.
To increase performance, each IDS vendor uses different rule set optimization
techniques.
Despite optimization, the sensor checks all traffic for signature matches.
A smaller set of rules results in faster performance but fewer rules to detect
malicious content.
Larger rule sets perform slower but provide more rules for detecting malicious
activity.
This shows the need for a compromise between speed and threat coverage.
Threat coverage requires another compromise.
An over-flow of alerts dilutes critical alerts with low-priority alerts and useless
data, making triaging difficult.
The rule set needs constant attention and custom tuning to reduce alerts on
legitimate traffic.
100 / 137
Intrusion Detection Systems contd...
Inline devices physically sit between two network devices and have the ability to
block malicious activity.
However, legitimate traffic can also match signatures for malicious activity.
This often results in the sensor blocking legitimate traffic.
Another situation occurs when IDS devices go offline or are overwhelmed with
traffic.
If the device does not fail open in the event of system failure, it will block all
traffic at its network interface.
The inline device will also drop traffic if it exceeds its processing power.
101 / 137
Intrusion Detection Systems contd...
Despite the issues, IDSs are still beneficial to network security. Proper
consideration of the network environment is a must.
An appropriate operating environment can reduce issues that plague a sensor’s
ability to detect malicious activity.
Supplementing the environment with continuous updates and tuning of the
sensor’s rule set provides excellent coverage for a majority of malicious events.
IDS devices provide an invaluable stream of information to aid in security
investigations and improve overall network security.
IDS sensors improve security by detecting a network’s vulnerable areas and
inbound attacks.
In cases of inline sensors, IDS devices can greatly improve security by blocking
malicious activity before it performs malice.
102 / 137
Introduction to Port Scanners
103 / 137
Why Use Nmap?
104 / 137
Installing Nmap on Linux
105 / 137
Installing Nmap on Windows
106 / 137
Basic Nmap Commands
107 / 137
Advanced Nmap Options
108 / 137
Using Nmap for Network Security
109 / 137
Conclusion
110 / 137
References
111 / 137
Introduction to Intrusion Detection Systems (IDS)
IDS are security systems that monitor network traffic to detect malicious activity.
Intrusion Detection Systems can be classified as:
Network-based IDS (NIDS)
Host-based IDS (HIDS)
Snort is one of the most widely used open-source NIDS.
112 / 137
What is Snort?
113 / 137
Unique Features of Snort
114 / 137
Components of Snort
115 / 137
Installing Snort
116 / 137
Configuring Snort for Maximum Performance
117 / 137
Configuring Snort Rules for Maximum Performance
118 / 137
Snort Performance Tuning Best Practices
Disable Unused Features: Disable features like database logging if not required.
Use Inline Mode for Prevention: If Snort is being used as an IPS, configure it to
drop malicious traffic instead of logging it.
Increase Packet Buffer Size: Adjust the buffer size to accommodate larger traffic
volumes.
Regularly Update Rules: Keep Snort’s rules up-to-date to ensure detection of
new threats.
119 / 137
Monitoring Snort Performance
Use tools like top, htop, or snortstat to monitor Snort’s resource consumption.
Check for high CPU or memory usage and adjust configurations accordingly.
Regularly check Snort logs for performance issues or missed alerts.
120 / 137
Snort Output Options
Unified Output: Useful for logging in a format that is compatible with other
tools like Barnyard2.
Syslog Output: Send alerts to a centralized logging system.
Fast Output: Provides a compact and fast alert output suitable for
high-performance environments.
121 / 137
Conclusion
122 / 137
References
123 / 137
Analysis and Management Tools: Using Databases and Web Servers to
Manage Your Security Data - Introduction
124 / 137
Role of Databases in Security Management
125 / 137
Using MySQL/PostgreSQL for Security Data Management
126 / 137
NoSQL Databases in Security Management
127 / 137
Integrating Web Servers with Security Databases
Web servers (e.g., Apache, Nginx) can serve as an interface between security data
and users.
Web servers allow for:
Real-time querying and visualization of security data through web interfaces.
Access control and authentication to protect sensitive security information.
Integration with databases to display live data and alerts on web dashboards.
Example: Using a web interface to visualize security events stored in a database.
128 / 137
Building a Web Dashboard for Security Data
129 / 137
Key Technologies for Web Server Integration
Apache HTTP Server: Popular web server used to host security data
visualization applications.
Nginx: Lightweight, high-performance web server ideal for serving large amounts
of data.
Node.js: A JavaScript runtime to create back-end services and APIs for data
processing.
Flask/Django: Python web frameworks for connecting databases with web
interfaces.
130 / 137
Data Analysis Using SQL Queries
SQL allows for querying databases to perform advanced analysis on security data.
Example queries:
SELECT * FROM logs WHERE severity = ’high’; – Retrieves high-severity logs.
SELECT COUNT(*) FROM alerts WHERE timestamp > NOW() - INTERVAL 1 HOUR; –
Counts recent alerts.
SQL queries can be automated to trigger alerts or generate reports based on
specific criteria.
131 / 137
Automating Security Data Management
132 / 137
Visualizing Security Data with Web Servers
133 / 137
Security and Access Control for Web Servers
134 / 137
Challenges in Security Data Management
135 / 137
Conclusion
Databases and web servers are integral to managing and analyzing security data
effectively.
Properly integrating these tools allows for real-time monitoring, automated alerts,
and comprehensive analysis of security events.
Effective management and visualization of security data help organizations
respond quickly to security incidents.
136 / 137
References
137 / 137
Introduction to Forensic Tools
138 / 137
Preparing for a Good Forensic Investigation
139 / 137
Forensic Analysis Tools
Digital forensics tools are designed to recover and analyze evidence from digital
devices.
Common categories of forensic tools:
Disk Imaging Tools: Make bit-for-bit copies of hard drives.
File Carving Tools: Recover deleted or fragmented files from unallocated disk space.
Network Forensics Tools: Analyze network traffic to investigate suspicious activity.
Mobile Device Forensics Tools: Recover data from smartphones and tablets.
Example tools:
FTK Imager: Disk imaging and evidence collection tool.
EnCase: Comprehensive forensic analysis and reporting tool.
Wireshark: Network protocol analyzer for network forensics.
Cellebrite UFED: Tool for mobile device data extraction and analysis.
140 / 137
Making Copies of Forensic Data
When working with forensic data, it is essential to make an exact copy (image) of
the original data to avoid modifying the evidence.
The copy (or image) is used for analysis, while the original data is preserved as
evidence.
Types of Copies:
Bit-for-bit Copy: A 100
Logical Copy: A copy of selected data, such as files or directories, excluding deleted or
unallocated data.
Tools for making copies:
DD: A Linux tool that creates bit-for-bit copies of storage devices.
FTK Imager: A GUI-based tool for creating forensic images.
Clonezilla: A free software for disk imaging and cloning.
141 / 137
Forensic Data Integrity and Validation
To maintain data integrity, investigators must ensure that copies are exact
replicas of the original.
Use hashing algorithms (e.g., MD5, SHA-1, SHA-256) to generate checksums for
the original data and copies.
Verify that the hash values of the copied data match the original, ensuring no
alterations occurred during the copy process.
Example:
sha256sum original.img generates a SHA-256 checksum for the original data.
sha256sum copy.img generates a SHA-256 checksum for the copied data.
Compare the values to verify the copy’s integrity.
142 / 137
Creating and Logging into a Forensic Case
143 / 137
Documenting Forensic Evidence
144 / 137