Merge pull request #193 from Terrtia/master

Keys module improvement
This commit is contained in:
Sami Mokaddem 2018-04-05 14:19:22 +02:00 committed by GitHub
commit 6454fa224d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,7 +7,8 @@ The Keys Module
This module is consuming the Redis-list created by the Global module. This module is consuming the Redis-list created by the Global module.
It is looking for PGP encrypted messages It is looking for PGP, private and encrypted private,
RSA private key, certificate messages
""" """
@ -18,11 +19,32 @@ from Helper import Process
from packages import Paste from packages import Paste
def search_gpg(message): def search_key(message):
paste = Paste.Paste(message) paste = Paste.Paste(message)
content = paste.get_p_content() content = paste.get_p_content()
find = False
if '-----BEGIN PGP MESSAGE-----' in content: if '-----BEGIN PGP MESSAGE-----' in content:
publisher.warning('{} has a PGP enc message'.format(paste.p_name)) publisher.warning('{} has a PGP enc message'.format(paste.p_name))
find = True
if '-----BEGIN CERTIFICATE-----' in content:
publisher.warning('{} has a certificate message'.format(paste.p_name))
find = True
if '-----BEGIN RSA PRIVATE KEY-----' in content:
publisher.warning('{} has a RSA key message'.format(paste.p_name))
find = True
if '-----BEGIN PRIVATE KEY-----' in content:
publisher.warning('{} has a private message'.format(paste.p_name))
find = True
if '-----BEGIN ENCRYPTED PRIVATE KEY-----' in content:
publisher.warning('{} has an encrypted private message'.format(paste.p_name))
find = True
if find :
#Send to duplicate #Send to duplicate
p.populate_set_out(message, 'Duplicate') p.populate_set_out(message, 'Duplicate')
#send to Browse_warning_paste #send to Browse_warning_paste
@ -55,6 +77,6 @@ if __name__ == '__main__':
continue continue
# Do something with the message from the queue # Do something with the message from the queue
search_gpg(message) search_key(message)
# (Optional) Send that thing to the next queue # (Optional) Send that thing to the next queue