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

555-1 OR 788=(SELECT 788 FROM PG_SLEEP(58.446))--

Ответ нейросети
18 июня 2026 04:50

That looks like a SQL injection payload, specifically a time-based (delay-based) attack designed for PostgreSQL.

What it does, in simple terms:

  • The attacker tries to inject into a query a condition that will force the database to sleep for a while (58.446 seconds here) using PostgreSQL’s pg_sleep.
  • The part 555-1 is just a numeric expression used to fit the injection into the surrounding query (likely as part of a WHERE clause).
  • OR is a boolean operator that tries to extend the attack so the overall condition becomes true, or at least delays the response.
  • (SELECT 788 FROM PG_SLEEP(58.446)) is the core: it causes the database to sleep for about 58 seconds, and, in many formulations, the subquery is crafted so that the comparison 788 = (that subquery) becomes true after the delay.
  • The trailing -- comments out the rest of the original query so the injected payload isn’t interrupted by the original query syntax.

Key implications:

  • If the application is vulnerable, an attacker can cause a noticeable delay (about 58 seconds) and use that timing to infer characteristics about the database or the query, which is a step in time-based blind SQL injection.
  • It’s not about returning data here, but about delaying the response to reveal vulnerability and to perform further inference.

Defensive notes (exam-relevant):

  • Use parameterized queries / prepared statements. Do not interpolate user input directly into SQL.
  • Apply least-privilege access for the application database user (restrict functions like pg_sleep if possible).
  • Validate and sanitize inputs, and use ORM/query builders that handle parameters safely.
  • Disable or tightly control usage of dangerous functions (like pg_sleep) in production, or run them with restricted privileges.
  • Implement input validation, error handling, and proper logging. Consider a Web Application Firewall (WAF) and regular vulnerability scanning.
  • For testing in exams or labs, use safe, controlled environments (DVWA, WebGoat, or dedicated test databases) and obtain explicit permission.

If you’re studying for an exam, you might compare:

  • Time-based (this example) vs boolean-based vs error-based SQL injection.
  • How pg_sleep differs from MySQL’s SLEEP() and how the exact syntax varies by database.