Detect HTTP Basic Auth Brute Force Against Admin Endpoints in Apache Error Logs
Published
MITRE ATT&CK: T1110.001T1110.003
Sigma Rule
title: Apache mod_auth_basic Brute Force Against Protected Endpoint
id: 542b7b94-6904-4213-9a57-260875d7d55b
status: experimental
description: >
Detects a burst of HTTP Basic authentication failures logged by mod_auth_basic
(AH01617 password mismatch, AH01618 user not found) from a single client
against a protected Apache path within a short window — the signature of a
brute-force or username-enumeration attack against an admin login.
references:
- https://httpd.apache.org/docs/2.4/mod/mod_auth_basic.html
- https://attack.mitre.org/techniques/T1110/001/
author: LogTriage
date: 2026/11/09
logsource:
product: apache
service: error
detection:
selection:
message|contains:
- 'AH01617'
- 'AH01618'
timeframe: 5m
condition: selection | count() by client >= 10
falsepositives:
- A user repeatedly mistyping their password against a protected admin path
- Many users behind a shared NAT or proxy egress IP hitting the same protected path
level: high
tags:
- attack.credential_access
- attack.t1110.001
- attack.t1110.003
1 · Each event is compared with one selection. Every field in a selection must match; listed values are alternatives.
- message contains any of
AH01617AH01618
2 · An event counts when
selection
3 · Then
Count matching events for each client within 5 minutes; it alerts at at least 10.
apache_error_attack.log, silent on apache_error_normal.log — both in the public sample dataset ↗︎ What this rule detects
Apache’s mod_auth_basic module logs two specific error IDs when HTTP Basic authentication
fails: AH01617 (“user %s: authentication failure … Password Mismatch”) when a real account
name is tried with the wrong password, and AH01618 (“user %s not found”) when the username
itself does not exist. A single occurrence of either is unremarkable. A rapid burst of both from
one client against the same protected path is a brute-force or username-enumeration attack
working through an admin login.
This rule fires when a single client produces 10 or more AH01617/AH01618 failures within 5 minutes.
Detection logic
The selection matches on the literal error codes AH01617 and AH01618, which Apache writes
unchanged regardless of site configuration — unlike the log level prefix, which varies with
LogLevel and should not be relied on for matching.
The condition groups by client and sets a 5-minute window: selection | count() by client >= 10. Counting is essential here — one failed Basic-auth attempt is routine, but a sustained burst
from the same source against the same restricted path is not. Grouping by client (the [client IP:port] field Apache writes on every error line) isolates one attacker’s session from unrelated
background noise.
Validated against a real sample
Validated against apache_error_attack.log, which contains a tight burst from 203.0.113.50
against /admin/: starting at 04:02:11 with eight AH01617 (“Password Mismatch”) attempts against
the admin account, then switching to AH01618 (“user not found”) across the usernames root,
administrator, test, backup and webmaster, and closing with one more AH01617 against
admin — 25 failure lines in about 20 seconds, all from the same client. The rule fires on this
burst.
It stays silent on apache_error_normal.log, which contains exactly one AH01617 line (a user
named editor mistyping a password once) — a single failure, far below the 10-in-5-minutes
threshold, from a different client (192.0.2.44) than any repeated pattern.
False positives
A user who mistypes a password a few times in a row against a protected admin path can produce a
small number of AH01617 lines; this stays under the threshold unless it happens at automation
speed. The more persistent false positive is many legitimate users sharing one egress IP — a
corporate proxy or NAT gateway — all authenticating against the same protected path, which
collapses to a single client value in the error log and can accumulate failures faster than
expected. If that is routine in your environment, raise the threshold or widen the window rather
than disabling the rule.
Frequently Asked Questions
- Why count failures instead of alerting on the first AH01618?
- A single 'user not found' or 'password mismatch' line is routine noise — anyone can mistype a password once. What makes this an attack is volume from one source in a short window: the sample shows 25 of these lines from a single client in about 20 seconds, cycling through admin, root, administrator, test, backup and webmaster. The count-by-client threshold is what separates a typo from a credential attack.
- Why combine AH01617 and AH01618 in one selection instead of two rules?
- They are two outcomes of the same attack. AH01617 (password mismatch) fires when the attacker tries a real account name with a wrong password; AH01618 (user not found) fires when they guess a username that does not exist. The sample log shows the attacker starting on 'admin' with repeated AH01617, then rotating through other usernames and landing mostly on AH01618. Splitting these into separate rules would just split one brute-force burst into two smaller, less convincing alerts.
- How should the threshold and window be tuned?
- 10 failures in 5 minutes from one client is a conservative floor; an automated tool typically produces far more than that, as the sample does with 25 in 20 seconds. If your admin path sits behind a shared NAT or VPN concentrator, raise the threshold or the window to avoid flagging a handful of real users who happen to mistype their passwords around the same time.
- Does this rule cover other things in the sample log, like the SQL injection or path traversal attempts?
- No, and intentionally so. The same attack session also probed for /.env, /.git/config and /etc/passwd, and separately triggered a SQL injection error in search.php. Those are different behaviors with different detection logic and deserve their own rules; folding them into a brute-force count-by-client rule would weaken the signal this rule is built to catch.
Related Resources
Reference
- Apache Error Log Format: field reference → every field explained, with real sample records
- Paste one record and see what each field means → free, runs in your browser
See this detection run on a real report
Try the live demo with a pre-loaded malicious log set — no signup required — or upload your own log file and get a full AI-reviewed threat report in minutes.