Skip to content

Latest commit

 

History

26 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IoT Security Using Raspberry Pi

Overview

IoT Security Using Raspberry Pi is a lightweight and cost-effective Intrusion Detection System (IDS) developed to improve the security of Internet of Things (IoT) environments. The project integrates Snort IDS with Raspberry Pi to monitor network traffic, detect malicious activities, and generate real-time alerts for potential security incidents.

The system is capable of identifying various cyber threats including Nmap scans, SYN floods, ICMP floods, HTTP floods, brute-force attacks, and ARP spoofing attempts. To improve incident response, Telegram Bot integration was implemented to provide instant alert notifications whenever suspicious activities are detected.

The project demonstrates how affordable hardware and open-source security tools can be combined to create an effective monitoring solution for IoT networks.


Problem Statement

The rapid growth of IoT devices has introduced significant cybersecurity challenges. Most IoT devices operate with limited processing power, memory, and built-in security controls, making them attractive targets for cyber attackers.

Traditional security solutions are often resource-intensive and may not be suitable for resource-constrained IoT environments. As a result, organizations and individuals require a lightweight, scalable, and cost-effective security solution capable of detecting network attacks and providing timely alerts.

This project addresses these challenges by implementing a Raspberry Pi-based Intrusion Detection System using Snort IDS and Telegram alert integration to improve visibility, monitoring, and threat detection within IoT networks.


Objectives

  • Develop a lightweight IDS solution using Raspberry Pi.
  • Integrate Snort IDS for real-time network monitoring.
  • Detect common cyber threats targeting IoT environments.
  • Generate instant security notifications using Telegram.
  • Improve security visibility and incident response capabilities.
  • Provide an affordable and scalable security solution for IoT deployments.
  • Demonstrate practical implementation of network security concepts in real-world scenarios.

Key Features

  • Raspberry Pi Based Security Monitoring
  • Snort Intrusion Detection System (IDS)
  • Real-Time Threat Detection
  • Telegram Alert Integration
  • Nmap Scan Detection
  • SYN Flood Detection
  • ICMP Flood Detection
  • HTTP Flood Detection
  • SSH Brute Force Detection
  • ARP Spoofing Detection
  • IoT Camera Monitoring
  • Custom Snort Rule Implementation
  • Low-Cost and Scalable Architecture

System Architecture

The proposed architecture utilizes Raspberry Pi as a lightweight security monitoring platform for IoT environments. Network traffic generated by IoT devices is continuously monitored by Snort IDS running on Raspberry Pi. When malicious activity is detected, alerts are logged and processed by a Python-based monitoring script, which sends real-time notifications to the administrator through Telegram.

Architecture Diagram



image



Technologies Used

Hardware

  • Raspberry Pi 4 Model B
  • Camera Module
  • Router / Network Infrastructure

Software

  • Raspberry Pi OS
  • Snort IDS
  • Python 3
  • Flask
  • Telegram Bot API
  • Kali Linux

Attack Simulation Tools

  • Nmap
  • Hydra
  • Hping3
  • Burp Suite

Programming Languages

  • Python
  • Bash Scripting

Attack Detection Capabilities

Attack Type Description
Nmap SYN Scan Detects reconnaissance and port scanning activities
ICMP Flood Detects excessive ICMP packets used in flooding attacks
HTTP Flood Detects abnormal web traffic and flooding attempts
SSH Brute Force Identifies repeated login attempts against SSH services
HTTP Brute Force Detects credential guessing attacks against web applications
Network Reconnaissance Monitors suspicious scanning and enumeration activities

Project Workflow



project_workflow

Screenshots

Raspberry Pi Setup

The Raspberry Pi 4 Model B was configured as the central monitoring device responsible for traffic analysis, intrusion detection, and alert generation.



image

image

### Snort IDS Configuration

Snort IDS was configured with custom rules to monitor network traffic and detect suspicious activities targeting IoT devices.

image

Attack Simulation

A controlled lab environment was used to simulate attacks such as Nmap scans, brute-force attempts, and flooding attacks to evaluate the effectiveness of the IDS.

image

image

image

Snort Alert Detection

This screenshot demonstrates Snort successfully identifying malicious traffic and generating intrusion alerts.

IMG-20250425-WA0024

Telegram Alert Notification

Real-time Telegram notifications were generated whenever suspicious activities were detected, enabling rapid incident awareness and response.

