AI Smart Firewall is a Python-based network security tool that captures and analyzes live network traffic to detect suspicious activity such as port scanning attacks. The system automatically blocks malicious IP addresses and provides a graphical dashboard to monitor network activity in real time.
This project demonstrates the basic working principles of network firewalls, intrusion detection systems, and packet monitoring tools.
Live packet capture and monitoring
Automatic port scan detection
Automatic attacker IP blocking
Geo-location detection of IP addresses
Color-coded traffic logs
Real-time network activity dashboard
Packet statistics tracking
CSV export of complete packet logs
Automatic opening of exported reports
Python
Scapy – Packet capture and network analysis
Tkinter – Graphical user interface
Requests – API calls for IP geo-location
CSV – Packet logging and report generation
Windows Firewall (netsh) – Blocking attacker IPs
1 Clone the Repository git clone https://github.com/AayushDarpe/Smart-Firewall.git cd Smart-Firewall
2 Install Required Libraries pip install scapy requests
3 Run the Application python firewall.py
⚠ Run the program with Administrator privileges to allow packet capture and firewall rule creation.
The application captures live packets from the selected network interface.
Each packet is inspected to extract important information such as source IP, destination IP, protocol, and port.
The firewall checks the packet against predefined security rules.
If a port scanning attack is detected, the system automatically blocks the attacker IP.
The dashboard logs all packet activity and security alerts.
Users can export the packet logs as a CSV report for further analysis.