From 3bff9c4aea5f297c79bde7cd7fb92d8eb562c9ee Mon Sep 17 00:00:00 2001 From: Jonn Callahan Date: Wed, 27 Jun 2018 16:07:57 -0700 Subject: [PATCH] because sorting is better than not --- modules/db.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/db.py b/modules/db.py index cb18a9e..bc71771 100644 --- a/modules/db.py +++ b/modules/db.py @@ -45,10 +45,10 @@ def module_list_services_by_key(): Show services for a given key service:sub_service example: elasticbeanstalk:DescribeEvents ''' - results = search_recon_by_key(db_name, AWS_ACCESS_KEY_ID) + results = ["{}.{}".format(r[0], r[1]) for r in search_recon_by_key(db_name, AWS_ACCESS_KEY_ID)] print("Services enumerated for {}".format(AWS_ACCESS_KEY_ID)) - for result in results: - print("{}:{}".format(result[0], result[1])) + for result in sorted(results): + print(result) # for a key, what services does it have listed in the DB and the date @@ -59,7 +59,7 @@ def module_list_services_by_key_with_date(): Show services for a given key service:sub_service with date example: elasticbeanstalk:DescribeEvents -> Date: 2018-04-18 20:36:41.791780 ''' - results = search_recon_by_key(db_name, AWS_ACCESS_KEY_ID) + results = [("{}.{}".format(r[0], r[1]), r[2]) for r in search_recon_by_key(db_name, AWS_ACCESS_KEY_ID)] print("Services enumerated for {}".format(AWS_ACCESS_KEY_ID)) - for result in results: - print("{}:{} -> Date: {}".format(result[0], result[1], result[2])) + for result, date in sorted(results, key=lambda r: r[0]): + print("{} -> Date: {}".format(result, date))