mirror of
https://github.com/lunchcat/sif.git
synced 2026-07-28 14:37:01 -07:00
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).
37 lines
699 B
YAML
37 lines
699 B
YAML
# Htpasswd Exposure Detection Module
|
|
|
|
id: htpasswd-exposure
|
|
info:
|
|
name: Htpasswd Exposure
|
|
author: sif
|
|
severity: high
|
|
description: Detects an exposed htpasswd file that leaks crackable basic auth password hashes
|
|
tags: [apache, htpasswd, credentials, hashes, exposure, recon]
|
|
|
|
type: http
|
|
|
|
http:
|
|
method: GET
|
|
paths:
|
|
- "{{BaseURL}}/.htpasswd"
|
|
|
|
matchers:
|
|
- type: status
|
|
status:
|
|
- 200
|
|
|
|
- type: regex
|
|
part: body
|
|
condition: or
|
|
regex:
|
|
- '(?m)^[^:\s]+:\$(apr1|2[aby]|1|5|6)\$'
|
|
- '(?m)^[^:\s]+:\{SHA\}'
|
|
|
|
extractors:
|
|
- type: regex
|
|
name: htpasswd_user
|
|
part: body
|
|
regex:
|
|
- '(?m)^([^:\s]+):'
|
|
group: 1
|