Skip to content

A Python-based Intrusion Detection System (IDS) using Scapy to monitor network traffic for suspicious activity and potential threats. Detect anomalies, block malicious IPs, and log security incidents. πŸ›‘οΈ

Notifications You must be signed in to change notification settings

LakshayD02/Intrusion_Detection_System_Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Intrusion Detection System (IDS) Using Python and Scapy 🚨

Description

This Intrusion Detection System (IDS) monitors network traffic in real-time to identify suspicious activities and potential threats. It uses the Scapy library to capture and analyze network packets, looking for abnormal patterns such as unusually large packets or repetitive requests. Upon detecting anomalies, the IDS can take automated preventive actions, such as blocking suspicious IP addresses using Windows Firewall commands. All detected threats and system events are logged for further analysis and review.

Features

  • Real-time Packet Monitoring: Captures and analyzes network packets in real-time using Scapy. πŸ“‘

  • Statistical Analysis: Tracks packet sizes and counts to identify unusual traffic patterns. πŸ“Š

  • Anomaly Detection:

    • Large Packet Detection: Flags packets larger than 1500 bytes as potentially malicious. πŸ“¦
    • Repetitive Traffic Detection: Detects repetitive packet sizes (more than 100 times) that may indicate a flood attack. πŸ”„
  • Automated Response: Blocks offending IP addresses using Windows Firewall commands (requires admin privileges). 🚫

  • Logging: Logs all detected threats, including timestamps and anomaly details, to ids_logs.log. πŸ“

  • Alerting (Potential): While not explicitly mentioned, the logging feature facilitates the implementation of alerts (e.g., email notifications) based on log entries. πŸ””

Technologies Used

  • Python: The core programming language for the IDS. 🐍

  • Scapy: A powerful Python library for network packet manipulation and analysis. πŸ“‘

  • Windows Firewall: Used for blocking IP addresses (Windows-specific). 🧱

Ideal For

  • Network Security Professionals: Monitoring network traffic for security threats. πŸ§‘β€πŸ’»

  • Security Researchers: Studying network attacks and developing intrusion detection techniques. πŸ•΅οΈβ€β™€οΈ

  • Python Developers: Learning about network programming, packet analysis, and security concepts. πŸ§‘β€πŸŽ“

How to Run

  1. Clone the repository: git clone <repo url>

  2. Install required libraries: pip install scapy

  3. Run the program (with administrator privileges): python ids.py (or python3 ids.py)

About

A Python-based Intrusion Detection System (IDS) using Scapy to monitor network traffic for suspicious activity and potential threats. Detect anomalies, block malicious IPs, and log security incidents. πŸ›‘οΈ

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages