Skip to content

Commit cc8cea3

Browse files
committed
Add a regex for (possible) SSH private keys
1 parent bc058fd commit cc8cea3

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

lib/Paste.py

+2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ def match(self):
5858
self.type = 'google_api'
5959
if regexes['pgp_private'].search(self.text):
6060
self.type = 'pgp_private'
61+
if regexes['ssh_private'].search(self.text):
62+
self.type = 'ssh_private'
6163
# if regexes['juniper'].search(self.text): self.type = 'Juniper'
6264
for regex in regexes['banlist']:
6365
if regex.search(self.text):

lib/regexes.py

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
'google_api': re.compile(r'\W(AIza.{35})'),
1212
'honeypot': re.compile(r'<dionaea\.capture>', re.I),
1313
'pgp_private': re.compile(r'BEGIN PGP PRIVATE', re.I),
14+
'ssh_private': re.compile(r'BEGIN RSA PRIVATE'. re.I),
1415
'db_keywords': [
1516
re.compile(
1617
r'((customers?|email|users?|members?|acc(?:oun)?ts?)([-_|/\s]?(address|name|id[^")a-zA-Z0-9_]|[-_:|/\\])))', re.I),

0 commit comments

Comments
 (0)