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

555-1 OR 156=(SELECT 156 FROM PG_SLEEP(15))--

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

That looks like a time-based SQL injection payload, specifically for PostgreSQL.

What it is doing (high level):

  • pg_sleep(15) pauses the database for 15 seconds.
  • The expression 156 = (SELECT 156 FROM pg_sleep(15)) is a trick to turn a boolean condition into a delay—if the surrounding query evaluates to true, the database sleeps.
  • The OR and the trailing comment (-- ) are typical injection tactics to force the rest of the original query to be ignored, allowing the injected condition to run.

Important note: Using or testing this kind payload on systems you don’t own or don’t have explicit authorization to test is illegal and unethical. If you’re studying for an exam, focus on the defensive side.

Defensive takeaways (how to protect against this kind of payload):

  • Use parameterized queries (prepared statements) and bind variables instead of string-concatenating user input into SQL.
    • Example concept (language-agnostic): query = "SELECT * FROM users WHERE phone = ?"; bind(user_input)
  • Employ input validation and whitelisting (reject unusual characters or formats for fields like phone numbers).
  • Follow the principle of least privilege: the DB user used by the application should have only the necessary SELECT/INSERT/UPDATE privileges, not broader rights.
  • Avoid exposing error details to users; log them server-side for analysis without leaking SQL details.
  • Consider using an ORM that properly parameterizes queries.
  • Use a Web Application Firewall (WAF) with SQL injection rules and maintain up-to-date security patches.
  • Regular security testing in a controlled environment (e.g., use intentionally vulnerable apps like OWASP WebGoat, DVWA) to learn defenses without risking real systems.

If you want, I can show safe, concrete examples of parameterized queries in a language you’re studying (Python, Java, Node.js, etc.) or outline a simple test plan for a lab environment.