SkillAgentSearch skills...

RootShield

RootShield : The Ultimate Shield for Rooted Android Devices - Protect your rooted Android device from unauthorized file operations and process executions! ๐Ÿ›ก๏ธ RootShield is a powerful kernel module that ensures your device remains secure by monitoring and preventing risky activities. RootShield is your deviceโ€™s ultimate defense mechanism. ๐Ÿ› ๏ธ๐Ÿ”ฅ

Install / Use

/learn @ImKKingshuk/RootShield

README

<h1 align="center">RootShield</h1> <h3 align="center">v3.0.0 - The Ultimate Kernel Security Module</h3>

RootShield : The Ultimate Shield for Rooted Android Devices & Linux Systems - Advanced kernel-level security with comprehensive monitoring, behavioral analysis, and enterprise-grade protection! ๐Ÿ›ก๏ธ RootShield v3.0 is a revolutionary security module that transforms your device into an impenetrable fortress. Built with cutting-edge technology, it provides multi-layered protection against sophisticated attacks. ๐Ÿ› ๏ธ๐Ÿ”ฅ๐Ÿค–

Features Status Legend

| Tag | Meaning | |-----|---------| | โœ… | Fully Working - Feature is complete and operational | | ๐Ÿ”ง | Functional - Core functionality works, with some limitations | | ๐Ÿšง | Coming Soon - Placeholder/under development |


Core Security Monitors โœ…

๐Ÿ›ก๏ธ Execution Protection โœ…

  • Binary Execution Monitoring โœ…: Intercepts do_execveat_common via kprobe
  • Suspicious Command Detection โœ…: Blocks su, busybox, tcpdump, strace, frida
  • Process Termination โœ…: Kills violating processes on detection
  • Event Notification โœ…: Sends alerts to userspace via Netlink

๐Ÿ“ File System Protection โœ…

  • Write Monitoring โœ…: kprobe on vfs_write for protected paths
  • Open Monitoring โœ…: kprobe on vfs_open for sensitive files
  • Protected Paths โœ…: /dev/block, /system/bin, /proc/kallsyms, /proc/kcore
  • Access Control โœ…: Blocks unauthorized root process access

๐Ÿ—‘๏ธ Process Protection โœ…

  • File Deletion Monitoring โœ…: Protects critical system paths via do_unlinkat
  • Fork Monitoring โœ…: Detects suspicious process creation patterns
  • Ptrace Protection โœ…: Prevents memory injection attempts
  • Anti-Tampering โœ…: Blocks code injection via ptrace

๐ŸŒ Network Monitoring โœ…

  • Outgoing Traffic Analysis โœ…: Netfilter hook on NF_INET_LOCAL_OUT
  • Suspicious Port Blocking โœ…: Blocks 1337, 4444, 5555, 31337, 12345
  • TCP/UDP Inspection โœ…: Analyzes both protocols
  • Root Process Filtering โœ…: Monitors only elevated processes

๐Ÿ” System Call Protection โœ…

  • Sensitive Syscall Monitoring โœ…: ptrace, capset, mount, init_module
  • kprobe Intercepts โœ…: Multiple syscall hooks
  • Suspicious Process Detection โœ…: Identifies malicious syscall patterns
  • Real-Time Blocking โœ…: Terminates violating processes

๐Ÿ’พ Memory Protection โœ…

  • Large Allocation Detection โœ…: Flags allocations over 10MB
  • Executable Memory Monitoring โœ…: Detects set_memory_x calls
  • Buffer Overflow Detection โœ…: Identifies suspicious memory patterns
  • Code Injection Prevention โœ…: Blocks attempts to make memory executable

๐Ÿ“ฆ Module Loading Protection โœ…

  • Module Loading Intercept โœ…: kprobe on load_module
  • Suspicious Name Detection โœ…: Blocks "hide", "root", "hack", "inject"
  • Real-Time Alerts โœ…: Immediate notification on detection

Advanced Security Features โœ…

๐Ÿง  AI Behavioral Analysis โœ…

  • Statistical Modeling โœ…: Mean, variance, standard deviation tracking
  • Z-Score Anomaly Detection โœ…: Configurable threshold (default: 3.0)
  • Sliding Window Analysis โœ…: Time-based behavior profiling
  • Per-Process Profiling โœ…: Individual process behavior tracking
  • Global Baseline โœ…: System-wide anomaly detection
  • Feature Extraction โœ…: Syscall frequency, process spawn rate, file access, network connections

๐Ÿ” Anti-Rootkit Engine โœ…

  • Hidden Module Detection โœ…: Cross-references module list
  • Syscall Hook Detection โœ…: Identifies syscall table modifications
  • Hidden Process Detection โœ…: Task list vs /proc comparison
  • Memory Integrity Checking โœ…: Verifies critical memory regions
  • IDT Integrity Verification โœ…: Detects interrupt table manipulation
  • Periodic Scanning โœ…: Automated background checks

๐Ÿ›ก๏ธ Self-Protection โœ…

  • Module Locking โœ…: Prevents forced unloading (try_module_get)
  • SHA-256 Integrity Hashing โœ…: Code section verification
  • Integrity Monitoring โœ…: Continuous integrity checks
  • Tamper Detection โœ…: Identifies modification attempts
  • Protection Levels โœ…: BASIC, STANDARD, HIGH, MAXIMUM
  • Emergency Mode โœ…: Lockdown on severe threats

Infrastructure & Architecture โœ…

