# Joomla Configuration Backup Exposure Detection Module

id: joomla-config-exposure
info:
  name: Joomla Configuration Backup Exposure
  author: sif
  severity: high
  description: Detects an exposed Joomla configuration.php backup that leaks the database password
  tags: [joomla, cms, config, credentials, recon, exposure]

type: http

http:
  method: GET
  paths:
    - "{{BaseURL}}/configuration.php.bak"
    - "{{BaseURL}}/configuration.php~"
    - "{{BaseURL}}/configuration.php.old"
    - "{{BaseURL}}/configuration.php.save"
    - "{{BaseURL}}/configuration.php.orig"
    - "{{BaseURL}}/configuration.php.txt"

  matchers:
    - type: status
      status:
        - 200

    - type: word
      part: body
      words:
        - "public $password"

    - type: word
      part: body
      condition: or
      words:
        - "JConfig"
        - "public $dbprefix"
        - "public $secret"
        - "public $db"

    - type: word
      part: body
      negative: true
      condition: or
      words:
        - "<!DOCTYPE"
        - "<html"

  extractors:
    - type: regex
      name: joomla_password
      part: body
      regex:
        - "password\\s*=\\s*'([^']+)'"
      group: 1
