2020-11-26 20:53:23 +00:00
|
|
|
id: server-private-keys
|
|
|
|
|
|
|
|
info:
|
2021-06-08 00:04:02 +00:00
|
|
|
name: Detect Private SSH, TLS, and JWT Keys
|
2020-11-26 20:53:23 +00:00
|
|
|
author: geeknik
|
|
|
|
severity: high
|
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"
|
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"
|
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
|