~kris/dots

srice

ref: 9f828eb14bdd54d2c4fd8a3b2c90253021df3152 srice/doc/networking/monitoring/ids-ips.md -rw-r--r-- 3.6 KiB
9f828eb1 — Kris Yotam mksh: backslash-escape commands in history hook to bypass module aliases (wc=tokei, tr=transmission-remote, cat=bat) 2 months ago

#IDS/IPS and Network Monitoring

Multi-threaded, uses all cores. Supports DPI, protocol decoding, file extraction. IDS/IPS/NSM modes.

Snort is single-threaded, sequential packet checking, bottleneck on modern hardware.

Deployment: start in IDS mode, tune for a week, review alerts, then enable IPS incrementally.

Guide: https://homeprivacynetwork.com/blog/featured/deploying-open-source-ids-ips-suricata-snort-zeek-in-a-home-environment/

#Zeek (formerly Bro)

Event-driven network analysis. Multi-process with worker nodes. Produces structured logs (conn.log, dns.log, http.log, tls.log). Custom scripting language for detection.

Best practices:

  • ~200 Mbps per worker (Suricata or Zeek)
  • SSDs for log storage, sufficient RAM
  • Disable unnecessary logs
  • Ship to SIEM or data lake

References:

#Security Onion

Bundles Suricata + Zeek + Elastic Stack. Free open-source SIEM/IDS.

Hardware requirements:

  • CPU: ~200 Mbps per worker. 1 Gbps = 10 cores minimum
  • RAM: 16 GB min, 64 GB+ recommended with full PCAP
  • Storage: 1 TB+ for PCAP retention, SSDs for ES indices
  • NICs: minimum 2 (management + sniffing via TAP/SPAN)

Docs: https://docs.securityonion.net/en/2.4/introduction.html

#Arkime (Full Packet Capture)

Open-source large-scale PCAP, indexing, and database system.

#RITA (Beacon Detection)

Framework for detecting C2 via network traffic analysis. Works on Zeek logs.

Detects:

#JA3/JA4 TLS Fingerprinting

#JA3

Hashes TLS ClientHello fields. MD5 produces 32-char fingerprint. Now unstable because modern browsers randomize extension order.

#JA4 (next-gen)

Sorts extensions before hashing. Survives extension permutation. Designed by FoxIO.

Use: detect inconsistencies (User-Agent says Chrome but TLS fingerprint matches Python/OpenSSL).

#DNS Analytics for C2 Detection

#Flow Analysis (NetFlow, sFlow, IPFIX)

  • NetFlow: Cisco, maintains flow cache
  • sFlow: sampled packets, near real-time, no cache, more scalable
  • IPFIX: IETF standard, vendor-neutral, flexible templates

Tools: ntopng, nfdump/nfsen, GoFlow2, Elastiflow

Reference: https://networkthreatdetection.com/network-flow-analysis-netflow-sflow-ipfix/