Skip to content

Commit 783d0a8

Browse files
committed
Merge pull request #7 from pallih/master
Regexes for (possible) SSH keys and PGP private keys
2 parents 8187b01 + cc8cea3 commit 783d0a8

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

lib/Paste.py

+4
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ def match(self):
5656
self.type = 'honeypot'
5757
if regexes['google_api'].search(self.text):
5858
self.type = 'google_api'
59+
if regexes['pgp_private'].search(self.text):
60+
self.type = 'pgp_private'
61+
if regexes['ssh_private'].search(self.text):
62+
self.type = 'ssh_private'
5963
# if regexes['juniper'].search(self.text): self.type = 'Juniper'
6064
for regex in regexes['banlist']:
6165
if regex.search(self.text):

lib/helper.py

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ def build_tweet(paste):
6363
tweet += ' Possible SSH private key'
6464
elif paste.type == 'honeypot':
6565
tweet += ' Dionaea Honeypot Log'
66+
elif paste.type == 'pgp_private':
67+
tweet += ' Found possible PGP Private Key'
6668
tweet += ' #infoleak'
6769
if paste.num_emails > 0:
6870
print(paste.emails)

lib/regexes.py

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
'cisco_pass': re.compile(r'enable\s+password', re.I),
1111
'google_api': re.compile(r'\W(AIza.{35})'),
1212
'honeypot': re.compile(r'<dionaea\.capture>', re.I),
13+
'pgp_private': re.compile(r'BEGIN PGP PRIVATE', re.I),
14+
'ssh_private': re.compile(r'BEGIN RSA PRIVATE'. re.I),
1315
'db_keywords': [
1416
re.compile(
1517
r'((customers?|email|users?|members?|acc(?:oun)?ts?)([-_|/\s]?(address|name|id[^")a-zA-Z0-9_]|[-_:|/\\])))', re.I),

0 commit comments

Comments
 (0)