diff options
| author | Ada Isopods <me@bathynomus.xyz> | 2025-05-18 04:40:29 -0600 |
|---|---|---|
| committer | Ada Isopods <me@bathynomus.xyz> | 2026-10-21 23:04:31 -0600 |
| commit | e83680ba124f740094cb1c0a6981010c8558f329 (patch) | |
| tree | a04817382e1681a961baa8336057f295c4a5d95d | |
| parent | 0c0c0882c34357c896303a4107691012dc680692 (diff) | |
-c no worky. whoops!
| -rw-r--r-- | cowrieder.py | 10 |
1 files changed, 6 insertions, 4 deletions
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 ): |
