Skip to content

Essamara/deadnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

#!/usr/bin/env python3
"""
AI Network Protection System - Installation and Usage Guide

This document provides instructions for installing, configuring, and using the AI Network Protection System.
"""

# Installation Requirements

The AI Network Protection System requires the following dependencies:

1. Python 3.8 or higher
2. Required Python packages:
   - scapy (for packet capture and analysis)
   - scikit-learn (for machine learning-based anomaly detection)
   - pandas (for data manipulation)
   - numpy (for numerical operations)
   - matplotlib (for visualization)
   - tensorflow (optional, for deep learning features)

# Installation Instructions

1. Install the required packages:

```bash
sudo pip3 install scapy scikit-learn pandas numpy matplotlib
```

2. For enhanced detection capabilities with deep learning (optional):

```bash
sudo pip3 install tensorflow
```

# Usage Instructions

The script must be run with root privileges to capture network packets:

```bash
sudo python3 ai_network_monitor.py
```

## Command Line Options

- `-i, --interface`: Specify the network interface to monitor (default: auto-detect)
- `-t, --training`: Set the initial training period in seconds (default: 300)
- `-m, --model`: Path to save/load the trained model (default: network_model.pkl)
- `-v, --verbose`: Enable verbose logging

Example with custom settings:

```bash
sudo python3 ai_network_monitor.py -i eth0 -t 600 -v
```

# Features

## 1. Real-time Network Monitoring
The system captures and analyzes network packets in real-time, building a profile of normal network behavior.

## 2. Machine Learning-based Anomaly Detection
Using Isolation Forest algorithm, the system identifies traffic patterns that deviate from the norm.

## 3. Deep Learning Enhancement (if TensorFlow is installed)
An autoencoder neural network provides additional anomaly detection capabilities.

## 4. Threat Intelligence Integration
The system checks traffic against known malicious IP addresses.

## 5. Visualization
If run in an interactive terminal, the system provides real-time visualization of network traffic and detected anomalies.

## 6. Alerting and Response
The system logs alerts for detected anomalies and can be configured to take automated protective actions.

# Understanding the Output

The system generates several types of output:

1. Console logs showing system status and alerts
2. A log file (network_protection.log) with detailed information
3. Real-time visualization (if run in an interactive terminal)
4. Alerts for detected anomalies

# Customization

You can customize the system by modifying the following parameters in the script:

- `detection_threshold`: Threshold for anomaly detection (0-1)
- `alert_threshold`: Threshold for generating alerts (0-1)
- `max_history`: Maximum number of packets to keep in history

# Limitations

1. The system requires root privileges to capture packets
2. Initial training period is needed before effective anomaly detection
3. False positives may occur, especially during the early usage period
4. The system focuses on network-level anomalies and may not detect all types of attacks

# Troubleshooting

1. If you encounter permission errors, ensure you're running the script with sudo
2. If visualization doesn't appear, ensure you're running in an interactive terminal
3. For performance issues, consider reducing the packet history size

# Security Considerations

1. The script itself requires root privileges, so ensure it's stored in a secure location
2. The model file contains learned patterns of your network traffic and should be protected
3. Consider the privacy implications of packet capture in your environment

# Extending the System

The AI Network Protection System can be extended in several ways:

1. Add custom detection rules
2. Integrate with SIEM systems
3. Implement automated response actions
4. Add support for encrypted traffic analysis
5. Enhance the visualization capabilities

About

A intrusion detection isolation forest model script

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages