mirror of
https://github.com/lunchcat/sif.git
synced 2026-07-28 22:40:54 -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).
63 lines
1.2 KiB
YAML
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
|