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

555-1); waitfor delay '0:0:15' --

Нейросеть17 июня 2026 22:46

That string is a classic time-based SQL injection payload aimed at SQL Server.

What it does conceptually:

  • The input ends the previous statement with 555-1); so the application would have been building a SQL statement by string concatenation.
  • It then executes WAITFOR DELAY '0:0:15', which causes the database to pause for 15 seconds.
  • The trailing -- comments out the rest of the line, so any following part of the original query is ignored.

Why this matters:

  • If user input is concatenated into SQL without proper parameterization, an attacker can cause delays (and in other cases exfiltrate data or modify data). This is a time-based blind SQL injection technique.

Defenses (exam/real-world tips):

  • Use parameterized queries / prepared statements everywhere. Do not concatenate user input into SQL strings.
    • Examples:
      • In Python (psycopg2): cursor.execute("SELECT * FROM users WHERE phone = %s", (user_input,))
      • In Java (PreparedStatement): PreparedStatement ps = conn.prepareStatement("SELECT ... WHERE phone = ?");
  • Avoid dynamic SQL whenever possible; prefer static queries with parameters.
  • Validate and sanitize input (e.g., enforce types/formats like digits for phone numbers).
  • Apply least privilege to the DB account used by the app (limit permissions, disable dangerous operations).
  • Use proper error handling to avoid leaking DB error details.
  • Consider a WAF or code scanners that detect injection patterns.
  • In tests, use a secure lab with permission and avoid testing on production systems.

If you want, I can show a quick side-by-side comparison (unsafe concatenation vs. safe parameterization) in a language of your choice.

555-1); waitfor delay '0:0:15' --
That string is a classic time-based SQL injection payload aimed at SQL Server. What it does conceptually: - The input ends the previous statement with 555-1); so the application would have been building a SQL statement by string concatenation. - It then executes WAITFOR DELAY '0:0:15', which causes the database to pause for 15 seconds. - The trailing -- comments out the rest of the line, so any following part of the original query is ignored. Why this matters: - If user input is concatenated into SQL without proper parameterization, an attacker can cause delays (and in other cases exfiltrate data or modify data). This is a time-based blind SQL injection technique. Defenses (exam/real-world tips): - Use parameterized queries / prepared statements everywhere. Do not concatenate user input into SQL strings. - Examples: - In Python (psycopg2): cursor.execute("SELECT * FROM users WHERE phone = %s", (user_input,)) - In Java (PreparedStatement): PreparedStatement ps = conn.prepareStatement("SELECT ... WHERE phone = ?"); - Avoid dynamic SQL whenever possible; prefer static queries with parameters. - Validate and sanitize input (e.g., enforce types/formats like digits for phone numbers). - Apply least privilege to the DB account used by the app (limit permissions, disable dangerous operations). - Use proper error handling to avoid leaking DB error details. - Consider a WAF or code scanners that detect injection patterns. - In tests, use a secure lab with permission and avoid testing on production systems. If you want, I can show a quick side-by-side comparison (unsafe concatenation vs. safe parameterization) in a language of your choice.