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. π οΈπ₯π€
| Tag | Meaning |
|---|---|
| β | Fully Working - Feature is complete and operational |
| π§ | Functional - Core functionality works, with some limitations |
| π§ | Coming Soon - Placeholder/under development |
- Binary Execution Monitoring β
: Intercepts
do_execveat_commonvia 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
- Write Monitoring β
: kprobe on
vfs_writefor protected paths - Open Monitoring β
: kprobe on
vfs_openfor sensitive files - Protected Paths β : /dev/block, /system/bin, /proc/kallsyms, /proc/kcore
- Access Control β : Blocks unauthorized root process access
- 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
- 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
- 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
- Large Allocation Detection β : Flags allocations over 10MB
- Executable Memory Monitoring β
: Detects
set_memory_xcalls - Buffer Overflow Detection β : Identifies suspicious memory patterns
- Code Injection Prevention β : Blocks attempts to make memory executable
- Module Loading Intercept β
: kprobe on
load_module - Suspicious Name Detection β : Blocks "hide", "root", "hack", "inject"
- Real-Time Alerts β : Immediate notification on detection
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- Per-Monitor Counters β : Violations and blocks per monitor
- Atomic Operations β : Thread-safe statistics
- Real-Time Updates β : Live statistics tracking
- Reset Capability β : Statistics reset functionality
- TPM Integration π§: Trusted Platform Module support
- Secure Boot Verification π§: Boot integrity checking
- Hardware Key Storage π§: Cryptographic key protection
- Multi-Tenant Support π§: Role-based access control
- Compliance Reporting π§: Automated compliance checks
- Multi-Device Management π§: Centralized orchestration
- Web Dashboard π§: Modern web interface
- 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
git clone https://github.com/ImKKingshuk/RootShield.git
cd RootShield
make deps-check # Check dependencies
make all # Build kernel module and API serversudo make install # Install all components
# Or manually:
sudo insmod rootshield.ko# Start the notification client to receive alerts
./client/rootshield_client
# Start the API server (requires libmicrohttpd, json-c, sqlite3)
./api/rootshield_apiThe API server listens on http://localhost:8080. Available endpoints:
GET /api/v1/status- System statusGET /api/v1/events- Security eventsGET/POST /api/v1/rules- Security rules managementGET /api/v1/plugins- Plugin statusGET /api/v1/statistics- Security statistics
# 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/*βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β RootShield v3.0 β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β API Server (Port 8080) β β
β β βββββββββββββββββββββββββββββββββββββββββββββββ β β
β β β REST API (libmicrohttpd) β β β
β β β SQLite Database | JSON Responses β β β
β β βββββββββββββββββββββββββββββββββββββββββββββββ β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β User Space Components β β
β β βββββββββββββββββββ βββββββββββββββββββββββββββ β β
β β β Notification β β Web Dashboard β β β
β β β Client β β (Coming Soon) β β β
β β β (Netlink) β β β β β
β β βββββββββββββββββββ βββββββββββββββββββββββββββ β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Kernel Space Module β β
β β βββββββββββ βββββββββββ βββββββββββ βββββββββββ β β
β β β Core β βNotific- β β Runtime β β Stats β β β
β β β Engine β β ation β β Config β β Tracker β β β
β β βββββββββββ βββββββββββ βββββββββββ βββββββββββ β β
β β β β
β β βββββββββββββββββββββββββββββββββββββββββββββββ β β
β β β Security Monitors β β β
β β β βββββββ βββββββ βββββββ βββββββ βββββββ β β β
β β β βExec β βFile β βProc β βNet β βSys- β β β β
β β β βMon β βMon β βMon β βMon β βcall β β β β
β β β βββββββ βββββββ βββββββ βββββββ βββββββ β β β
β β β βββββββ βββββββ β β β
β β β βMem β βMod β β β β
β β β βMon β βMon β β β β
β β β βββββββ βββββββ β β β
β β βββββββββββββββββββββββββββββββββββββββββββββββ β β
β β β β
β β βββββββββββββββββββββββββββββββββββββββββββββββ β β
β β β Advanced Plugins β β β
β β β βββββββββββββββββ βββββββββββββββββββββ β β β
β β β β Anti-Rootkit β β Behavioral β β β β
β β β β (Partial) β β Analyzer β β β β
β β β βββββββββββββββββ βββββββββββββββββββββ β β β
β β βββββββββββββββββββββββββββββββββββββββββββββββ β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Hardware/Kernel β
β Kprobes | Netfilter | Netlink | proc/sys interfaces β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Endpoint | Method | Description | Status |
|---|---|---|---|
/api/v1/status |
GET | System status | β Implemented |
/api/v1/events |
GET | Security events | β Implemented |
/api/v1/rules |
GET | List security rules | β Implemented |
/api/v1/rules |
POST | Create new rule | β Implemented |
/api/v1/plugins |
GET | Plugin status | β Implemented |
/api/v1/statistics |
GET | Security statistics | β Implemented |
rootshield_cli status # System status
rootshield_cli events [limit] # View recent events
rootshield_cli rules list # List active rules
rootshield_cli rules add <json> # Add new rule
rootshield_cli plugins # List loaded plugins
rootshield_cli config get <key> # Get configuration
rootshield_cli config set <key> <value> # Set configuration| Option | Type | Default | Description |
|---|---|---|---|
exec_monitor_enabled |
bool | true | Enable/disable execution monitoring |
file_monitor_enabled |
bool | true | Enable/disable file system monitoring |
process_monitor_enabled |
bool | true | Enable/disable process monitoring |
network_monitor_enabled |
bool | true | Enable/disable network monitoring |
syscall_monitor_enabled |
bool | true | Enable/disable syscall monitoring |
memory_monitor_enabled |
bool | true | Enable/disable memory monitoring |
module_monitor_enabled |
bool | true | Enable/disable kernel module monitoring |
kill_violating_process |
bool | true | Kill processes that violate security policies |
notify_only |
bool | false | Only log violations without taking action |
block_only |
bool | false | Block operations without killing the process |
verbose_logging |
bool | false | Enable verbose logging for debugging |
- Parameters can be set at module load time:
insmod rootshield.ko verbose_logging=1 - Parameters are exposed via sysfs:
/sys/module/rootshield/parameters/ - Security policy validation ensures no conflicting options
- Start with
notify_only=1for testing and tuning - Enable verbose logging initially for monitoring false positives
- Monitor system logs and adjust protected paths as needed
- Regular backup of configurations and logs
- Use the netlink client for real-time monitoring
- Set up log aggregation for security events
- Regular security audits based on collected statistics
- Keep system and RootShield updated
Module Loading Fails
# Check kernel version compatibility
uname -r
# Verify kernel headers
ls /lib/modules/$(uname -r)/build
# Check dmesg for detailed errors
dmesg | tail -50
# Check if kprobes are enabled
cat /proc/kallsyms | headHigh CPU Usage
# Disable verbose logging
sudo insmod rootshield.ko verbose_logging=0
# Disable specific monitors that may be too aggressive
sudo insmod rootshield.ko syscall_monitor_enabled=0API Server Issues
# Check if port is available
netstat -tlnp | grep 8080
# Verify dependencies
ldd api/rootshield_api
# Check API server logs
./api/rootshield_api 2>&1
# Ensure database directory exists
mkdir -p /var/lib/rootshieldNetlink Client Connection Issues
# Ensure module is loaded first
lsmod | grep rootshield
# Check dmesg for netlink socket errors
dmesg | grep "RootShield.*netlink"GNU General Public License v3.0
RootShield v3.0 - Transforming security through innovation, intelligence, and uncompromising protection. π‘οΈπ€π₯