SQL Injection (SQLi) - Complete Notes
Table of Contents
Tooling & Fuzzing
Classic Bypass
Comment Variations
In-line Query Bypass (useful for blind/in-band checks)
SQLi Filtering Bypass
Retrieve All Data (GET parameter example)
Discovery Workflow (OffSec Flow)
Step 1 : Find the Number of Columns
Step 2 : Identify Which Columns Are Displayed
Step 3 : Enumerate DB Name, User, Version
Step 4 : Enumerate Tables
Step 5 : Dump Target Table
Database Fingerprinting
Enumeration - Schemas / Databases
Enumeration — Tables
Targeted / Multi-column Examples
Enumeration — Columns
Multi-column Examples
Data Extraction / Dumping
Concatenation (useful when only 1 column reflects)
Specific Target (password for admin)
File Read with LOAD_FILE
Check Privileges First
Read Files
Hex-Encode Output (bypass filters / display issues)
File Write & RCE via SELECT INTO OUTFILE (MySQL)
Check Write Access
Write a PHP Web Shell
Trigger the Web Shell
Write to Other Locations
Split Write (bypass WAF / length restrictions)
Test Write (verify shell landed)
Execute OS Commands via UDF
MSSQL — xp_cmdshell RCE
Capture NetNTLM Hash via UNC Path (Responder)
Enable xp_cmdshell (requires DBA/sysadmin)
One-Liner Enable + Execute (Inject into SQL parameter)
PowerShell Reverse Shell via xp_cmdshell
References:
Resource
Link