mysql-config-exposure: MySQL Conifg - Exposure

2026-01-08 MySQL Conifg PoC Public

Description

Detects exposure of MySQL credentials, configuration, and command history via HTTP. Exposure of files such as .my.cnf and .mysql_history may lead to leakage of database passwords or SQL history, enabling attackers to compromise databases.

PoC

id: mysql-config-exposure

info:
  name: MySQL Conifg - Exposure
  author: theamanrawat
  severity: high
  description: |
    Detects exposure of MySQL credentials, configuration, and command history via HTTP. Exposure of files such as .my.cnf and .mysql_history may lead to leakage of database passwords or SQL history, enabling attackers to compromise databases.
  reference:
    - https://dev.mysql.com/doc/refman/8.0/en/option-files.html
  metadata:
    verified: true
    max-request: 1
  tags: exposure,config,mysql,database,vuln

http:
  - method: GET
    path:
      - "{{BaseURL}}/.my.cnf"

    matchers-condition: and
    matchers:
      - type: regex
        name: my-cnf-creds
        regex:
          - "password\\s*=\\s*[\"']?[^\"'\\s]+[\"']?"

      - type: word
        words:
          - "[client]"

      - type: status
        status:
          - 200
# digest: 4a0a0047304502201afd37fc0a5a2a4e9994f1bfe2a9cab3d3b34577e3ae28b3bc59bbaecff7c40a022100b214214ccca66d1dc6e4fffd8b1aef04ae9146bb445ebc2d8c9203b8379637dc:922c64590222798bb761d5b6d8e72950

# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.

References

Related Vulnerabilities