IMG-20250425-WA0034

IoT Camera Login Page

A Flask-based authentication interface was developed to restrict unauthorized access to the IoT camera monitoring system.

Screenshot 2025-05-08 233632

Camera Streaming Page

This interface provides live monitoring of the connected IoT camera after successful authentication.

Screenshot 2025-05-09 001759


Project Outcomes

  • Successfully deployed Snort IDS on Raspberry Pi for real-time intrusion detection.
  • Monitored and analyzed network traffic within an IoT environment.
  • Detected reconnaissance, flooding, and brute-force attacks through custom Snort rules.
  • Implemented Telegram integration for instant security notifications.
  • Developed a Flask-based login portal for secure camera monitoring.
  • Demonstrated a low-cost and scalable IoT security solution.
  • Improved visibility into network security events through continuous monitoring and alert generation.
  • Validated attack detection capabilities through controlled attack simulations.
  • Published the project as a research paper in an international journal.

Research Paper

This project was successfully published as a research paper in the International Journal for Research in Applied Science & Engineering Technology (IJRASET).

Publication Details

Title: Intrusion Detection System Using Raspberry Pi for IoT Devices

Authors: K. Ravi Kumar, Muhammed Wasim PM, Ananya Krishna Murthy, Muhammed Roshiq, and Sakshi Dubey

Journal: International Journal for Research in Applied Science & Engineering Technology (IJRASET)

Volume & Issue: Volume 13, Issue IV, April 2025

DOI: 10.22214/ijraset.2025.69909

Research Paper File

IJRASET_Research_Paper.pdf


Installation & Setup

Prerequisites

Before starting the project, ensure the following requirements are available:

  • Raspberry Pi 4 Model B
  • Raspberry Pi OS (64-bit)
  • Internet Connectivity
  • Python 3
  • Snort IDS
  • Telegram Bot
  • Raspberry Pi Camera Module

System Requirements

Hardware Requirements

Component Specification
Raspberry Pi Raspberry Pi 4 Model B
Storage 32GB MicroSD Card or Higher
Camera Raspberry Pi Camera Module
Network Ethernet or Wi-Fi Connectivity
Test Machine Kali Linux / Laptop

Software Requirements

Software Purpose
Raspberry Pi OS Operating System
Snort IDS Intrusion Detection
Python 3 Alert Automation
Flask Camera Login Interface
Telegram Bot API Real-Time Notifications
Kali Linux Attack Simulation

Step 1: Raspberry Pi Integration

  • Install Raspberry Pi OS on the Raspberry Pi.
  • Configure network connectivity.
  • Enable SSH for remote administration.
  • Connect and configure the Raspberry Pi Camera Module.
  • Verify internet connectivity and system updates.

image

image

image

image

image

image

image


Step 2: Snort IDS Installation

Install Snort IDS on Raspberry Pi to monitor network traffic and detect malicious activities.

sudo apt update
sudo apt upgrade -y
sudo apt install snort -y



image

Verify installation:

snort -V

Step 3: Snort Configuration

Configure Snort network variables and monitoring interfaces.

image

Update:

sudo nano /etc/snort/snort.conf

Configure:

  • HOME_NET
  • EXTERNAL_NET
  • Network Interface
  • Rule Paths

Step 4: Custom Rule Creation

Create custom Snort rules to detect:

  • Nmap SYN Scan
  • ICMP Flood
  • HTTP Flood
  • SSH Brute Force Attempts
  • ARP Spoofing

    image

Store custom rules in:

/etc/snort/rules/local.rules

Step 5: Alert Monitoring System

Develop a Python-based monitoring script to continuously read Snort alert logs and identify security incidents.

Functions:

  • Monitor alert files
  • Parse attack information
  • Extract source IP addresses
  • Generate alert messages

image


Step 6: Telegram Alert Integration

Create a Telegram Bot using BotFather and configure the Python monitoring script.

Configure:

BOT_TOKEN = "YOUR_BOT_TOKEN"
CHAT_ID = "YOUR_CHAT_ID"

The system automatically sends real-time notifications when attacks are detected.


Step 7: IoT Camera Security Implementation

Develop a Flask-based login portal to secure access to the camera monitoring interface.

Features:

  • Authentication Page
  • Login Validation
  • Protected Camera Access
  • Camera Streaming Interface

Step 8: Attack Simulation & Testing

