Skip to content

Repository files navigation

🦅 NetHawk - AI-Powered Network Security System

NetHawk Logo

Intelligent Network Intrusion Detection and Prevention System

React TypeScript Tailwind CSS Vite

🚀 Live Demo📖 Documentation🛠️ Installation🤝 Contributing


🎯 Overview

NetHawk is a sophisticated web-based simulation of a Network Intrusion Detection and Prevention System (NIDPS) that demonstrates real-time network security monitoring, AI-powered threat detection, and automated response mechanisms. Built with modern web technologies, it provides an interactive cybersecurity dashboard perfect for educational purposes, proof-of-concept demonstrations, and portfolio showcases.

🌟 Key Highlights

  • Real-time Network Monitoring with live packet analysis
  • AI-Powered Threat Detection using machine learning algorithms
  • Automated IP Blocking with intelligent response systems
  • Professional SOC Dashboard with comprehensive analytics
  • Advanced Threat Intelligence with pattern recognition
  • Comprehensive Logging and forensic capabilities


✨ Features

🛡️ Core Security Features

Feature Description Status
Real-time Packet Monitoring Live network traffic analysis with protocol detection ✅ Active
AI Threat Detection Machine learning-based intrusion classification ✅ Active
Automated IP Blocking Instant response to malicious activity ✅ Active
Threat Intelligence Advanced pattern recognition and attack classification ✅ Active
Auto-Unblock System Time-based automatic IP unblocking ✅ Active
Whitelist Protection Critical IP protection mechanisms ✅ Active

📊 Dashboard Components

🏠 Main Dashboard

  • Real-time network statistics
  • Threat detection metrics
  • System health monitoring
  • Recent activity timeline

👁️ Packet Monitor

  • Live traffic visualization
  • Protocol-based filtering
  • Packet size analysis
  • Export capabilities (CSV)

⚠️ Threat Analysis

  • Attack pattern recognition
  • Severity classification (High/Medium/Low)
  • Source IP analysis
  • Attack type distribution

🚫 Blocked IPs Management

  • Active blocks monitoring
  • Auto-unblock countdown
  • Manual unblock controls
  • Block reason tracking

📋 System Logs

  • Comprehensive event logging
  • Packet-level forensics
  • Severity-based filtering
  • Export functionality

🧠 ML Model Training

  • Model performance metrics
  • Feature importance analysis
  • Training history
  • Accuracy monitoring

🎨 User Interface Features

  • Dark Theme: Optimized for SOC environments
  • Responsive Design: Works on desktop, tablet, and mobile
  • Real-time Updates: Live data streaming and updates
  • Interactive Charts: Dynamic visualizations and analytics
  • Professional Aesthetics: Enterprise-grade security dashboard design

🛠️ Tech Stack

Frontend Framework

  • React 18.3.1 - Modern component-based UI library
  • TypeScript 5.5.3 - Type-safe JavaScript development
  • Vite 5.4.2 - Fast build tool and development server

Styling & UI

  • Tailwind CSS 3.4.1 - Utility-first CSS framework
  • Lucide React 0.344.0 - Beautiful, customizable icons
  • PostCSS 8.4.35 - CSS processing and optimization

Development Tools

  • ESLint 9.9.1 - Code linting and quality assurance
  • TypeScript ESLint 8.3.0 - TypeScript-specific linting rules
  • Autoprefixer 10.4.18 - CSS vendor prefixing

Architecture

  • Component-based Architecture - Modular, reusable components
  • TypeScript Interfaces - Strong typing for data models
  • Real-time State Management - Live data updates and synchronization
  • Mock Data Generation - Sophisticated network traffic simulation

🏗️ Project Structure

nethawk/
├── 📁 src/
│   ├── 📁 components/          # React components
│   │   ├── Dashboard.tsx       # Main dashboard component
│   │   ├── PacketMonitor.tsx   # Live packet monitoring
│   │   ├── ThreatAnalysis.tsx  # Threat detection analysis
│   │   ├── BlockedIPs.tsx      # IP blocking management
│   │   ├── SystemLogs.tsx      # Logging and forensics
│   │   └── ModelTraining.tsx   # ML model interface
│   ├── 📁 types/              # TypeScript type definitions
│   │   └── nidps.ts           # Core data models
│   ├── 📁 utils/              # Utility functions
│   │   └── mockData.ts        # Network simulation logic
│   ├── App.tsx                # Main application component
│   ├── main.tsx               # Application entry point
│   └── index.css              # Global styles
├── 📁 public/                 # Static assets
├── 📄 package.json            # Dependencies and scripts
├── 📄 tailwind.config.js      # Tailwind CSS configuration
├── 📄 tsconfig.json           # TypeScript configuration
├── 📄 vite.config.ts          # Vite build configuration
└── 📄 README.md               # Project documentation

🚀 Installation

Prerequisites

  • Node.js (v18.0.0 or higher)
  • npm or yarn package manager
  • Modern web browser (Chrome, Firefox, Safari, Edge)

Quick Start

  1. Clone the repository

    git clone https://github.com/yourusername/nethawk.git
    cd nethawk
  2. Install dependencies

    npm install
    # or
    yarn install
  3. Start development server

    npm run dev
    # or
    yarn dev
  4. Open in browser

    http://localhost:5173
    

Build for Production

# Build optimized production bundle
npm run build

# Preview production build
npm run preview

🎮 Usage Guide

