Web/SQL Application Logs: SQL Error Strings Indicative of Injection Probing
Flags SQL error log messages with injection-probing syntax/quoting/UNION mismatch keywords.
- Product
- sql
- Category
- application
- Author
- Bjoern Kimminich (SigmaHQ), DRL 1.1
- Published
- 2017-11-27
- Updated
- 2026-07-31
ATT&CK techniques
Initial AccessRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule matches application SQL error messages that commonly appear when an attacker probes for SQL injection (e.g., unterminated quotes, SQL syntax errors, and UNION-related column count mismatches). Such errors can be triggered by crafted inputs used to test whether database queries are susceptible to injection. It relies on application logs from SQL-producing systems containing the specific error text captured by the rule keywords.
Reporting behind it
Changelog
v5- v5Candidate ingested via manual entry.2026-07-31
- v4Candidate ingested via manual entry.2026-07-31
- v3Candidate ingested via manual entry.2026-07-31
- v2Candidate ingested via manual entry.2026-07-31
- v1No changelog recorded for this version.2026-07-30
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: "Web/SQL Application Logs: SQL Error Strings Indicative of Injection Probing"
id: b08f4092-77ef-4691-a2e0-f29f5b1f199d
status: test
description: This rule matches application SQL error messages that commonly appear when an attacker probes for SQL injection (e.g., unterminated quotes, SQL syntax errors, and UNION-related column count mismatches). Such errors can be triggered by crafted inputs used to test whether database queries are susceptible to injection. It relies on application logs from SQL-producing systems containing the specific error text captured by the rule keywords.
references:
- http://www.sqlinjection.net/errors
- https://github.com/SigmaHQ/sigma/blob/master/rules/application/sql/app_sqlinjection_errors.yml
author: Bjoern Kimminich, Huntrule Team
date: 2017-11-27
modified: 2023-02-12
tags:
- attack.initial-access
- attack.t1190
logsource:
category: application
product: sql
definition: "Requirements: application error logs must be collected (with LOG_LEVEL ERROR and above)"
detection:
keywords:
- quoted string not properly terminated
- You have an error in your SQL syntax
- Unclosed quotation mark
- 'near "*": syntax error'
- SELECTs to the left and right of UNION do not have the same number of result columns
condition: keywords
falsepositives:
- A syntax error in MySQL also occurs in non-dynamic (safe) queries if there is an empty in() clause, that may often be the case.
level: high
license: DRL-1.1
related:
- id: 8a670c6d-7189-4b1c-8017-a417ca84a086
type: derived