2024-03-09 14:23:42 +00:00
|
|
|
id: mysql-show-databases
|
|
|
|
|
|
|
|
info:
|
|
|
|
name: MySQL - Show Databases
|
|
|
|
author: DhiyaneshDk
|
|
|
|
severity: high
|
|
|
|
reference:
|
|
|
|
- https://nmap.org/nsedoc/scripts/mysql-databases.html
|
|
|
|
metadata:
|
|
|
|
shodan-query: port:3306
|
|
|
|
verified: true
|
2024-03-22 10:10:06 +00:00
|
|
|
tags: js,mysql,network,enum
|
2024-03-09 14:23:42 +00:00
|
|
|
|
|
|
|
javascript:
|
|
|
|
- code: |
|
|
|
|
let m = require('nuclei/mysql');
|
|
|
|
let c = m.MySQLClient();
|
|
|
|
let response = c.ExecuteQuery(Host,Port,User,Pass,Query);
|
2024-03-09 18:32:19 +00:00
|
|
|
Export(response);
|
2024-03-09 14:23:42 +00:00
|
|
|
|
|
|
|
args:
|
|
|
|
Host: "{{Host}}"
|
|
|
|
Port: "3306"
|
|
|
|
Query: "show databases;"
|
|
|
|
User: "{{usernames}}"
|
|
|
|
Pass: "{{passwords}}"
|
|
|
|
|
|
|
|
payloads:
|
2024-03-22 10:10:06 +00:00
|
|
|
usernames:
|
|
|
|
- root
|
|
|
|
- admin
|
|
|
|
- mysql
|
2024-03-22 14:11:12 +00:00
|
|
|
- test
|
2024-03-22 10:10:06 +00:00
|
|
|
passwords:
|
|
|
|
- root
|
|
|
|
- admin
|
2024-03-22 14:11:12 +00:00
|
|
|
- mysql
|
|
|
|
- test
|
2024-03-22 10:10:06 +00:00
|
|
|
attack: clusterbomb
|
2024-03-09 14:23:42 +00:00
|
|
|
|
2024-03-22 10:10:06 +00:00
|
|
|
stop-at-first-match: true
|
2024-03-09 14:23:42 +00:00
|
|
|
matchers:
|
|
|
|
- type: dsl
|
|
|
|
dsl:
|
|
|
|
- "success == true"
|
|
|
|
|
|
|
|
extractors:
|
|
|
|
- type: json
|
|
|
|
part: response
|
|
|
|
json:
|
2024-03-23 09:23:23 +00:00
|
|
|
- .Rows[] | .Database
|
|
|
|
# digest: 4a0a00473045022052a265f7701073fa5a4cea999e0f8ec7611065fb6356605d89e68743c7c316210221008c8258c61ea980b08339c7354210eaa426c4c3e2f3c0f6725044b8b020534a30:922c64590222798bb761d5b6d8e72950
|