From e83680ba124f740094cb1c0a6981010c8558f329 Mon Sep 17 00:00:00 2001 From: Ada Isopods Date: Sun, 18 May 2025 04:40:29 -0600 Subject: -c no worky. whoops! --- cowrieder.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'cowrieder.py') diff --git a/cowrieder.py b/cowrieder.py index 36cf1a8..24c189c 100644 --- a/cowrieder.py +++ b/cowrieder.py @@ -40,7 +40,7 @@ parser.add_argument('-s', '--stats', action='store_true', help='Print aggregated parser.add_argument('-S', '--only-stats', action='store_true', help='Print only aggregated statistics') def ccgen(seed=""): # Color code generator - if(not os.isatty(1)): # Do not output color code at all if output is not a TTY that can accept them + if(not os.isatty(1) or args.no_color): # Do not output color code at all if output is not a TTY that can accept them return "" match(seed): # Match color keywords to control codes @@ -150,7 +150,7 @@ def session_ran_command(session): # Was a command run during the session return True return False -def session_saved_file(session): +def session_saved_file(session): # Were any files saved to disk during the session for event in session: if(event['eventid'] == "cowrie.session.file_download"): return True @@ -182,11 +182,13 @@ def session_pingcmds(session): # Return array of all "command ping" commands use ra.append(argv0) return ra +# Loading da file(s) into da master array + def load_json_to_array(fp): - with open(fp, "r") as logfile: # Load da file and populate da master array + with open(fp, "r") as logfile: for line in logfile: entry = json.loads(line) - + if( (not args.filter_ip or entry['src_ip'] == args.filter_ip or hashgen(entry['src_ip']) == args.filter_ip) # If it's not the IP we're filtering for don't even bother man ): -- cgit v1.2.3