Detection does not prevent an attack. It tells you an attack is happening (or already happened) so you can respond. Pair detection tools with a solid incident response plan.
What is an Intrusion Detection System (IDS)?
An Intrusion Detection System (IDS) is a security technology that monitors network traffic or system activities for suspicious behavior or policy violations. When a potential intrusion is detected, the system generates alerts for security personnel to investigate. There are two main types:| Type | What it monitors | How it detects |
|---|---|---|
| Network IDS (NIDS) | Network traffic between hosts | Signature matching, anomaly detection |
| Host-based IDS (HIDS) | Activity on a single host (logs, file changes, processes) | Policy rules, file integrity checks |
Log Analysis
System and application logs are your most reliable source of truth after (or during) an incident. The following command-line tools help you search and parse them efficiently.grep — Search logs for patterns
grep finds lines matching a regular expression. It is your first tool for hunting through large log files.
Select-String in PowerShell.
tail — Watch logs in real time
awk — Extract and aggregate log fields
awk is ideal when you need to extract specific columns from structured log output (e.g., extracting just the source IP addresses from a log).
Network Sniffing
Network sniffers capture packets traversing an interface, letting you see exactly what traffic is flowing — useful for detecting exfiltration, unusual connections, or malware C2 communication.tcpdump — Command-line packet capture
Wireshark — GUI packet analyzer
Wireshark provides a graphical interface for capturing and dissecting packets. You can open.pcap files produced by tcpdump for detailed analysis.
Key Wireshark features for detection:
- Follow TCP Stream — reassemble a full conversation between two hosts
- Display filters — e.g.,
http.request.method == "POST"to find form submissions - Statistics → Conversations — identify hosts generating unusually high traffic volume
File Integrity Monitoring
File Integrity Monitoring (FIM) detects unauthorized changes to critical system files — a key indicator of compromise.Putting it together: a simple monitoring workflow
Establish a baseline
Record normal behavior — typical login times, expected outbound connections, baseline file checksums — so anomalies stand out.
Deploy log collection
Ensure system, application, and network device logs are all flowing to a central location (a SIEM or log aggregator). Use
rsyslog or similar to forward logs.Set up real-time alerts
Configure your IDS or SIEM to alert on high-confidence indicators: repeated auth failures, unexpected outbound connections, SUID file creation.
Review alerts promptly
An alert that nobody reads is the same as no alert. Assign ownership and response SLAs to your alert categories.
Preserve evidence
When investigating, work on copies. Use
dd to image disks and save raw .pcap files before you start analysis. See Incident Response for details.