How leohearts/awd-watchbird works
Core Components
• Main WAF Module (watchbird-source.php)
• Kernel-level Protection Module (waf.c/waf.so)
• Web Console UI
• Installation/Management Script (pack.py)
Architecture Layers
Layer 1: Web Application Layer
• Protected PHP application (represented as an external component)
• Connection to the WAF integration points
Layer 2: WAF Processing Layer
• Request Interceptor
• Defense Modules:
• Basic Protection:
• SQL Injection Detection
• File Upload Protection
• LFI Protection
• Flag Keyword Detection
• Unserialize Protection
• RCE Protection
• DDoS Protection
• Request Header/Parameter Analysis
• Deep Protection:
• Response Detection
• Reverse Proxy
• Flag Response Protection
• LD_PRELOAD Protection
• open_basedir Protection
Layer 3: Management Layer
• Web Console
• Configuration Management
• Real-time Logging
• Traffic Replay System
• Alert System
Flow Directions
• Incoming web requests
• Inspection points
• Response paths
• Management interactions
Component Relationships
• Data flow between protection modules
• Monitoring connections to the management console
Special Elements
• A proxy server component with configurable settings
• Flag detection and replacement mechanism
• Installation/deployment process
Technical Details
• PHP integration points
• Kernel-level protection mechanisms
• Configuration storage
• Log flow
• Alert pathways
Specific Implementation Notes:
Use a hexagonal architecture pattern
• Input adapters (request processing)
• Core security logic
• Output adapters (response processing)
A separate section for the installation process
• Relationship between pack.py and deployment
• Integration with the web server
• Reverse proxy flow
• Where LD_PRELOAD protection operates
• Flag detection and replacement mechanism