Files
sif/modules/recon/webconfig-exposure.yaml
T
TigahandGitHub c6741e0f16 feat(modules): add htpasswd, web.config and htaccess exposure modules (#202)
modules/recon/htpasswd-exposure.yaml flags an exposed htpasswd file on a line
that holds a recognised password hash, an apache md5, a bcrypt, a sha crypt or
a {SHA} digest, then extracts the user. matching the hash format keeps a line
that holds a plaintext value from being reported.

modules/recon/webconfig-exposure.yaml flags an exposed asp.net web.config on the
configuration root paired with a dotnet section, then extracts a connection
string, the value that carries the database server and password.

modules/recon/htaccess-exposure.yaml flags an exposed htaccess file on its
apache directives and extracts the AuthUserFile path, which points at the
password file to fetch next.

internal/modules/webserver_config_exposure_test.go drives the three modules end
to end through ExecuteHTTPModule and asserts the leak alongside the near misses
a strict review wants pinned: a plaintext htpasswd line, a configuration without
a dotnet section, an html page, a plain 200 body and a 404, none of which may
match.

verify: go test ./internal/modules, each matcher, hash format, section gate,
guard and extractor proven to bite (break -> red, restore -> green).
2026-06-22 17:15:01 -07:00

44 lines
831 B
YAML

# Web.config Exposure Detection Module
id: webconfig-exposure
info:
name: Web.config Exposure
author: sif
severity: high
description: Detects an exposed ASP.NET web.config that leaks connection strings and app settings
tags: [aspnet, iis, web-config, connection-string, exposure, recon]
type: http
http:
method: GET
paths:
- "{{BaseURL}}/web.config"
matchers:
- type: status
status:
- 200
- type: word
part: body
words:
- "<configuration"
- type: word
part: body
condition: or
words:
- "<connectionStrings"
- "<system.web"
- "<system.webServer"
- "<appSettings"
extractors:
- type: regex
name: connection_string
part: body
regex:
- 'connectionString="([^"]+)"'
group: 1