Skip to content
SQL injection Write-up Intermediate

Mysql Packet Injection

An attacker on the same local network used ARP spoofing to sit between a MySQL client and server, then rewrote a query in transit. When the client sent a SHOW DATABASES statement, the tool replaced it with a CREATE DATABASE statement, which the server executed.

S12 - 0x12Dark Development Follow

Published on systemweakness.com

Hello, welcome to my new article, today I am going to show you how to manipulate and inject SQL commands in a MySQL database. It is a very interesting article, I hope you like it.

S12 - 0x12Dark Development, on systemweakness.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the MySQL connection was unencrypted, so anyone positioned on the network path could read and rewrite queries in transit.

Impact

An attacker positioned on the network could rewrite queries and, as the author claims, potentially dump an entire database.

What the attacker needed

Attacker on the same local network; unencrypted MySQL traffic; ability to ARP spoof the client and server

How it was found

  1. Set up a MySQL server and a HeidiSQL client on the same network.
  2. Run ARP spoofing from the attacker machine to intercept traffic between client and server.
  3. Load the MySQL manipulation module in the tool.
  4. Configure the query to match and the replacement query to send.
  5. Run the attack and send the original query from the client.
  6. Observe that the replacement query was executed on the server.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A database server and its client talk over the network, and on a local network an attacker can trick both machines into sending their traffic through the attacker's computer. This is called ARP spoofing, and it lets the attacker read and change messages in the middle. Here the attacker changed a harmless query into one that created a new database on the server.

What is SQL injection?

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.

More by S12 - 0x12Dark Development

View all

13 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

SQL injection

The lesson behind this report.

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.