312-50 ยท SQL injection
In-band SQL injection
Error-based and UNION-based injection, authentication bypass patterns, and reading query results directly.
Key points
- In-band: payload and result use the same channel, the application's own response.
- Error-based: forces the database to put data into an error message.
- UNION-based: appends a UNION SELECT matching the original column count and types; extra rows appear in the page.
- Authentication bypass: always-true conditions or comment markers neutralise the password check.
Practice questions
Which technique appends a second SELECT to the original query so its rows appear in the page output?
- Time-based blind injection
- UNION-based injection
- Out-of-band injection
- Second-order injection
Show answer
Answer: B. UNION-based injection
UNION-based injection merges result sets. Time-based blind injection reads nothing directly, and out-of-band uses a separate channel.
Which statements about in-band SQL injection are correct?
- The result is read in the application's own response
- Error-based injection is a form of in-band injection
- UNION-based injection is a form of in-band injection
- It always requires a DNS server controlled by the attacker
- It works only when the page shows nothing
Show answer
Answer: A. The result is read in the application's own response, B. Error-based injection is a form of in-band injection, C. UNION-based injection is a form of in-band injection
In-band reads results directly in the response, and both error-based and UNION-based belong to it. Out-of-band needs a separate channel, and time delays characterise blind injection.
A login bypass only works if the attacker already knows a valid username and password.
Show answer
Answer: False
False. Bypass patterns make the WHERE condition true or comment out the password check, so no valid credentials are needed when the query is built unsafely.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
