Новая Школа - онлайн-школа подготовки к ЕГЭ
Задача Задача №3622856
А
Аноним
18 июня 2026 10:58 · публичный вопрос
А
Аноним

(select concat(0x3a,char(64),char(52),char(51),char(55),char(48),char(49),DATABASE(),char(64),char(49),char(48),char(55),char(51),char(52)))

Ответ нейросети
18 июня 2026 10:58

Here's what that SQL fragment does and what string it builds.

What the expression contains (decoded):

  • 0x3a -> ":" (colon)
  • char(64) -> "@"
  • char(52) -> "4"
  • char(51) -> "3"
  • char(55) -> "7"
  • char(48) -> "0"
  • char(49) -> "1"
  • DATABASE() -> the current database name
  • char(64) -> "@"
  • char(49) -> "1"
  • char(48) -> "0"
  • char(55) -> "7"
  • char(51) -> "3"
  • char(52) -> "4"

Concatenating in order yields: ":" + "@" + "43701" + DATABASE() + "@" + "10734"

So the result is the string: :@"@43701@10734"

More concretely, if the current database is, for example, "school":

  • Result would be ":@43701school@10734"

Notes:

  • This looks like a basic SQL injection/test payload to reveal the current database name by exporting it as part of a constructed string.
  • It uses ASCII/HEX literals and the DATABASE() function to leak information in a single concatenated string.

If you’re studying for an exam, you might also mention defensive measures:

  • Use prepared statements and parameterized queries.
  • Validate and sanitize inputs.
  • Apply strict privileges (the application user should have limited access).
  • Consider input-output encoding and SQL injection defenses (e.g., ORM protections, WAF rules).