Intrusion Detection and Malware Analysis: Signature-Based IDS
Intrusion Detection and Malware Analysis: Signature-Based IDS
Intrusion Detection and Malware Analysis: Signature-Based IDS
Signature-based IDS
Pavel Laskov
Wilhelm Schickard Institute for Computer Science
Misuse detection systems
Snort architecture
3. Next, it sorts the coins according to the coin type.This is for storage of quarters, nickels,
dimes, and pennies (on the IDS this is the detection engine).
4. Finally, it is the administrators task to decide what to do with the coinsusually youll roll
them and store them (logging and database storage).
The preprocessor, the detection engine, and the alert components of Snort are all plug-ins. Plug-
ins are programs that are written to conform to Snorts plug-in API.These programs used to be part
Packet sniffer interacts directly with a network card using
of the core Snort code, but they were separated to make modifications to the core source code more
reliable and easier to accomplish.
libpcap.
Packet Sniffer detection and alert components are
Preprocessing,
A packet sniffer is a device (either hardware or software) used to tap into networks. It works in a sim-
implemented as plugins.
ilar fashion to a telephone wiretap, but its used for data networks instead of voice networks. A net-
work sniffer allows an application or a hardware device to eavesdrop on data network traffic. In the
Various front-ends are available for logging (DB, Prelude
case of the Internet, this usually consists of IP traffic, but in local LANs and legacy networks, it can
be other protocol suites, such as IPX and AppleTalk traffic.
meta-IDS, GUI).
Because IP traffic consists of many different higher-level protocols (including TCP, UDP, ICMP,
routing protocols, and IPSec), many sniffers analyze the various network protocols to interpret the
packets into something human-readable.
Packet sniffers have various uses:
Snort sniffer
Introducing Snort
Preprocessor functions:
Packets
Stream reassembly (stream4)
Packet defragmentation (frag2)
HHTP Encoding Plug-in
Protocol decoding/normalization
(HTTP, RPC, telnet)
Port Scanning Plug-in
Alternative (non-rule) detection
modes (portscan, arpspoof)
Earlier in this chapter, we described Snort as a signature-based IDS.The signature-ba
function is accomplished by using various rulesets.The rulesets are grouped by category (
horses, buffer overflows, access to various applications) and are updated regularly.
The rules themselves consist of two parts:
The rule header The rule header is basically the action to take (log or alert)
network packet (TCP, UDP, ICMP, and so forth), source and destination IP add
ports
The rule option The option is the content in the packet that should make th
match the rule.
The detection engine and its rules are the largest portion (and steepest learning curv
information to learn and understand with Snort. Snort has a particular syntax that it uses
rules. Rule syntax can involve the type of protocol, the content, the length, the header, an
ious elements, including garbage characters for defining butter overflow rules.
Snort detection engine
441_HTC_OS_04.qxd 4/12/07 9:45 AM Page 192
Alerting/Logging Component
After the Snort data goes through the detection engine, it needs to go out somewh
matches a rule in the detection engine, an alert is triggered. Alerts can be sent to a
network connection, through UNIX sockets or Windows Popup (SMB), or SNMP
can also be stored in an SQL database such as MySQL and Postgres.
You can also use additional tools with Snort, including various plug-ins for Pe
servers to display the logs through a Web interface. Logs are stored in either text fi
/var/log/snort) or in a database such as MySQL and Postgres.
Like the detection engine and the preprocessor, the alert component uses plug
Snort rules
Informational options
sid (Snort ID), priority, ref (reference, usually to CVEs)
Advanced payload options
byte_jump, byte_test, distance, within, depth, offset, nocase,
rawbytes, uricontent
Protocol analysis options
Keywords for IP, TCP, ICMP protocols
Stateful rules
flowbits, threshold, flow
Regular expressions
use with care: expensive!
Snort rule examples