MariaDB version misleading if host is not allowed
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- mariadb
- Ambito
- networking
Direzione di ricerca
The bad match rules are the two match mysql lines near 2234-2236 of the nmap-service-probes file, which key the MariaDB version range on a single byte of the 'not allowed to connect' error packet. Compare that byte against the hexdump the reporter describes for a recent MariaDB server, and check whether a version scan can still tell the versions apart. Done means the unauthorized case no longer reports a version range that the byte cannot support, verified by a -sV scan against a MariaDB server that blocks the scanning host.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
An nmap version scan (-sV) can produce wrong/misleading version information for MariaDB servers in some cases. If the MariaDB server has no user configured that is allowed to connect from the scanning host (message Host 'XX.XX.XX.XX' is not allowed to connect to this MariaDB server), then the version scan reports MariaDB 10.3.23 or earlier (unauthorized), which is misleading.
The source of this issue likely lies in nmap-service-probes, lines 2234-2236:
match mysql m|^.\0\0\0\xff..Host .* is not allowed to connect to this MariaDB server$|s p/MariaDB/ v/10.3.23 or earlier/ i/unauthorized/ cpe:/a:mariadb:mariadb/
# https://jira.mariadb.org/browse/MDEV-21101
match mysql m|^.\0\0\x01\xff..Host .* is not allowed to connect to this MariaDB server$|s p/MariaDB/ v/10.3.24 or later/ i/unauthorized/ cpe:/a:mariadb:mariadb/
The distinction was done based on one byte being 0x00 in version 10.3.23 and before and 0x01 from version 10.3.24 onwards. However, the byte's value got reverted back to 0x00 some time before MariaDB version 10.6.28, which is still the case for the most recent versions.
(Note that I wasn't able to determine exactly when this was changed, I only noticed it being the case in version 10.6.28 and later. If I find time, I will have a closer look at this.)
To Reproduce
- Set up a MariaDB server of a recent version, e.g. in a VM
- Make sure that no user is allowed to connect from the remote host
- Perform a version scan:
nmap -sV -p 3306 <host> - Perhaps, double check with
nc <host> 3306 | hexdump -Cthat the first few bytes arexx 00 00 00instead ofxx 00 00 01
Expected behavior
From what I can tell, there is no way to accurately determine the MariaDB version in recent versions if the scanning host is blocked. nmap should report the version accordingly, or that the version could not be reliably determined.
Version info (please complete the following information):
- OS: all
- Output of
nmap --version: 7.99
- Lingua principale
- C
- Stelle
- 14.1k
- Fork
- 3k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nmap/nmap
-
Scan progress and ETC undercount retransmissions since 7.99x (stuck at 99.99% with --max-retries 0)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
make check-zenmap reports success regardless of test resultsForse già presa @gargamel778 l’ha presa 67 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
BSD Nmap question
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
bug severity: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
AlessandroSangiuliano/Uros#1014 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
micropython/micropython#20020 ·
I maintainer di solito rispondono entro 1 giorno
-
macro typo in readmeAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
severity: low
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
luainkernel/lunatik#2727 ·
I maintainer di solito rispondono entro 1 giorno