Skip to content
SQL injection Write-up Beginner

Php-Stats 0.1.9.2 (php-stats.recjs.php) Multiple SQL Injection Vulnerabilities

The php-stats.recjs.php script in Php-Stats [redacted] passed the ip and t parameters into SQL commands without proper handling. A remote attacker could use these parameters to run arbitrary SQL commands against the database.

karmainsecurity.com

Published on karmainsecurity.com

Multiple SQL injection vulnerabilities in php-stats.recjs.php in Php-Stats 0.1.9.2 allow remote attackers to execute arbitrary SQL commands via the (1) ip or (2) t parameter.

The author, on karmainsecurity.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 script built SQL queries by joining the ip and t request parameters directly into the query string without escaping or parameterisation.

Impact

An attacker could execute arbitrary SQL commands, which may let them read, alter or delete data in the application's database.

What the attacker needed

Network access to the php-stats.recjs.php script

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 web page often takes values from a visitor and puts them into a database query. If those values are not handled safely, a visitor can type database instructions instead of a normal value, and the database will run them. Here two values sent to a statistics script could be abused this way, letting someone read or change data in the database.

What is SQL injection?

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

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.