Skip to content

Siong23/iot-digital-twin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

IoT Digital Twin Security Testbed

Python GNS3 TensorFlow Jupyter License

A comprehensive security testbed for IoT networks using GNS3 virtualization platform. This project provides a controlled environment for researching IoT vulnerabilities, testing security mechanisms, and understanding digital twin concepts in cybersecurity education.

🎯 Overview

This testbed simulates real-world IoT environments with digital twin capabilities, allowing security researchers and students to:

  • Study IoT Vulnerabilities: Test common IoT device security flaws in a safe environment
  • Analyze Network Traffic: Monitor MQTT and other IoT protocol communications
  • Security Assessment: Perform penetration testing on virtualized IoT devices
  • AI-Powered Threat Detection: Use TSM-NIDS for intelligent intrusion detection
  • Attack Classification: Identify specific types of IoT attacks using machine learning
  • Digital Twin Analysis: Analyze real-world IoT data for security insights
  • Educational Research: Learn about IoT security without risk to production systems

πŸ—οΈ Architecture

The testbed consists of several key components:

β”œβ”€β”€ AttackThreat/              # Security testing framework
β”‚   β”œβ”€β”€ brute-force_cycle/     # Brute force attack modules
β”‚   β”œβ”€β”€ ddos_cycle/            # DDoS attack simulation
β”‚   β”œβ”€β”€ cameradarexploit.sh    # Cameradar RTSP attack wrapper
β”‚   β”œβ”€β”€ credentials.txt        # Common IoT default credentials
β”‚   β”œβ”€β”€ exploit.py             # Automated vulnerability scanning
β”‚   β”œβ”€β”€ exploit_interactive.py # Interactive security testing
β”‚   β”œβ”€β”€ exploit_interactive_backup.py # Interactive security testing backup
β”‚   └── requirements.txt       # Python dependencies
β”œβ”€β”€ Collected Data/            # Dataset storage and management
β”œβ”€β”€ GenAI/                     # Generative AI for generating realistic iot traffic
β”‚   β”œβ”€β”€ Model/                 # Model to generate traffic
β”‚   β”œβ”€β”€ data_preparation/      # preparation of dataset before training
β”œβ”€β”€ IoTDevice/                 # IoT Device Scenarios
β”‚   β”œβ”€β”€ MQTTCaptureData/       # MQTT data capture modules
β”‚   β”œβ”€β”€ MQTTScenarios/         # MQTT broker and data management
β”‚   └── RTSPCaptureData/       # RTSP stream capture modules
β”œβ”€β”€ TSM-NIDS/                  # TSM-NIDS: AI-powered intrusion detection
β”‚   β”œβ”€β”€ AttackClassification/  # Multi-class attack type classification
β”‚   β”œβ”€β”€ AttackIdentification/  # Binary attack detection
β”‚   └── IoTDigitalTwin/        # Real-world IoT data analysis
β”œβ”€β”€ TwinningAgent/             # Twinning agent for digital-physical sync
β”‚   β”œβ”€β”€ config/                # Configuration sync code
β”‚   β”œβ”€β”€ dashboard/             # Digital & physical dashboard code
β”‚   └── data/                  # Dataflow management modules
β”‚   └── status/                # Status synchronization modules
β”‚   └── Documentation.docx     # Digital twin documentation
└── README.md                  # This documentation

πŸš€ Quick Start

Prerequisites

Operating System: Ubuntu 22.04.4 LTS (recommended)

Required Dependencies:

  • KVM virtualization support
  • GNS3 network simulator
  • Python 3.8+ with python3-venv
  • Docker
  • Standard Linux utilities (make, wget, konsole)
  • Jupyter Notebook (for TSM-NIDS analysis)
  • TensorFlow/PyTorch (for machine learning models)

Installation

  1. Clone the repository:

    git clone https://github.com/Siong23/iot-digital-twin.git
    cd iot-digital-twin
  2. Install Python dependencies:

    cd AttackThreat
    pip install -r requirements.txt
  3. Set up TSM-NIDS environment (for AI-powered intrusion detection):

    cd TSMixer
    # Install additional ML dependencies as needed for specific modules
    pip install tensorflow jupyter pandas numpy scikit-learn
  4. Set up GNS3 environment with the required appliances (see Dependencies)

