54 lines
1.2 KiB
YAML
54 lines
1.2 KiB
YAML
id: mysql-show-databases
|
|
|
|
info:
|
|
name: MySQL - Show Databases
|
|
author: DhiyaneshDk
|
|
severity: high
|
|
reference:
|
|
- https://nmap.org/nsedoc/scripts/mysql-databases.html
|
|
metadata:
|
|
verified: true
|
|
max-request: 16
|
|
shodan-query: "port:3306"
|
|
tags: js,mysql,network,enum
|
|
javascript:
|
|
- pre-condition: |
|
|
isPortOpen(Host,Port);
|
|
code: |
|
|
let m = require('nuclei/mysql');
|
|
let c = m.MySQLClient();
|
|
let response = c.ExecuteQuery(Host,Port,User,Pass,Query);
|
|
Export(response);
|
|
|
|
args:
|
|
Host: "{{Host}}"
|
|
Port: "3306"
|
|
Query: "show databases;"
|
|
User: "{{usernames}}"
|
|
Pass: "{{passwords}}"
|
|
|
|
payloads:
|
|
usernames:
|
|
- root
|
|
- admin
|
|
- mysql
|
|
- test
|
|
passwords:
|
|
- root
|
|
- admin
|
|
- mysql
|
|
- test
|
|
attack: clusterbomb
|
|
|
|
stop-at-first-match: true
|
|
matchers:
|
|
- type: dsl
|
|
dsl:
|
|
- "success == true"
|
|
|
|
extractors:
|
|
- type: json
|
|
part: response
|
|
json:
|
|
- .Rows[] | .Database
|
|
# digest: 490a0046304402202563a2452c93e9c0bd70cade15e7796d5ae57b417a1eb2b9a033376334757bff02200e6107069bad9ac71cbf78d57c46be60338e0bf242b93dc37ba0fa343fcefb67:922c64590222798bb761d5b6d8e72950 |