LOGBOOK

HELP

Quiz Entry - updated: 2026.11.26

Why does the SQL-injection rule (quote followed by "or") not fire when only a single quote is entered, and how would you alert on the quote alone?

Because the pattern requires the quote to be followed by "or"; a lone quote does not match. To alert on it, drop the "or" part and match only ((\%27)|(\')).

The regex encodes a sequence: quote, then o, then r. A password field containing just ' (sent as %27) has the quote but nothing after it, so the regex fails and no alert is raised, even though the application has just been shown to be injectable. When the full 'or'1'='1 is entered, the quote is directly followed by or, so the same rule fires.

To catch the probe itself, a simpler pattern is enough:

pcre:"/((\%27)|(\'))/i";

But consider what that means: an apostrophe is completely normal in names (O'Brien), search terms and text in any language. A rule alerting on every quote on all traffic would drown analysts in false positives. In practice it would be limited to specific parameters, combined with other indicators such as -- or # after the quote, or given a low priority. Rule design always weighs coverage against noise.

Go deeper:

From Quiz: ISLAB / Network Security Monitoring | Updated: Nov 26, 2026