From 652b00f4b28b2d75fb0d258e28f99b03226febb8 Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Wed, 15 Nov 2017 16:15:43 +0100 Subject: [PATCH] Renamed BrowseWarningPaste into alertHandler --- bin/Credential.py | 4 ++-- bin/CreditCards.py | 2 +- bin/Cve.py | 2 +- bin/Keys.py | 2 +- bin/LAUNCH.sh | 2 +- bin/Mail.py | 2 +- bin/Onion.py | 2 +- bin/Phone.py | 2 +- bin/SQLInjectionDetection.py | 2 +- ...{BrowseWarningPaste.py => alertHandler.py} | 8 +++---- bin/launch_scripts.sh | 2 +- bin/packages/modules.cfg | 24 +++++++++---------- 12 files changed, 26 insertions(+), 28 deletions(-) rename bin/{BrowseWarningPaste.py => alertHandler.py} (85%) diff --git a/bin/Credential.py b/bin/Credential.py index 233e424a..bb52f311 100755 --- a/bin/Credential.py +++ b/bin/Credential.py @@ -99,8 +99,8 @@ if __name__ == "__main__": publisher.warning(to_print) #Send to duplicate p.populate_set_out(filepath, 'Duplicate') - #Send to BrowseWarningPaste - p.populate_set_out('credential;{}'.format(filepath), 'BrowseWarningPaste') + #Send to alertHandler + p.populate_set_out('credential;{}'.format(filepath), 'alertHandler') #Put in form, count occurences, then send to moduleStats creds_sites = {} diff --git a/bin/CreditCards.py b/bin/CreditCards.py index 79442576..133916fe 100755 --- a/bin/CreditCards.py +++ b/bin/CreditCards.py @@ -79,7 +79,7 @@ if __name__ == "__main__": #Send to duplicate p.populate_set_out(filename, 'Duplicate') #send to Browse_warning_paste - p.populate_set_out('creditcard;{}'.format(filename), 'BrowseWarningPaste') + p.populate_set_out('creditcard;{}'.format(filename), 'alertHandler') else: publisher.info('{}CreditCard related;{}'.format(to_print, paste.p_path)) else: diff --git a/bin/Cve.py b/bin/Cve.py index fb4b0b24..62df0aba 100755 --- a/bin/Cve.py +++ b/bin/Cve.py @@ -32,7 +32,7 @@ def search_cve(message): publisher.warning('{} contains CVEs'.format(paste.p_name)) #send to Browse_warning_paste - p.populate_set_out('cve;{}'.format(filepath), 'BrowseWarningPaste') + p.populate_set_out('cve;{}'.format(filepath), 'alertHandler') #Send to duplicate p.populate_set_out(filepath, 'Duplicate') diff --git a/bin/Keys.py b/bin/Keys.py index d2e7ebd2..61d52602 100755 --- a/bin/Keys.py +++ b/bin/Keys.py @@ -26,7 +26,7 @@ def search_gpg(message): #Send to duplicate p.populate_set_out(message, 'Duplicate') #send to Browse_warning_paste - p.populate_set_out('keys;{}'.format(message), 'BrowseWarningPaste') + p.populate_set_out('keys;{}'.format(message), 'alertHandler') if __name__ == '__main__': diff --git a/bin/LAUNCH.sh b/bin/LAUNCH.sh index 227d3a9b..fb779182 100755 --- a/bin/LAUNCH.sh +++ b/bin/LAUNCH.sh @@ -170,7 +170,7 @@ function launching_scripts { sleep 0.1 screen -S "Script" -X screen -t "SQLInjectionDetection" bash -c './SQLInjectionDetection.py; read x' sleep 0.1 - screen -S "Script" -X screen -t "BrowseWarningPaste" bash -c './BrowseWarningPaste.py; read x' + screen -S "Script" -X screen -t "alertHandler" bash -c './alertHandler.py; read x' sleep 0.1 screen -S "Script" -X screen -t "SentimentAnalysis" bash -c './SentimentAnalysis.py; read x' diff --git a/bin/Mail.py b/bin/Mail.py index 99dd6948..c608d106 100755 --- a/bin/Mail.py +++ b/bin/Mail.py @@ -72,7 +72,7 @@ if __name__ == "__main__": publisher.warning(to_print) #Send to duplicate p.populate_set_out(filename, 'Duplicate') - p.populate_set_out('mail;{}'.format(filename), 'BrowseWarningPaste') + p.populate_set_out('mail;{}'.format(filename), 'alertHandler') else: publisher.info(to_print) diff --git a/bin/Onion.py b/bin/Onion.py index af41777d..aaf30a1b 100755 --- a/bin/Onion.py +++ b/bin/Onion.py @@ -145,7 +145,7 @@ if __name__ == "__main__": PST.p_name) for url in fetch(p, r_cache, urls, domains_list, path): publisher.warning('{}Checked {};{}'.format(to_print, url, PST.p_path)) - p.populate_set_out('onion;{}'.format(PST.p_path), 'BrowseWarningPaste') + p.populate_set_out('onion;{}'.format(PST.p_path), 'alertHandler') else: publisher.info('{}Onion related;{}'.format(to_print, PST.p_path)) diff --git a/bin/Phone.py b/bin/Phone.py index cb32a691..7a4811da 100755 --- a/bin/Phone.py +++ b/bin/Phone.py @@ -33,7 +33,7 @@ def search_phone(message): print results publisher.warning('{} contains PID (phone numbers)'.format(paste.p_name)) #send to Browse_warning_paste - p.populate_set_out('phone;{}'.format(message), 'BrowseWarningPaste') + p.populate_set_out('phone;{}'.format(message), 'alertHandler') #Send to duplicate p.populate_set_out(message, 'Duplicate') stats = {} diff --git a/bin/SQLInjectionDetection.py b/bin/SQLInjectionDetection.py index d2948f1b..318466c8 100755 --- a/bin/SQLInjectionDetection.py +++ b/bin/SQLInjectionDetection.py @@ -81,7 +81,7 @@ def analyse(url, path): #Send to duplicate p.populate_set_out(path, 'Duplicate') #send to Browse_warning_paste - p.populate_set_out('sqlinjection;{}'.format(path), 'BrowseWarningPaste') + p.populate_set_out('sqlinjection;{}'.format(path), 'alertHandler') else: print "Potential SQL injection:" print urllib2.unquote(url) diff --git a/bin/BrowseWarningPaste.py b/bin/alertHandler.py similarity index 85% rename from bin/BrowseWarningPaste.py rename to bin/alertHandler.py index 4f49f56b..ba6bb4d4 100755 --- a/bin/BrowseWarningPaste.py +++ b/bin/alertHandler.py @@ -24,7 +24,7 @@ if __name__ == "__main__": publisher.port = 6380 publisher.channel = "Script" - config_section = 'BrowseWarningPaste' + config_section = 'alertHandler' p = Process(config_section) @@ -48,12 +48,10 @@ if __name__ == "__main__": time.sleep(10) continue - # Add in redis + # Add in redis for browseWarningPaste # Format in set: WARNING_moduleName -> p_path key = "WARNING_" + module_name - print key + ' -> ' + p_path server.sadd(key, p_path) - publisher.info('Saved in warning paste {}'.format(p_path)) - #print 'Saved in warning paste {}'.format(p_path) + publisher.info('Saved warning paste {}'.format(p_path)) diff --git a/bin/launch_scripts.sh b/bin/launch_scripts.sh index e593b11e..0dd29c2f 100755 --- a/bin/launch_scripts.sh +++ b/bin/launch_scripts.sh @@ -72,6 +72,6 @@ screen -S "Script" -X screen -t "ModuleStats" bash -c './ModuleStats.py; read x' sleep 0.1 screen -S "Script" -X screen -t "SQLInjectionDetection" bash -c './SQLInjectionDetection.py; read x' sleep 0.1 -screen -S "Script" -X screen -t "BrowseWarningPaste" bash -c './BrowseWarningPaste.py; read x' +screen -S "Script" -X screen -t "alertHandler" bash -c './alertHandler.py; read x' sleep 0.1 screen -S "Script" -X screen -t "SentimentAnalysis" bash -c './SentimentAnalysis.py; read x' diff --git a/bin/packages/modules.cfg b/bin/packages/modules.cfg index 33eebd21..55fb46d4 100644 --- a/bin/packages/modules.cfg +++ b/bin/packages/modules.cfg @@ -49,16 +49,16 @@ publish = Redis_CreditCards,Redis_Mail,Redis_Onion,Redis_Web,Redis_Credential,Re [CreditCards] subscribe = Redis_CreditCards -publish = Redis_Duplicate,Redis_ModuleStats,Redis_BrowseWarningPaste +publish = Redis_Duplicate,Redis_ModuleStats,Redis_alertHandler [Mail] subscribe = Redis_Mail -publish = Redis_Duplicate,Redis_ModuleStats,Redis_BrowseWarningPaste +publish = Redis_Duplicate,Redis_ModuleStats,Redis_alertHandler [Onion] subscribe = Redis_Onion -publish = Redis_ValidOnion,ZMQ_FetchedOnion,Redis_BrowseWarningPaste -#publish = Redis_Global,Redis_ValidOnion,ZMQ_FetchedOnion,Redis_BrowseWarningPaste +publish = Redis_ValidOnion,ZMQ_FetchedOnion,Redis_alertHandler +#publish = Redis_Global,Redis_ValidOnion,ZMQ_FetchedOnion,Redis_alertHandler [DumpValidOnion] subscribe = Redis_ValidOnion @@ -72,17 +72,17 @@ subscribe = Redis_Url [SQLInjectionDetection] subscribe = Redis_Url -publish = Redis_BrowseWarningPaste,Redis_Duplicate +publish = Redis_alertHandler,Redis_Duplicate [ModuleStats] subscribe = Redis_ModuleStats -[BrowseWarningPaste] -subscribe = Redis_BrowseWarningPaste +[alertHandler] +subscribe = Redis_alertHandler #[send_to_queue] #subscribe = Redis_Cve -#publish = Redis_BrowseWarningPaste +#publish = Redis_alertHandler [SentimentAnalysis] subscribe = Redis_Global @@ -92,16 +92,16 @@ subscribe = Redis_Global [Credential] subscribe = Redis_Credential -publish = Redis_Duplicate,Redis_ModuleStats,Redis_BrowseWarningPaste +publish = Redis_Duplicate,Redis_ModuleStats,Redis_alertHandler [Cve] subscribe = Redis_Cve -publish = Redis_BrowseWarningPaste,Redis_Duplicate +publish = Redis_alertHandler,Redis_Duplicate [Phone] subscribe = Redis_Global -publish = Redis_Duplicate,Redis_BrowseWarningPaste +publish = Redis_Duplicate,Redis_alertHandler [Keys] subscribe = Redis_Global -publish = Redis_Duplicate,Redis_BrowseWarningPaste +publish = Redis_Duplicate,Redis_alertHandler