From ac254e0e6394154878a7a1b5f40a5e23e25a3837 Mon Sep 17 00:00:00 2001 From: Mokaddem Date: Thu, 27 Oct 2016 11:50:24 +0200 Subject: [PATCH] Added support of browsing concerned paste in dashboard for all modules + Show in the page what was the concerned module --- bin/Credential.py | 2 +- bin/CreditCards.py | 6 +++--- bin/DomClassifier.py | 8 ++++---- bin/Duplicates.py | 2 +- bin/Onion.py | 8 ++++---- bin/Release.py | 2 +- bin/SQLInjectionDetection.py | 2 +- bin/Web.py | 4 ++-- var/www/static/js/indexjavascript.js | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/bin/Credential.py b/bin/Credential.py index d8bb8a84..8c62f34a 100755 --- a/bin/Credential.py +++ b/bin/Credential.py @@ -48,7 +48,7 @@ if __name__ == "__main__": if sites_set: message += ' Related websites: {}'.format(', '.join(sites_set)) - to_print = 'Credential;{};{};{};{}'.format(paste.p_source, paste.p_date, paste.p_name, message) + to_print = 'Credential;{};{};{};{};{}'.format(paste.p_source, paste.p_date, paste.p_name, message, paste.p_path) print('\n '.join(creds)) diff --git a/bin/CreditCards.py b/bin/CreditCards.py index 04ce9c62..6c9bf9c1 100755 --- a/bin/CreditCards.py +++ b/bin/CreditCards.py @@ -63,14 +63,14 @@ if __name__ == "__main__": to_print = 'CreditCard;{};{};{};'.format( paste.p_source, paste.p_date, paste.p_name) if (len(creditcard_set) > 0): - publisher.warning('{}Checked {} valid number(s)'.format( - to_print, len(creditcard_set))) + publisher.warning('{}Checked {} valid number(s);{}'.format( + to_print, len(creditcard_set), paste.p_path)) #Send to duplicate p.populate_set_out(filename, 'Duplicate') #send to Browse_warning_paste p.populate_set_out('creditcard;{}'.format(filename), 'BrowseWarningPaste') else: - publisher.info('{}CreditCard related'.format(to_print)) + publisher.info('{}CreditCard related;{}'.format(to_print, paste.p_path)) else: publisher.debug("Script creditcard is idling 1m") time.sleep(10) diff --git a/bin/DomClassifier.py b/bin/DomClassifier.py index 14a417f2..74522917 100755 --- a/bin/DomClassifier.py +++ b/bin/DomClassifier.py @@ -51,13 +51,13 @@ def main(): localizeddomains = c.include(expression=cc_tld) if localizeddomains: print(localizeddomains) - publisher.warning('DomainC;{};{};{};Checked {} located in {}'.format( - PST.p_source, PST.p_date, PST.p_name, localizeddomains, cc_tld)) + publisher.warning('DomainC;{};{};{};Checked {} located in {};{}'.format( + PST.p_source, PST.p_date, PST.p_name, localizeddomains, cc_tld, PST.p_path)) localizeddomains = c.localizedomain(cc=cc) if localizeddomains: print(localizeddomains) - publisher.warning('DomainC;{};{};{};Checked {} located in {}'.format( - PST.p_source, PST.p_date, PST.p_name, localizeddomains, cc)) + publisher.warning('DomainC;{};{};{};Checked {} located in {};{}'.format( + PST.p_source, PST.p_date, PST.p_name, localizeddomains, cc, PST.p_path)) except IOError: print "CRC Checksum Failed on :", PST.p_path publisher.error('Duplicate;{};{};{};CRC Checksum Failed'.format( diff --git a/bin/Duplicates.py b/bin/Duplicates.py index d2efcab3..cd9e1f97 100755 --- a/bin/Duplicates.py +++ b/bin/Duplicates.py @@ -162,7 +162,7 @@ if __name__ == "__main__": if dupl != []: PST.__setattr__("p_duplicate", dupl) PST.save_attribute_redis("p_duplicate", dupl) - publisher.info('{}Detected {}'.format(to_print, len(dupl))) + publisher.info('{}Detected {};{}'.format(to_print, len(dupl), PST.p_path)) print '{}Detected {}'.format(to_print, len(dupl)) y = time.time() diff --git a/bin/Onion.py b/bin/Onion.py index cdfb44bc..1680a244 100755 --- a/bin/Onion.py +++ b/bin/Onion.py @@ -133,8 +133,8 @@ if __name__ == "__main__": PST.p_name) if len(domains_list) > 0: - publisher.warning('{}Detected {} .onion(s)'.format( - to_print, len(domains_list))) + publisher.warning('{}Detected {} .onion(s);{}'.format( + to_print, len(domains_list),PST.p_path)) now = datetime.datetime.now() path = os.path.join('onions', str(now.year).zfill(4), str(now.month).zfill(2), @@ -144,9 +144,9 @@ if __name__ == "__main__": PST.p_date, PST.p_name) for url in fetch(p, r_cache, urls, domains_list, path): - publisher.warning('{}Checked {}'.format(to_print, url)) + publisher.warning('{}Checked {};{}'.format(to_print, url, PST.p_path)) else: - publisher.info('{}Onion related'.format(to_print)) + publisher.info('{}Onion related;{}'.format(to_print, PST.p_path)) prec_filename = filename else: diff --git a/bin/Release.py b/bin/Release.py index 309efe67..ce30ea3f 100755 --- a/bin/Release.py +++ b/bin/Release.py @@ -34,7 +34,7 @@ if __name__ == "__main__": if len(releases) == 0: continue - to_print = 'Release;{};{};{};{} releases'.format(paste.p_source, paste.p_date, paste.p_name, len(releases)) + to_print = 'Release;{};{};{};{} releases;{}'.format(paste.p_source, paste.p_date, paste.p_name, len(releases), paste.p_path) if len(releases) > 30: publisher.warning(to_print) else: diff --git a/bin/SQLInjectionDetection.py b/bin/SQLInjectionDetection.py index b2d002fe..5e1f1dce 100755 --- a/bin/SQLInjectionDetection.py +++ b/bin/SQLInjectionDetection.py @@ -69,7 +69,7 @@ def analyse(url, path): if (result_path > 1) or (result_query > 1): print "Detected SQL in URL: " print urllib2.unquote(url) - to_print = 'SQLInjection;{};{};{};{}'.format(paste.p_source, paste.p_date, paste.p_name, "Detected SQL in URL") + to_print = 'SQLInjection;{};{};{};{};{}'.format(paste.p_source, paste.p_date, paste.p_name, "Detected SQL in URL", paste.p_path) publisher.warning(to_print) #Send to duplicate p.populate_set_out(path, 'Duplicate') diff --git a/bin/Web.py b/bin/Web.py index 9892697c..49790185 100755 --- a/bin/Web.py +++ b/bin/Web.py @@ -131,8 +131,8 @@ if __name__ == "__main__": list(A_values[1]))) pprint.pprint(A_values) - publisher.info('Url;{};{};{};Checked {} URL'.format( - PST.p_source, PST.p_date, PST.p_name, A_values[0])) + publisher.info('Url;{};{};{};Checked {} URL;{}'.format( + PST.p_source, PST.p_date, PST.p_name, A_values[0], PST.p_path)) prec_filename = filename else: diff --git a/var/www/static/js/indexjavascript.js b/var/www/static/js/indexjavascript.js index 19980a69..a289f5ae 100644 --- a/var/www/static/js/indexjavascript.js +++ b/var/www/static/js/indexjavascript.js @@ -170,7 +170,7 @@ function create_log_table(obj_json) { msage.appendChild(document.createTextNode(message.join(" "))); var paste_path = parsedmess[5]; - var url_to_saved_paste = url_showSavedPath+"?paste="+paste_path+"&num=0"; + var url_to_saved_paste = url_showSavedPath+"?paste="+paste_path+"&num="+parsedmess[0]; var action_icon_a = document.createElement("A"); action_icon_a.setAttribute("TARGET", "_blank");