Getting Started

  1. Launch NetHawk - Open the application in your browser
  2. Monitor Dashboard - View real-time network statistics
  3. Explore Tabs - Navigate through different monitoring sections
  4. Control Monitoring - Use start/stop controls for packet capture
  5. Analyze Threats - Review detected threats and blocked IPs

Dashboard Navigation

Tab Purpose Key Features
🏠 Dashboard Overview and statistics Real-time metrics, recent activity
👁️ Packet Monitor Live traffic analysis Filtering, search, export
⚠️ Threat Analysis Security insights Attack patterns, severity levels
🚫 Blocked IPs IP management Block status, auto-unblock timers
📋 System Logs Event logging Comprehensive audit trail
🧠 ML Training Model management Performance metrics, training

Key Controls

  • Start/Stop Monitoring: Control packet capture simulation
  • Clear Logs: Reset all monitoring data
  • Export Data: Download logs and packet data as CSV
  • Filter Options: Customize data views and analysis
  • Manual Unblock: Override automatic IP blocking

🧠 Machine Learning Simulation

Detection Algorithm

NetHawk simulates sophisticated ML-based threat detection using:

  • Random Forest Classification - Ensemble learning for accurate predictions
  • Feature Engineering - Multi-dimensional packet analysis
  • Confidence Scoring - Probabilistic threat assessment
  • Pattern Recognition - Advanced attack signature detection

Threat Categories

Attack Type Description Severity
Port Scan Network reconnaissance attempts Medium
DDoS Attack Distributed denial of service High
Brute Force Authentication attacks High
Botnet Communication Command & control traffic High
Data Exfiltration Unauthorized data transfer High
SQL Injection Database attack attempts Medium
Network Reconnaissance Information gathering Low

Feature Analysis

  • Source/Destination IPs - Geographic and reputation analysis
  • Port Numbers - Service identification and anomaly detection
  • Packet Sizes - Statistical analysis for anomalies
  • Protocol Types - TCP/UDP/ICMP behavior analysis
  • TTL Values - OS fingerprinting and spoofing detection
  • Timing Patterns - Traffic flow analysis

🔧 Configuration

Environment Variables

Create a .env file in the root directory:

# Application Configuration
VITE_APP_NAME=NetHawk
VITE_APP_VERSION=1.0.0

# Simulation Settings
VITE_PACKET_RATE=1000
VITE_THREAT_RATE=0.12
VITE_AUTO_UNBLOCK_TIME=600000

# Dashboard Settings
VITE_REFRESH_INTERVAL=1000
VITE_MAX_PACKETS_DISPLAY=1000

Customization Options

  • Threat Detection Sensitivity - Adjust ML confidence thresholds
  • Traffic Simulation Rate - Control packet generation frequency
  • Auto-unblock Timing - Configure automatic IP release
  • Dashboard Refresh Rate - Set real-time update intervals
  • Color Themes - Customize dashboard appearance

🧪 Testing

Run Tests

# Run all tests
npm run test

# Run tests in watch mode
npm run test:watch

# Generate coverage report
npm run test:coverage

Test Coverage

  • Component Testing - React component functionality
  • Utility Testing - Mock data generation and algorithms
  • Integration Testing - Component interaction and data flow
  • Performance Testing - Real-time update efficiency

🚀 Deployment

Netlify Deployment

  1. Build the project

    npm run build
  2. Deploy to Netlify

    # Install Netlify CLI
    npm install -g netlify-cli
    
    # Deploy
    netlify deploy --prod --dir=dist

Vercel Deployment

  1. Install Vercel CLI

    npm install -g vercel
  2. Deploy

    vercel --prod

Docker Deployment

FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "run", "preview"]

🤝 Contributing

We welcome contributions to NetHawk! Here's how you can help:

Development Setup

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Make your changes
  4. Run tests
    npm run test
    npm run lint
  5. Commit your changes
    git commit -m 'Add amazing feature'
  6. Push to the branch
    git push origin feature/amazing-feature
  7. Open a Pull Request

Contribution Guidelines

  • Code Style: Follow TypeScript and React best practices
  • Testing: Add tests for new features
  • Documentation: Update README and code comments
  • Commits: Use conventional commit messages
  • Issues: Use issue templates for bug reports and feature requests

Areas for Contribution

  • 🎨 UI/UX Improvements - Enhanced dashboard design
  • 🧠 ML Algorithms - Advanced threat detection logic
  • 📊 Data Visualization - New charts and analytics
  • 🔧 Performance - Optimization and efficiency improvements
  • 📚 Documentation - Tutorials and guides
  • 🧪 Testing - Increased test coverage

📚 Documentation

Additional Resources

Real Implementation Guide

For building a production NIDPS with actual packet capture:


📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License

Copyright (c) 2024 NetHawk Project

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

🙏 Acknowledgments

Inspiration & References

  • Network Security Research - Academic papers on intrusion detection
  • Open Source NIDS - Snort, Suricata, and Zeek projects
  • Machine Learning - Scikit-learn and cybersecurity ML research
  • UI/UX Design - Modern SOC dashboard designs and cybersecurity tools

Technologies & Libraries

  • React Team - For the amazing React framework
  • Tailwind CSS - For the utility-first CSS framework
  • Lucide - For beautiful, consistent icons
  • Vite - For fast development and building
  • TypeScript - For type-safe development

📞 Support & Contact

Get Help

Project Maintainers


📊 Project Stats

GitHub stars GitHub forks GitHub issues GitHub pull requests GitHub last commit GitHub repo size


⭐ Star this repository if you find it helpful!

🦅 NetHawk - Protecting Networks with AI-Powered Intelligence

Made with ❤️ by the NetHawk Team

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages