iis_shortnames: false positives behind nondeterministic CDN/WAF responses

Open
#3,562 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 2 days

@liquidsec is already working on this.

Since Oct 21, 2026.

Assessment

This issue has not been assessed yet.

Description

bug

Summary

iis_shortnames produces false positive detections, and with detect_only: false it goes on to "enumerate" garbage shortnames, when the target sits behind a CDN/WAF whose responses are nondeterministic. The status codes being compared are generated by the edge, not by IIS, so any status flip between the control and test requests gets read as the shortname oracle.

Observed behavior

Two patterns, both on non-IIS targets:

  • Akamai: every response carries Server: AkamaiGHost. The same URL alternates between a 403 "Access Denied" WAF page, a 500 "Internal Server Error - Read" (origin read timeout) page, and tarpitted connections that hang until timeout. A single payload like *E*~1*/a.aspx can return 500 once and then time out three times in a row.
  • Cloudflare (managed challenge): early requests pass through to the origin, then Cloudflare starts serving a 403 "Just a moment..." challenge page with cf-mitigated: challenge. Response times swing between tens of milliseconds and ~11 seconds.

Why exploitation produces garbage

Once detect() settles on an affirmative status code (e.g. 403), every request in solve_valid_chars that happens to land on a WAF 403 counts as a confirmed character. The only sanity check is len(confirmed_chars) >= len(valid_chars) - 4, which catches "everything matched" but not "a random third matched". The recursive solver then builds shortnames out of that noise and emits them as URL_HINTs.

Related bugs in the module

  1. solve_shortname_recursive builds its batch kwargs as {"method": method} only, with no allow_redirects=False, timeout, or retries. detect() and solve_valid_chars both disable redirects, so the recursive solver compares a post-redirect status against an affirmative code recorded without following redirects.
  2. In the "HTTP Body Error Message" branch of detect(), the detection tuple is appended before technique is assigned, so it is recorded with technique=None.
  3. get_waf_strings() doesn't cover the Cloudflare managed challenge ("Just a moment...") or the Akamai Access Denied page, and iis_shortnames doesn't use it at all.

Proposed fix

  1. Reject edge-generated responses: treat responses matching get_waf_strings() (extended with the Cloudflare challenge and Akamai pages, plus a header check for cf-mitigated) as non-signals in both detect() and every exploitation comparison, the same way 502/503/504 are already skipped. Extending the shared list also benefits http, webbrute, bypass403, etc.
  2. Stability check during exploitation: before recursing, re-test each confirmed character along with a random control that cannot exist. Drop characters that don't reproduce, and abort if the control ever comes back affirmative. This is the generic defense against noise that no fingerprint list will fully cover.
  3. Consistent request kwargs across all request sites, and fix the technique ordering bug.
  4. Tests: mock a server that returns a random mix of WAF 403s and 500s, and assert no FINDING and no URL_HINT are produced. The existing positive test should continue to pass.
Dominant language
Python
Stars
10.9k
Forks
959
Avg merge
2d 7h
Merged PRs (30d)
84

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from blacklanternsecurity/bbot

All issues in blacklanternsecurity/bbot

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.