Skip to content

Commit bc058fd

Browse files
committedDec 30, 2014
Add a regex search for (possible) PGP private key blocks
1 parent 8187b01 commit bc058fd

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed
 

‎lib/Paste.py

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ 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'
5961
# if regexes['juniper'].search(self.text): self.type = 'Juniper'
6062
for regex in regexes['banlist']:
6163
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

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
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),
1314
'db_keywords': [
1415
re.compile(
1516
r'((customers?|email|users?|members?|acc(?:oun)?ts?)([-_|/\s]?(address|name|id[^")a-zA-Z0-9_]|[-_:|/\\])))', re.I),

0 commit comments

Comments
 (0)
Please sign in to comment.