kernel-modules-lkm-forensic
Advanced Linux Kernel Module development for cybersecurity forensics. Custom LKM creation for rootkit detection, real-time syscall monitoring, kernel-space threat detection, eBPF forensics, and kerneldev-mcp integration.
- License 许可
- MIT
- 最近更新
- 2026-09-01
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- kernel-modules-lkm-forensic
- tags
- [ "kernel", "linux", "lkm", "kerneldev-forensic" ]
- capec
- []
- model
- opus
- tools
- [ "Read", "Write", "Bash", "Glob", "Grep", "WebSearch" ]
- skills
- [ "shared-memory", "threats/mitre-attack-mapper", "kerneldev" ]
- maxTurns
- 30
- nist_csf
- []
- description
- Advanced Linux Kernel Module development for cybersecurity forensics. Custom LKM creation for rootkit detection, real-time syscall monitoring, kernel-space threat detection, eBPF forensics, and kerneldev-mcp integration.
- mitre_attack
- [ "T1014", "T1059", "T1547", "T1547.006" ]
02 资源文件 1
- 参考文档index.json690 B
03 SKILL.md 正文
KernelDev Forensic — Advanced Kernel Development for Cybersecurity
Purpose:
Develop custom Linux Kernel Modules (LKMs) for advanced forensic investigation, rootkit detection, real-time syscall monitoring, and kernel-space threat detection. Integrates with existing CyberSec forensic framework and kerneldev-mcp for seamless development workflow.
Core Capabilities
🔧 Forensic LKM Development
- Rootkit Detection Modules: Custom kernel modules for advanced rootkit and malware detection
- Syscall Monitoring: Real-time system call interception and logging
- Memory Forensics: Kernel-space memory analysis and artifact collection
- Network Inspection: Deep packet inspection at kernel level
- Process Monitoring: Advanced process tracking and behavior analysis
🛡️ Real-Time Defense Modules
- IOC Detection: Kernel-space indicator monitoring and alerting
- Anti-Evasion: Counter-measures against kernel-level evasion techniques
- Baseline Verification: Real-time baseline integrity checking
- Threat Response: Automated kernel-space threat containment
🔍 Integration with CyberSec Framework
- Database Integration: Seamless integration with Kernel and KernelModule Tortoise models
- Session Management: LKM deployment tracking within investigation sessions
- Artifact Collection: Automated forensic artifact capture and storage
- MalwareHunter Elite: Enhanced capabilities for the elite forensic agent
Development Environment Setup
Prerequisites
bash scripts/prerequisites.sh
KernelDev-MCP Configuration
Ensure .claude/mcp.json is properly configured.
→ config/kerneldev_mcp.json
Forensic LKM Templates
1. Sysfs Communication Interface
Purpose: Clean kernel ↔ userspace communication for forensic tools
File: templates/forensic_sysfs_interface.c
Creates /sys/kernel/forensic_mcp/ with:
- message (rw): Command/response interface
- status (ro): Module status and statistics
- alerts (ro): Real-time threat alerts
- config (rw): Runtime configuration
2. Syscall Monitor Module
Purpose: Real-time syscall interception for APT detection
File: templates/syscall_monitor.c
Features:
- Selective syscall monitoring (configurable via sysfs)
- Process filtering by PID/PPID/command
- Real-time logging to ring buffer
- Integration with IOC detection
3. Rootkit Scanner Module
Purpose: Kernel-space rootkit detection and analysis
(Template pending — see scenario example below)
Capabilities:
- SSDT/IDT hook detection
- Hidden process detection via task_struct traversal
- Network connection hiding detection
- Kernel code integrity verification
4. Memory Forensics Collector
Purpose: Advanced memory artifact collection
(Template pending — see scenario example below)
Features:
- Live memory dumping
- Process memory mapping analysis
- Kernel heap inspection
- Cache poisoning detection
Integration with CyberSec Models
Database Integration
→ examples/deploy_forensic_module.py
python -c "
import asyncio
from examples.deploy_forensic_module import deploy_forensic_module
asyncio.run(deploy_forensic_module(kernel_id=1, module_name='syscall_monitor'))
"
Session Integration
python -c "
import asyncio
from examples.session_modules import create_forensic_session_modules
asyncio.run(create_forensic_session_modules(session_id='abc123'))
"
Development Workflow
1. Module Creation
bash examples/module_creation.sh custom_detector
2. Build and Test
bash examples/build_and_test.sh custom_detector
3. Integration Testing
→ examples/integration_testing.sh
bash examples/integration_testing.sh custom_detector
Security Considerations
Module Signing
bash scripts/sign_module.sh module.ko
Safety Measures
- Test Environment: Always develop in isolated VM/container
- Backup Protection: Automatic kernel backup before module load
- Failure Recovery: Safe module removal and system restoration
- Audit Trail: Complete deployment and removal logging
Example Forensic Scenarios
Scenario 1: APT Syscall Analysis
→ examples/scenario_apt_syscall.sh
bash examples/scenario_apt_syscall.sh
Scenario 2: Rootkit Detection Campaign
→ examples/scenario_rootkit_detection.sh
bash examples/scenario_rootkit_detection.sh
Scenario 3: Memory Forensics Collection
→ examples/scenario_memory_forensics.sh
bash examples/scenario_memory_forensics.sh /forensic/memory-artifacts
MCP Integration Commands
SESSION_ID=<your-session-id> bash examples/mcp_commands.sh
Troubleshooting
Common Issues
-
Module Loading Failures
- Check kernel version compatibility
- Verify module signing
- Review dmesg for specific errors
-
MCP Communication Issues
- Confirm kerneldev-mcp installation
- Check Python environment compatibility
- Verify kernel headers installation
-
Database Integration Problems
- Ensure Tortoise ORM connection
- Check model field compatibility
- Verify async/await usage
Debug Commands
bash scripts/debug.sh [module_name]
Contributing
Adding New Templates
- Create module in
templates/ - Add documentation in
examples/ - Update integration tests
- Submit PR with security review
Integration Extensions
- Database model extensions
- MalwareHunter Elite integration
- Session management enhancements
- Real-time alerting improvements
This skill enables advanced kernel-space forensic capabilities while maintaining integration with the existing CyberSec investigation framework. All modules should be developed with security, safety, and forensic integrity as primary concerns.
04 同仓库更多 Skills
devel-jb-algorithmic-art
- Embed algorithms inline in the HTML artifact (don't create separate .
services-wmi-persistence-detect
Detect WMI event subscription persistence by enumerating ActiveScriptEventConsumer, CommandLineEventConsumer, and permanent subscriptions in the WMI repository.
services-wmi-exec-exploit
Perform lateral movement across Windows networks using WMI-based remote execution techniques including Impacket wmiexec.py, CrackMapExec, and native WMI commands for stealthy post-exploitation during red team engagements.
registry-artifact-extract
Extract and analyze Windows Registry hives to uncover user activity, installed software, autostart entries, and evidence of system compromise.
processes-token-impersonate-detect
Detect Windows token impersonation and privilege abuse including SeImpersonatePrivilege exploitation via Potato attacks and token stealing techniques.
processes-thread-injection-detect
Detect Windows thread injection techniques including CreateRemoteThread, QueueUserAPC, NtCreateThreadEx, and thread hijacking via process memory analysis.