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

(select(0)from(select(sleep(15)))v)/*'+(select(0)from(select(sleep(15)))v)+'"+(select(0)from(select(sleep(15)))v)+"*/

Ответ нейросети
17 июня 2026 22:34

It looks like you posted a time-based blind SQL injection payload. I can’t help with exploiting systems, but I can explain what it does and how to defend against it for exam prep.

What the payload is doing (high level)

  • It uses a database sleep/delay function (sleep(15)) inside a subquery to pause the database response for about 15 seconds.
  • If the application is vulnerable to SQL injection and the input is unsafely concatenated into a query, an attacker can cause the database to sleep, which they detect by measuring response time.
  • The surrounding syntax (comments like /* … */ and quote-delimiter tricks) aims to break out of the intended query context and inject the subquery, potentially bypassing naive input sanitization.

Key concepts you should know for exams

  • Time-based blind SQL injection (TB-SQLi): relies on conditional delays to infer information when no data is returned directly.
  • Boolean-based blind SQL injection: relies on true/false responses to infer data from the database.
  • Why this works: poor input handling, dynamic SQL string building, and lack of parameterization.

Defensive practices to learn (exam-ready)

  • Use parameterized queries (prepared statements) everywhere:
    • Examples (conceptual):
      • Python (psycopg2): cursor.execute("SELECT * FROM users WHERE id = %s", (user_id,))
      • Java: PreparedStatement ps = conn.prepareStatement("SELECT * FROM users WHERE id = ?"); ps.setInt(1, userId);
      • PHP (PDO): $stmt = $pdo->prepare("SELECT * FROM users WHERE id = :id"); $stmt->execute(['id' => $userId]);
  • Avoid string concatenation to build SQL queries; never insert user input directly into SQL.
  • Enable least-privilege database accounts (apps should not connect with an account that has more permissions than needed).
  • Disable or limit multiple statements per query if supported by the DB engine.
  • Validate and canonicalize inputs:
    • For numeric fields, enforce numeric ranges.
    • Use allow-lists where possible.
    • Use ORM/abstraction layers that handle parameterization correctly.
  • Use proper error handling to avoid exposing database error details to users.
  • Consider additional protections:
    • Web Application Firewall (WAF) with SQLi-coverage rules (as a supplement, not a sole defense).
    • Logging and intrusion detection to monitor suspicious query patterns and latency anomalies.
  • Practice in safe labs:
    • OWASP Juice Shop, DVWA, WebGoat, or other intentionally vulnerable apps in a controlled environment.

If you want, I can tailor a quick exam-style study note or provide language-specific secure coding examples to replace risky patterns. Would you like that for a particular language or framework?