Network Intrusion Detection and Analysis: Seoultech
Network Intrusion Detection and Analysis: Seoultech
Network Intrusion Detection and Analysis: Seoultech
Chapter 7
Network Intrusion Detection and Analysis
2015. 11. 3
(Daming Wu)
Email: wdm1517@gmail.com
7.7 Snort
7.8 Conclusion
2
7.1 Why Investigate NIDS/NIPS?
• NIDS/NIPS can be configured to alert on, or at least log traffic that firewalls
3
7.2 Typical NIDS/NIPS Functionality
malicious traffic.
4
7.2.1 Sniffing
detained.
Inline: Putting the NIDS/NIPS itself inline between two devices in a choke point
5
7.2.2 Higher-Layer Protocol Awareness
• Protocol Reassembly
Attackers intentionally fragment the attack traffic. NIDS to perform fragment
reassembly in order to be able to see and evaluate the target would receive and
process.
• Normalization
HTTP protocol allows for many different ways of encoding data.
• write a “signature” to detect each and every one of the various ways such
a string can be represented.
• normalize each string to its “canonical” form, and only then compare
them against the list of “known bad” things.
6
7.2.3 Alerting on Suspicious Bits
7
7.3 Modes of Detection
• Signature-Based Analysis:
This method compares headers, contents of packets, and streams of packets
against databases of known, malicious byte sequences in order to identify
suspicious traffic.
• Protocol Awareness:
Protocol-aware NIDS/NIPS reassemble fragments (Layer 3), reassemble streams
(Layer 4), and even reconstruct entire protocols (Layer 7) because they have to
understand how the endpoint of the communication will interpret the data.
• Behavioral Analysis:
The idea behind this approach is to spend time building a “baseline” of normal
network behavior against which to compare future behavior. “learns” what is
normal, in order to later detect aberrations.
8
7.4 Types of NIDS/NIPSs
• Commercial
• Check Point IPS-1
• Cisco IPS4
• Corero Network Security5
• Enterasys IPS6
• Roll-Your-Own
• It is both free for use under the GNU Public License (GPL)
• Supported by commercially funded research and development efforts.
9
7.5 NIDS/NIPS Evidence Acquisition
Types of Evidence
• Configuration
• NIDS/NIPS has not been configured to alert upon a particular event, then
the absence of alerts for event is meaningless.
• Alert data
• Evaluate network traffic based on a set of rules or learned patterns, identify
traffic of interest, and produce alerts.
• Packet header and/or flow record information
• Log packet header and/or flow record data. help identify the origin,
destination, and patterns of activity.
10
7.5 NIDS/NIPS Evidence Acquisition
Types of Evidence
• Packet payloads
• NIDS/NIPS capture full packet contents from packets that trigger alerts,
and subsequent packets.
• Activities correlated across multiple sensors
• Topologically and temporally correlated event data is exceptionally useful.
11
7.5.2 NIDS/NIPS Interfaces
12
7.6 Comprehensive Packet Logging
13
7.7 Snort
An overview of Snort:
• Most widely used NIDS
• Open-source code
• Open rule language
• Extremely versatile
• Actively improving, partly due to commercial support
14
7.7.1 Basic Architecture
15
7.7.2 Configuration
• /etc/snort/rules/: This directory contains the rules files themselves. Within each
• /var/log/snort/: This directory contains the native alerts file, where Snort
records text-based alerts, and the libpcap files with corresponding packet
captures.
16
7.7.3 Snort Rule Language
Rule Header
• Action: This field describes what the Snort sensor should do when a packet is
discovered to match the rule. Typical actions are alert, log, pass, and drop.
• Protocol: This field describes the protocol the packet must be employing to
match the rule. Possible values are icmp, tcp, udp, or the general case, ip.
• Source IP/network and port: These fields describe what the source of a packet
must be match.
• Directionality operator: This field allows the rule author to specify whether a
match one direction only (from source to destination) or bidirectionally. The
allowed values are “->” and “<>”.
• Destination IP/network and port: These fields describe what the destination of a
packet must match.
17
7.7.3 Snort Rule Language
Examples
18
7.7.3.2 Rule Body
• rev: The rule’s revision number. The combination of “sid” and “rev” define rules
uniquely.
URL.
19
7.7.3.2 Rule Body
options, etc.)
– TCP segment header (TCP flags and stateful flow inspection, sequence, and
20
7.7.3.2 Rule Body
– ASCII strings
– Binary sequences
– PCREs
• Layer 7-specific protocol data, such as HTTP URIs and SMTP commands
21
7.7.3.2 Rule Body
• Causing the alert and packet logging for the given rule to be handled in a
22
7.7.4 Examples
• Snort Rule
alert icmp $EXTERNAL_NET any -> $HOME_NET any (msg :" ICMP PING ";
icode :0; itype :8; classtype :misc - activity ; sid :384; rev :5;)
• Snort Packet
03:12:08.359790 IP 10.0.1.10 > 10.0.1.254: ICMP echo request , id 32335 ,
seq 0, length 64
• Snort Alert
[**] [1:384:5] ICMP PING [**]
[ Classification : Misc activity ] [ Priority : 3]
04/13 -03:12:08.359790 10.0.1.10 -> 10.0.1.254
ICMP TTL :64 TOS :0 x0 ID :38125 IpLen :20 DgmLen :84
Type :8 Code :0 ID :32335 Seq :1 ECHO
23
7.8 Conclusion
24
Thanks!
25