MariaDB version misleading if host is not allowed
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- mariadb
- 領域
- networking
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- C
- スター
- 14k
- フォーク
- 3k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nmap/nmap のほかの issue
-
Scan progress and ETC undercount retransmissions since 7.99x (stuck at 99.99% with --max-retries 0)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
make check-zenmap reports success regardless of test results対応中かも @gargamel778 が 67 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
BSD Nmap question
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
bug severity: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
AlessandroSangiuliano/Uros#1014 ·
-
severity: low
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
luainkernel/lunatik#2727 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 6 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
bot-triaged module: cuda module: memory usage module: pybind module: tensor creation triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pytorch/pytorch#206707 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信