# Joomla .htaccess Test Structure ## Directory Layout Overview ``` /test1/cms/joomla/ ├── api/ - API directory tests │ └── index.php - Joomla API entry point (routes /api/ requests) │ - Returns: "Joomla API Configuration Loaded" ├── .well-known/ - Well-known directory │ └── robots.txt - Allowed file via exception ├── base64-test.php - Security test for base64_encode pattern detection ├── globals-test.php - Security test for GLOBALS exploitation pattern ├── request-test.php - Security test for _REQUEST manipulation pattern ├── script-test.php - Security test for script injection pattern ├── index.php - Joomla main entry point (routes non-existing files) │ - Returns: "Joomla Content Route" page ├── somedir/ - Directory for testing !-d condition (200 OK) ├── test-joomla-rewriterules.sh - Bash script to test all rules using curl └── README.md - This documentation file ``` ## Apache Rules Explained - Joomla ### 1. Base64 Encoded Payload Detection Rule ```apache RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR] ``` **Что делает:** Detects Base64 encoded payloads in query string (function call pattern) **Зачем нужно:** Защита от Base64-encoded malicious code injection attacks - Pattern: `base64_encode(...)` - detect function calls that encode data ### 2. Script Injection Pattern Detection Rule ```apache RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR] ``` **Что делает:** Detects script injection patterns (HTML entities decoded) **Зачем нужно:** Защита от XSS attacks через URL parameters - Pattern: `