-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11312 from projectdiscovery/exposed-pki-cert
Create exposed-pki-cert.yaml
- Loading branch information
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
id: exposed-pki-cert | ||
|
||
info: | ||
name: Exposed Internal PKI Infrastructure - Detect | ||
author: nullenc0de | ||
severity: high | ||
description: | | ||
Detects exposed internal PKI infrastructure including CRL distribution points and OCSP responders | ||
metadata: | ||
verified: true | ||
max-request: 10 | ||
tags: pki,exposure,misconfig | ||
|
||
http: | ||
- method: GET | ||
path: | ||
- "{{BaseURL}}/{{paths}}" | ||
|
||
payloads: | ||
paths: | ||
- "" | ||
- "certsrv/" | ||
- "pki/" | ||
- "PKI/" | ||
- "crl/" | ||
- "CRL/" | ||
- ".well-known/pki-validation/" | ||
- "ocsp/" | ||
- "CertEnroll/" | ||
- "CertSrv/" | ||
|
||
stop-at-first-match: true | ||
host-redirects: true | ||
max-redirects: 2 | ||
matchers-condition: or | ||
matchers: | ||
- type: dsl | ||
dsl: | ||
- 'contains_any(body, "Certificate Services", "CRL Distribution Point", "OCSP Responder")' | ||
- '!regex("^This is an OCSP responder.$", body)' | ||
condition: and | ||
|
||
- type: regex | ||
regex: | ||
- 'CN=[A-Za-z0-9-]+-CA' | ||
- '(?i)<a\s+href="([^"]+\.crl)"[^>]*>[^<]*\.crl<\/a>' | ||
- '(?i)<a\s+href="([^"]+\.cer)"[^>]*>[^<]*\.cer<\/a>' | ||
- '(?i)<a\s+href="([^"]+\.p7b)"[^>]*>[^<]*\.p7b<\/a>' | ||
- '(?i)href="([^"]+\.crl)"' | ||
- '(?i)href="([^"]+\.cer)"' | ||
- '(?i)href="([^"]+\.p7b)"' | ||
condition: or | ||
|
||
extractors: | ||
- type: regex | ||
name: certificate_details | ||
regex: | ||
- "CN=[A-Za-z0-9-]+-CA" | ||
- "O=[A-Za-z0-9 ]+" | ||
- "OU=[A-Za-z0-9 ]+" |