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-27304-PoC — PoC of "DEF CON 32 - SQL Injection Isn't Dead Smuggling Queries at the Protocol Level - Paul Gerste" | Kitploit
Tools/GitHubGitHub/roaris/cve-2024-27304-poc
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingDatabase Security
GitHubroaris/cve-2024-27304-poc

CVE-2024-27304-PoC

PoC of "DEF CON 32 - SQL Injection Isn't Dead Smuggling Queries at the Protocol Level - Paul Gerste"

View Repository
1211 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

CVE-2024-27304-PoC

references

  • DEF CON 32 - SQL Injection Isn't Dead Smuggling Queries at the Protocol Level - Paul Gerste
  • pgx SQL Injection via Protocol Message Size Overflow

webapp

A simple web application with login functionality. Only administrators can log in.

This application uses PostgreSQL and pgx v5.5.3 (vulnerable version).

The attacker attempts to log in by maliciously inserting records into the users table. However, since placeholders are used, traditional SQL injection does not work.

exploit

PostgreSQL Message Formats: https://www.postgresql.org/docs/17/protocol-message-formats.html

The exploit depends on the message format that pgx sends to the database server when executing SQL. By default, pgx sends a prepared statement with P(Parse) and then sends parameters with B(Bind).

If the following configuration is set, pgx sends the interpolated query with Q(Query):

root@kitploit:~
cfg.ConnConfig.DefaultQueryExecMode = pgx.QueryExecModeSimpleProtocol

You can view the actual messages using tcpdump with the -X option.

scripts

  • Q_simple.py: Causes overflow with Q(Query). Assumes the attacker has complete knowledge of the query being executed (if black-box, bruteforce is required).
  • Q_nop_sled.py: Causes overflow with Q(Query). Succeeds in exploitation within 5 attempts.
  • B_simple.py: Causes overflow with B(Bind). Assumes the attacker has complete knowledge of the query being executed (in my opinion, B(Bind) exploitation is difficult in black-box scenarios).

Notes

  • A large amount of memory is required to successfully execute the exploit.
  • This exploit sends an extremely large payload and may cause a DoS. As mentioned in the video, do not execute this exploit against third-party systems.
Download Tool