aboutsummaryrefslogtreecommitdiff
path: root/cowrieder.py
diff options
context:
space:
mode:
Diffstat (limited to 'cowrieder.py')
-rw-r--r--cowrieder.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/cowrieder.py b/cowrieder.py
index 49e4867..3d8fee9 100644
--- a/cowrieder.py
+++ b/cowrieder.py
@@ -6,7 +6,9 @@ import argparse
import hashlib
import ipaddress
from pprint import pprint
+import time
+start_time = time.time()
cmdping_commands = ['uname', 'nproc'] # List of commands that, if used exclusively, qualify a session as a "command ping"
pubkey_attempt_str = "[SSH_PUBKEY_ATTEMPT]"
@@ -351,6 +353,8 @@ ips_by_attempt_count = cnt_by_to_by_cnt(attempt_counts_by_ip)
usernames_by_attempt_count = cnt_by_to_by_cnt(attempt_counts_by_username)
passwords_by_attempt_count = cnt_by_to_by_cnt(attempt_counts_by_password)
+log_parsing_time = time.time() - start_time
+
# Printing logic coming up
def print_dict_of_lists(by_cnt, is_ip = False, key_is_ip = False, truncate = 3, limit = -1):
@@ -568,4 +572,5 @@ else: # Default (low) verbosity: just the good stuff
print_dict_of_lists(passwords_by_username, truncate=10, limit = 20)
print("\n--- Top IPs with credential combos tried: ---")
print_dict_of_lists(login_combos_by_ip, truncate=7, limit = 20, key_is_ip=True)
- print_percentage_stats() \ No newline at end of file
+ print_percentage_stats()
+ print("Log took {}s to parse".format(str(log_parsing_time)[:4])) \ No newline at end of file