Skip to content

Commit

Permalink
Added header to the console report
Browse files Browse the repository at this point in the history
  • Loading branch information
zbalkan committed Dec 11, 2024
1 parent 9f9400c commit b611f43
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/panhunt.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
import argparse
import logging
import os
import platform
import sys
import time
from datetime import datetime
from typing import Final, Optional

Expand Down Expand Up @@ -49,6 +51,15 @@ def hunt_pans() -> Report:

def display_report(report: Report) -> None:

newline = '\n'
header: str = f'PAN Hunt Report - {time.strftime("%H:%M:%S %d/%m/%Y")}{newline}{"=" * 100}{newline}'
header += f'Searched {report.__searched}\nExcluded {report.__excluded}{newline}'
header += f'Command: {report.__command}{newline}'
header += f'Uname: {" | ".join(platform.uname())}{newline}'
header += f'Elapsed time: {report.__elapsed}{newline}'
header += f'Found {report.pan_count} possible PANs.{newline}{"=" * 100}{newline}{newline}'
print(colorama.Fore.WHITE + header)

pan_sep: str = '\n\t'
for sf in report.matched_files:
pan_header: str = f"FOUND PANs: {sf.abspath} ({panutils.size_friendly(sf.size)})"
Expand Down

0 comments on commit b611f43

Please sign in to comment.