๐Ÿ“ก Event System โœ…

  • Publish-Subscribe Pattern โœ…: Inter-component event communication
  • Circular Buffer Queue โœ…: High-performance event storage (256 events)
  • Async Dispatch โœ…: Workqueue-based processing
  • Event Filtering โœ…: Type, severity, source-based filtering
  • Statistics Tracking โœ…: Total/processed/dropped event metrics

๐Ÿ“‹ Rule Engine โœ…

  • Red-Black Tree Storage โœ…: Fast rule lookup and management
  • Priority-Based Evaluation โœ…: Higher priority rules evaluated first
  • Condition System โœ…: Process name, file path, UID, network, syscall conditions
  • Operators โœ…: Equals, contains, starts_with, ends_with, greater_than, less_than
  • Dynamic Rule Loading โœ…: Runtime rule addition/removal
  • Rule Statistics โœ…: Hit counts, evaluation times

๐Ÿ”Œ Plugin System โœ…

  • Dynamic Registration โœ…: Load/unload plugins at runtime
  • Lifecycle Management โœ…: Init, start, stop, exit states
  • Dependency Resolution โœ…: Automatic dependency checking
  • Event Broadcasting โœ…: Plugin-to-plugin communication
  • Configuration API โœ…: Key-value plugin configuration
  • Health Monitoring โœ…: Plugin health checks and statistics

Management & Monitoring โœ…

๐ŸŒ REST API โœ…

  • GET /api/v1/status โœ…: System status and version
  • GET /api/v1/events โœ…: Security events retrieval
  • GET/POST /api/v1/rules โœ…: Rule management
  • GET /api/v1/plugins โœ…: Plugin status
  • GET /api/v1/statistics โœ…: Security statistics
  • SQLite Backend โœ…: Persistent storage
  • JSON Responses โœ…: REST-compliant API

๐Ÿ“Š Real-Time Client โœ…

  • Netlink Communication โœ…: Kernel to userspace notifications
  • Colored Output โœ…: Red (violations), yellow (blocked), blue (stats)
  • Live Event Feed โœ…: Real-time security event display
  • Process Information โœ…: PID, process name, path details

๐Ÿ–ฅ๏ธ CLI Tool โœ…

  • Status Command โœ…: System status overview
  • Events Command โœ…: Recent events with limit support
  • Rules Command โœ…: List and create security rules
  • Plugins Command โœ…: Active plugin listing
  • Stats Command โœ…: Security statistics display
  • HTTP Client โœ…: libcurl-based API communication
  • JSON Parsing โœ…: json-c based response parsing

๐Ÿ“ˆ Statistics & Reporting โœ…

  • Per-Monitor Counters โœ…: Violations and blocks per monitor
  • Atomic Operations โœ…: Thread-safe statistics
  • Real-Time Updates โœ…: Live statistics tracking
  • Reset Capability โœ…: Statistics reset functionality

Planned Features ๐Ÿšง

๐Ÿ” Hardware-Assisted Security ๐Ÿšง

  • TPM Integration ๐Ÿšง: Trusted Platform Module support
  • Secure Boot Verification ๐Ÿšง: Boot integrity checking
  • Hardware Key Storage ๐Ÿšง: Cryptographic key protection

๐ŸŒ Enterprise Features ๐Ÿšง

  • Multi-Tenant Support ๐Ÿšง: Role-based access control
  • Compliance Reporting ๐Ÿšง: Automated compliance checks
  • Multi-Device Management ๐Ÿšง: Centralized orchestration
  • Web Dashboard ๐Ÿšง: Modern web interface

Requirements

  • Linux Kernel (4.15+ with Kprobes and Netfilter support)
  • Rooted Android Device (or Linux system with root access)
  • GNU Make and build tools
  • Kernel Headers for target kernel version
  • SQLite3 for database backend (API server)
  • libmicrohttpd and json-c for API server
  • GCC with C11 support

Quick Start

1. Build Everything

git clone https://github.com/ImKKingshuk/RootShield.git
cd RootShield
make deps-check  # Check dependencies
make all         # Build kernel module and API server

2. Install and Load

sudo make install    # Install all components
# Or manually:
sudo insmod rootshield.ko

3. Start Userspace Components

# Start the notification client to receive alerts
./client/rootshield_client

# Start the API server (requires libmicrohttpd, json-c, sqlite3)
./api/rootshield_api

4. Access API

The API server listens on http://localhost:8080. Available endpoints:

  • GET /api/v1/status - System status
  • GET /api/v1/events - Security events
  • GET/POST /api/v1/rules - Security rules management
  • GET /api/v1/plugins - Plugin status
  • GET /api/v1/statistics - Security statistics

5. Basic Usage

# Load with default configuration
sudo insmod rootshield.ko

# Load with custom configuration
sudo insmod rootshield.ko exec_monitor_enabled=1 file_monitor_enabled=1 verbose_logging=1

# Monitor system logs
dmesg | grep RootShield

# View module parameters
cat /sys/module/rootshield/parameters/*

Architecture Overview

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    RootShield v3.0                          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚              API Server (Port 8080)                 โ”‚    โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚        REST API (libmicrohttpd)             โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚     SQLite Database | JSON Responses        โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚            User Space Components                    โ”‚    โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚   Notification  โ”‚ โ”‚     Web Dashboard       โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚   Client        โ”‚ โ”‚     (Coming Soon)       โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ”‚   (Netlink)     โ”‚ โ”‚                         โ”‚   โ”‚    โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Related Skills

View on GitHub
GitHub Stars20
CategoryDevelopment
Updated1mo ago
Forks6

Languages

C

Security Score

95/100

Audited on Feb 8, 2026

No findings