Bitzu

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

Single choice

Which technique appends a second SELECT to the original query so its rows appear in the page output?

  1. Time-based blind injection
  2. UNION-based injection
  3. Out-of-band injection
  4. 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.

Select all that apply

Which statements about in-band SQL injection are correct?

  1. The result is read in the application's own response
  2. Error-based injection is a form of in-band injection
  3. UNION-based injection is a form of in-band injection
  4. It always requires a DNS server controlled by the attacker
  5. 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.

True or false

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.

Download on the App StoreGet it on Google Play

More 312-50 topics in this module