Basic Usage

  1. Start the MQTT broker:

    cd IoTDevice/MQTTScenarios
    python3 mqttbroker.py
  2. Run security assessments:

    cd AttackThreat
    python3 exploit.py  # Automated scanning
    # or
    python3 exploit_interactive.py  # Interactive mode
  3. Use TSM-NIDS for intrusion detection:

    cd TSMixer/AttackClassification
    jupyter notebook tsmixermulti-tonprocess_base_s.ipynb
    # or explore other TSM-NIDS modules

πŸ“‹ Dependencies

GNS3 Appliances

  • Cisco 7200 Router - Network routing simulation
  • Kali Linux - Security testing platform
  • Fixed Open vSwitch - Virtual switching
  • Ubuntu Server - IoT device simulation
  • Ubuntu Guest Additions - Enhanced VM functionality
  • TightVNC - Remote access capabilities

System Requirements

  • Virtualization: KVM support enabled
  • RAM: Minimum 8GB (16GB recommended for ML workloads)
  • Storage: 50GB+ available space (additional space for datasets)
  • Network: Internet connection for appliance downloads
  • GPU: Optional but recommended for TSM-NIDS training (CUDA-compatible)

πŸ”§ Configuration

MQTT Broker Setup

Configure secure MQTT communication using client certificates. Follow the detailed MQTT setup guide.

Network Topology

Design your GNS3 topology to include:

  • IoT devices (simulated using lightweight VMs)
  • Network infrastructure (routers, switches)
  • Security monitoring tools (Kali Linux)
  • MQTT broker services

TSM-NIDS Configuration

The TSMixer-based Network Intrusion Detection System provides:

  • Attack Classification: Multi-class classification of IoT attack types
  • Attack Identification: Binary detection of malicious network traffic
  • Digital Twin Analysis: Real-world IoT data processing and analysis

Configure TSM-NIDS by:

  1. Selecting appropriate preprocessing methods (MinMaxScaler, RobustScaler, StandardScaler)
  2. Choosing feature selection techniques (correlation analysis, mutual information)
  3. Applying data augmentation methods (SMOTE) if needed
  4. Configuring model parameters in the respective Jupyter notebooks

πŸ“Š Datasets and Research

Supported Datasets

  • TON-IoT Dataset: Comprehensive IoT network traffic dataset for training and evaluation
  • Real-world IoT Data: Captured data from actual IoT devices in controlled environments
  • Custom Dataset Collection: Tools for capturing and analyzing your own IoT network data

Research Applications

  • Intrusion Detection Systems: Evaluate TSMixer effectiveness for IoT security
  • Attack Pattern Analysis: Study temporal patterns in IoT attack sequences
  • Feature Engineering: Explore optimal feature sets for IoT security classification
  • Model Comparison: Compare different scaling and preprocessing approaches
  • Threat Intelligence: Generate insights from real-world IoT attack data

⚠️ Security Notice

⚠️ IMPORTANT: This testbed is designed exclusively for educational and research purposes in controlled environments. Only use these tools on systems you own or have explicit permission to test. Unauthorized use of security testing tools is illegal and unethical.

πŸŽ“ Educational Use Cases

  • Cybersecurity Courses: Hands-on IoT security training
  • Research Projects: IoT vulnerability analysis and threat modeling
  • Security Workshops: Practical penetration testing and defense
  • Digital Twin Concepts: Understanding IoT system modeling and simulation
  • AI Security: Machine learning applications in cybersecurity
  • Network Intrusion Detection: Time series analysis for threat detection
  • Data Science: Feature engineering and model evaluation for security datasets

πŸ“š Documentation

For detailed setup instructions and advanced usage, refer to:

Key Features by Component

Agent Module

  • MQTT broker management and secure communication
  • IoT device simulation and data collection
  • RTSP stream capture for video IoT devices
  • Telemetry control and monitoring

AttackThreat Module

  • Automated vulnerability scanning
  • Interactive penetration testing
  • Brute force attack simulation
  • DDoS attack coordination
  • Credential testing against IoT devices

TSM-NIDS Module

  • Time series neural network intrusion detection
  • Multi-class attack classification (DoS, DDoS, backdoor, injection, etc.)
  • Binary attack identification
  • Feature importance analysis and visualization
  • Support for multiple preprocessing techniques
  • Real-world IoT dataset analysis

🀝 Contributing

Contributions are welcome! Please read our contributing guidelines and submit pull requests for improvements.

πŸ“„ License

This project is intended for educational and research purposes. Please ensure compliance with your institution's policies and applicable laws when using this testbed.

πŸ“§ Contact

For questions or collaboration opportunities, please open an issue or contact the repository maintainer.


Repository: https://github.com/Siong23/iot-digital-twin

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages