aboutsummaryrefslogtreecommitdiff
path: root/cowrieder.py
diff options
context:
space:
mode:
authorAda Isopods <me@bathynomus.xyz>2025-05-22 15:02:15 -0600
committerAda Isopods <me@bathynomus.xyz>2026-10-21 23:04:36 -0600
commitf7f080348912f332b1f4acd79b096e19e9586749 (patch)
treed05054828d93251889529ca5a5ce1e88b2caeef4 /cowrieder.py
parent2b047917145e8684c694b00881a29be54a0ac469 (diff)
time log parsing
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