Files
sif/modules/recon/htaccess-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

63 lines
1.2 KiB
YAML

# Htaccess Exposure Detection Module
id: htaccess-exposure
info:
name: Htaccess Exposure
author: sif
severity: medium
description: Detects an exposed htaccess file that leaks rewrite rules and access control config
tags: [apache, htaccess, config, info-disclosure, exposure, recon]
type: http
http:
method: GET
paths:
- "{{BaseURL}}/.htaccess"
matchers:
- type: status
status:
- 200
- type: word
part: body
condition: or
words:
- "RewriteEngine"
- "RewriteRule"
- "RewriteCond"
- "AuthUserFile"
- "AuthType"
- "<FilesMatch"
- "<Files "
- "Order allow,deny"
- "Deny from"
- "Options -"
- "Options +"
- "ErrorDocument"
- "DirectoryIndex"
- "php_flag"
- "php_value"
- "Header set"
- type: word
part: body
negative: true
condition: or
words:
- "<!DOCTYPE"
- "<!doctype"
- "<html"
- "<HTML"
- "<head>"
- "<title>"
extractors:
- type: regex
name: auth_user_file
part: body
regex:
- 'AuthUserFile\s+(\S+)'
group: 1