How adityak-101/network-intrusion-detection-system works
This is a deterministic, real-time host intrusion detection system. Its main workflow captures IPv4 TCP/UDP packets, normalizes them, builds bidirectional flows and metrics, applies three detection layers, fuses their evidence into an explainable verdict, then presents and audits the result. The README documents the end-to-end flow; sampled source confirms packet conversion, flow construction, engine behavior, and dashboard handling. Simulation modules are included as a supporting capability. Some wiring is documented rather than visible in the excerpts.
Main entry points: run_demo.py Demo runner · main.py Runtime orchestration · app.py Live dashboard · packet_capture.py Packet capture
Components 23
Traffic capture
- Packet capture
capture/packet_capture.py - Packet normalization
capture/packet_info.py - DNS enrichment
capture/domain_enrichment.py - Flow construction
capture/flow_builder.py
Detection and fusion
- Rules engine
detection/level1_rules.py - Behavior engine
detection/behavior_engine.py - Correlation engine
detection/correlation_engine.py - Runtime orchestration
main.py - Verdict fusion
main.py
Presentation and audit
- Live dashboard
dashboard/app.py - Live flow table
dashboard/templates/index.html - Flow detail view
dashboard/templates/detail.html - CSV audit log
dashboard/app.py
Attack simulations
- Demo runner
simulation/run_demo.py - Brute-force scenario
simulation/brute_force.py - DoS scenario
simulation/dos_attack.py - Fusion showcase
simulation/fusion_showcase.py - Ping-sweep scenario
simulation/ping_sweep.py - Port-scan scenario
simulation/port_scan.py - Slowloris scenario
simulation/slowloris.py - SSH spray scenario
simulation/ssh_credential_spray_lowrate.py
Other components
- IDS operator
- Live network
Connections 22
- Live network → Packet capture: supplies traffic
README.md - Packet capture → Packet normalization: normalizes packets
capture/packet_capture.py - Packet capture → DNS enrichment: observes DNS
capture/packet_capture.py - Packet capture → Flow construction: hands off packets
README.md - Flow construction → Packet normalization: consumes packets
capture/flow_builder.py - Flow construction → Runtime orchestration: completes flows
README.md - Runtime orchestration → Rules engine: runs rules
README.md - Runtime orchestration → Behavior engine: runs behavior
README.md - Runtime orchestration → Correlation engine: runs correlation
README.md - Runtime orchestration → Verdict fusion: computes verdict
main.py - Runtime orchestration → Live dashboard: streams results
README.md - Live dashboard → Live flow table: renders table
README.md - Live dashboard → Flow detail view: renders details
README.md - Live dashboard → CSV audit log: writes records
dashboard/app.py - IDS operator → Live dashboard: reviews results
README.md - Demo runner → Brute-force scenario: launches scenario
simulation/run_demo.py - Demo runner → DoS scenario: launches scenario
simulation/run_demo.py - Demo runner → Fusion showcase: launches scenario
simulation/run_demo.py - Demo runner → Ping-sweep scenario: launches scenario
simulation/run_demo.py - Demo runner → Port-scan scenario: launches scenario
simulation/run_demo.py - Demo runner → Slowloris scenario: launches scenario
simulation/run_demo.py - Demo runner → SSH spray scenario: launches scenario
simulation/run_demo.py