affan80/IOT_Scanner

The IoT Nmap Scanner is a full-stack network security tool that allows users to scan and monitor devices on their local network through an intuitive web interface. It combines a Flask backend (for handling Nmap scans) with a Next.js frontend (for a modern user experience).

★ 0Forks 0PythonGitHub ↗Compare

Project website ↗

README

IoT Scanner using Nmap

A comprehensive IoT device discovery and security analysis tool built with Python (Flask) and React.js.

Features

  • Network Range Scanning: Scan entire network ranges for IoT devices
  • Single Device Analysis: Deep scan individual IP addresses
  • IoT Device Detection: Identifies common IoT devices (Raspberry Pi, Arduino, ESP8266/ESP32, etc.)
  • Vulnerability Assessment: Checks for common IoT security issues
  • Service Enumeration: Discovers running services and their versions
  • OS Detection: Identifies operating systems of discovered devices
  • Web Interface: Clean, responsive React-based frontend

Architecture

IOT_Scanner/
├── Flask_server/
│   ├── iot_scanner.py    # Main Flask API with IoT scanning logic
│   ├── requirements.txt  # Python dependencies
│   └── scanner.py        # Basic scanner (legacy)
├── iot_ui/
│   ├── src/
│   │   └── app/
│   │       └── page.js   # React frontend
│   └── package.json      # Node.js dependencies
└── README.md

Installation & Setup

Prerequisites

  • Python 3.7+
  • Node.js 14+
  • nmap installed on your system

Backend Setup (Flask)

  1. Navigate to the Flask server directory:

    cd Flask_server
  2. Install Python dependencies:

    pip install -r requirements.txt
  3. Install nmap if not already installed:

    • Ubuntu/Debian: sudo apt-get install nmap
    • macOS: brew install nmap
    • Windows: Download from nmap.org
  4. Run the Flask server:

    python iot_scanner.py

The API will be available at http://localhost:5000

Frontend Setup (React)

  1. Navigate to the React app directory:

    cd iot_ui
  2. Install Node.js dependencies:

    npm install
  3. Start the development server:

    npm run dev

The web interface will be available at http://localhost:3000

API Endpoints

POST /scan/network

Scan a network range for IoT devices.

Request:

{
  "target": "192.168.1.0/24"
}

POST /scan/device

Scan a single IP address.

Request:

{
  "target": "192.168.1.100"
}

GET /info

Get API information and version.

Usage

  1. Start both the Flask backend and React frontend servers
  2. Open your browser to http://localhost:3000
  3. Choose between scanning a network range or a single device
  4. Enter the target IP range or address
  5. Click "Start Scan" to begin discovery
  6. Review the results showing detected devices, their services, and potential vulnerabilities

IoT Device Detection

The scanner identifies IoT devices based on:

  • Port signatures: Common IoT service ports (1883, 8883, 8080, 8443, etc.)
  • Service banners: Device-specific service responses
  • Hostname patterns: Device naming conventions
  • OS fingerprinting: Operating system characteristics

Supported device types include:

  • Raspberry Pi
  • Arduino Yun
  • ESP8266/ESP32
  • Amazon Echo/Alexa
  • Google Home/Nest
  • Philips Hue
  • Samsung SmartThings
  • TP-Link devices
  • Xiaomi/Mi devices

Security Analysis

The scanner checks for:

  • Default credentials: Services with known default passwords
  • Outdated services: Old versions of common services
  • Unnecessary services: Exposed services that shouldn't be public
  • Open ports: Port exposure analysis

Development

Adding New Device Signatures

Edit the iot_signatures dictionary in Flask_server/iot_scanner.py to add new device detection patterns:

'device_signatures': {
    'New Device': ['keyword1', 'keyword2', 'keyword3'],
}

Custom Vulnerability Checks

Add new vulnerability checks in the check_vulnerabilities method of the IoTScanner class.

Troubleshooting

Common Issues

  1. nmap not found: Ensure nmap is installed and in your system PATH
  2. Permission denied: Run with appropriate permissions (may need sudo on Linux/macOS)
  3. Network unreachable: Check your network configuration and firewall settings
  4. CORS errors: Ensure the Flask server is running and accessible

Security Notes

  • This tool is for educational and authorized network testing only
  • Always obtain proper authorization before scanning networks you don't own
  • Some features may require elevated privileges (sudo/administrator access)

License

This project is provided as-is for educational purposes.

Contributors

affan80

Issues