DefinetlyNotAI/Logicytics

View on GitHub
CODE/_hide_my_tracks.py

Summary

Maintainability
A
0 mins
Test Coverage
import datetime
import os
import subprocess


def attempt_hide():
    """
    Attempts to delete Windows event logs from the current day.

    Parameters:
    None

    Returns:
    None
    """
    today = datetime.date.today()
    log_path = r"C:\Windows\System32\winevt\Logs"

    for file in os.listdir(log_path):
        if file.endswith(".evtx") and file.startswith(today.strftime("%Y-%m-%d")):
            subprocess.run(f'del "{os.path.join(log_path, file)}"', shell=False)