Perform controlled attack simulations using Kali Linux.

Tools Used:

  • Nmap
  • Hydra
  • Hping3
  • Burp Suite

Attack Scenarios:

  • Port Scanning
  • Brute Force Attacks
  • Flooding Attacks
  • Reconnaissance Activities

image

image

image

---

Step 9: Detection & Validation

Validate system functionality by confirming:

  • Attack detection by Snort IDS
  • Alert generation
  • Telegram notifications
  • Camera monitoring functionality
  • Successful threat identification

image

image


Repository Structure

IoT-Security-Using-Raspberry-Pi/
│
├── README.md
├── LICENSE
│
├── architecture/
│   ├── system_architecture.png
│   └── project_workflow.png
│
├── report/
│   └── Major_Project_Report.pdf
│
├── research-paper/
│   └── IJRASET_Research_Paper.pdf
│
│
│
├── screenshots/
│   ├── 01_raspberry_pi_setup.png
│   ├── 02_snort_configuration.png
│   ├── 03_attack_simulation.png
│   ├── 04_snort_alert_detection.png
│   ├── 05_telegram_alert_notification.png
│   ├── 06_iot_camera_login_page.png
│   └── 07_camera_streaming_page.png
│
├── source-code/
│   ├── telegram_alert.py
│   ├── camera_monitoring.py
│   └── local.rules
│  
│
└── docs/
    └── project_summary.md

Challenges Faced

During the development of the project, several technical and operational challenges were encountered:

  • Deploying Snort IDS efficiently on resource-constrained Raspberry Pi hardware.
  • Configuring and tuning Snort rules to reduce false positives.
  • Monitoring high volumes of network traffic without affecting system performance.
  • Integrating real-time Telegram notifications with the IDS alert system.
  • Developing a secure authentication mechanism for camera monitoring.
  • Simulating realistic attack scenarios within a controlled testing environment.
  • Managing network configuration and connectivity between multiple devices.
  • Ensuring continuous monitoring while maintaining system stability.

Lessons Learned

This project provided practical exposure to multiple cybersecurity and system administration concepts.

Key learning outcomes include:

  • Deployment and configuration of Intrusion Detection Systems (IDS).
  • Creation and customization of Snort detection rules.
  • Network traffic monitoring and packet analysis.
  • Incident detection and alert management.
  • Integration of Python automation with security tools.
  • Implementation of real-time notification systems using Telegram APIs.
  • Secure deployment of IoT monitoring solutions.
  • Linux system administration and troubleshooting.
  • Understanding of common attack techniques and detection methodologies.
  • Application of cybersecurity concepts in real-world IoT environments.

Future Enhancements

Several enhancements can further improve the effectiveness and scalability of the solution:

  • Automated IP blocking for malicious hosts using firewall rules.
  • Integration with SIEM platforms for centralized log management.
  • Development of a web-based monitoring dashboard.
  • Machine Learning-based anomaly detection for unknown threats.
  • Cloud-based alert storage and incident tracking.
  • Enhanced user authentication and access control mechanisms.
  • Support for additional IoT devices and sensors.
  • Integration with SOAR platforms for automated incident response.
  • Real-time visualization and reporting of security events.
  • Expansion of detection capabilities through advanced custom rule sets.

References

The following resources were referenced during the development and research phases of this project:

  1. Snort IDS Documentation https://www.snort.org

  2. Raspberry Pi Documentation https://www.raspberrypi.com/documentation

  3. Python Documentation https://docs.python.org

  4. Flask Documentation https://flask.palletsprojects.com

  5. Telegram Bot API Documentation https://core.telegram.org/bots/api

  6. Nmap Documentation https://nmap.org/docs.html

  7. OWASP Foundation https://owasp.org


Author

Muhammed Wasim P M

Cybersecurity Graduate | Associate of ISC2 | Security Operations & Threat Detection

This project was developed as part of a B.Tech Cybersecurity program with a focus on IoT security, intrusion detection, threat monitoring, and real-time alerting.

Areas of Interest

  • Security Operations (SOC)
  • Threat Detection
  • Incident Response
  • Threat Intelligence
  • IoT Security
  • Network Security
  • Defensive Security

Connect With Me


About

A Raspberry Pi-based Intrusion Detection System (IDS) using Snort for real-time threat detection, IoT security monitoring, and Telegram alert notifications.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages