2020-11-26 20:53:23 +00:00
|
|
|
id: server-private-keys
|
|
|
|
|
|
|
|
info:
|
2023-02-23 21:01:53 +00:00
|
|
|
name: SSL/SSH/TLS/JWT Keys - Detect
|
2023-02-15 10:58:33 +00:00
|
|
|
author: geeknik,R12W4N
|
2020-11-26 20:53:23 +00:00
|
|
|
severity: high
|
2023-03-02 20:01:42 +00:00
|
|
|
classification:
|
|
|
|
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
|
|
|
|
cvss-score: 7.5
|
|
|
|
cwe-id: CWE-200
|
|
|
|
description: Private SSL, SSH, TLS, and JWT keys were detected.
|
2021-04-06 06:46:11 +00:00
|
|
|
tags: config,exposure
|
2021-04-02 13:10:33 +00:00
|
|
|
|
2020-11-26 20:53:23 +00:00
|
|
|
requests:
|
|
|
|
- method: GET
|
|
|
|
path:
|
2021-04-07 03:19:34 +00:00
|
|
|
- "{{BaseURL}}/localhost.key"
|
2020-11-26 20:53:23 +00:00
|
|
|
- "{{BaseURL}}/host.key"
|
|
|
|
- "{{BaseURL}}/www.key"
|
|
|
|
- "{{BaseURL}}/private-key"
|
|
|
|
- "{{BaseURL}}/privatekey.key"
|
|
|
|
- "{{BaseURL}}/server.key"
|
|
|
|
- "{{BaseURL}}/my.key"
|
|
|
|
- "{{BaseURL}}/key.pem"
|
2021-05-03 01:57:02 +00:00
|
|
|
- "{{BaseURL}}/ssl/localhost.key"
|
|
|
|
- "{{BaseURL}}/ssl/{{Hostname}}.key"
|
2020-11-26 20:53:23 +00:00
|
|
|
- "{{BaseURL}}/id_rsa"
|
|
|
|
- "{{BaseURL}}/id_dsa"
|
|
|
|
- "{{BaseURL}}/.ssh/id_rsa"
|
|
|
|
- "{{BaseURL}}/.ssh/id_dsa"
|
|
|
|
- "{{BaseURL}}/{{Hostname}}.key"
|
|
|
|
- "{{BaseURL}}/{{Hostname}}.pem"
|
2021-06-08 00:04:02 +00:00
|
|
|
- "{{BaseURL}}/config/jwt/private.pem"
|
|
|
|
- "{{BaseURL}}/jwt/private.pem"
|
2021-06-08 00:06:01 +00:00
|
|
|
- "{{BaseURL}}/var/jwt/private.pem"
|
2021-06-08 00:04:02 +00:00
|
|
|
- "{{BaseURL}}/private.pem"
|
2023-02-15 10:57:11 +00:00
|
|
|
- "{{BaseURL}}/ssl.txt"
|
|
|
|
- "{{BaseURL}}/ssl_key.txt"
|
|
|
|
- "{{BaseURL}}/certificates/{{Host}}.pfx"
|
|
|
|
- "{{BaseURL}}/certificates/{{Host}}.p12"
|
|
|
|
- "{{BaseURL}}/ssl/{{Host}}.pem"
|
|
|
|
- "{{BaseURL}}/ssl/{{Host}}_key.txt"
|
|
|
|
- "{{BaseURL}}/cert/{{Host}}_key.txt"
|
|
|
|
- "{{BaseURL}}/cert/{{RDN}}_key.txt"
|
|
|
|
- "{{BaseURL}}/cert/{{Host}}.txt"
|
|
|
|
- "{{BaseURL}}/ssl/private/{{Host}}_key.pem"
|
|
|
|
- "{{BaseURL}}/certs/{{Host}}_private.key"
|
|
|
|
- "{{BaseURL}}/certs/{{Host}}.key"
|
|
|
|
- "{{BaseURL}}/certificates/{{Host}}_priv.pem"
|
|
|
|
- "{{BaseURL}}/certificates/{{Host}}_privkey.pem"
|
|
|
|
- "{{BaseURL}}/certs/{{Host}}.pem"
|
|
|
|
- "{{BaseURL}}/private/{{Host}}.key"
|
|
|
|
- "{{BaseURL}}/keys/{{Host}}.pem"
|
2020-11-26 20:53:23 +00:00
|
|
|
|
2023-02-15 10:58:33 +00:00
|
|
|
stop-at-first-match: true
|
2020-11-26 20:53:23 +00:00
|
|
|
matchers-condition: and
|
|
|
|
matchers:
|
|
|
|
- type: word
|
|
|
|
words:
|
|
|
|
- "BEGIN OPENSSH PRIVATE KEY"
|
|
|
|
- "BEGIN PRIVATE KEY"
|
|
|
|
- "BEGIN RSA PRIVATE KEY"
|
|
|
|
- "BEGIN DSA PRIVATE KEY"
|
|
|
|
- "BEGIN EC PRIVATE KEY"
|
2021-01-04 20:48:46 +00:00
|
|
|
- "BEGIN PGP PRIVATE KEY BLOCK"
|
2023-02-15 10:57:11 +00:00
|
|
|
- "BEGIN ENCRYPTED PRIVATE KEY"
|
2020-11-26 20:53:23 +00:00
|
|
|
condition: or
|
|
|
|
|
|
|
|
- type: status
|
|
|
|
status:
|
|
|
|
- 200
|
2021-06-29 21:56:01 +00:00
|
|
|
|
|
|
|
- type: dsl
|
|
|
|
dsl:
|
|
|
|
- '!contains(body_2, "<html")'
|
|
|
|
- '!contains(body_2, "<HTML")'
|
2022-01-04 19:34:16 +00:00
|
|
|
condition: and
|
2023-02-23 21:01:53 +00:00
|
|
|
|
2023-03-02 20:01:42 +00:00
|
|
|
# Enhanced by cs on 2023/03/02
|