From f7f080348912f332b1f4acd79b096e19e9586749 Mon Sep 17 00:00:00 2001 From: Ada Isopods Date: Thu, 22 May 2025 15:02:15 -0600 Subject: time log parsing --- cowrieder.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cowrieder.py') 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 -- cgit v1.2.3