id: mysql-empty-password

info:
  name: MySQL - Empty Password
  author: DhiyaneshDk
  severity: high
  description: |
    Checks for MySQL servers with an empty password for root or anonymous.
  metadata:
    max-request: 3
    shodan-query: "port:3306"
  tags: js,mysql,network,vuln

javascript:
  - pre-condition: |
      isPortOpen(Host,Port);
    code: |
      var m = require("nuclei/mysql");
      var c = m.MySQLClient();
      c.Connect(Host,Port,User,Pass)

    args:
      Host: "{{Host}}"
      Port: "3306"
      User: "{{username}}"
      Pass: " "

    payloads:
      usernames:
        - root
        - anonymous

    stop-at-first-match: true
    matchers:
      - type: dsl
        dsl:
          - "response == true"
          - "success == true"
        condition: and
# digest: 4b0a00483046022100917bbbd6beeb542bdd0001dc98b979ffd6b07c2a3d5d291bc82de05bd4a60ad5022100cba122f305591faf88648b544a194e135f856801ba06a2fa492dd06ebd5bdc7d:922c64590222798bb761d5b6d8e72950