MOON
Server: Apache
System: Linux smtp.modiva.org 3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018 x86_64
User: rtbrisc (1005)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/microsoft/mdatp/tools/client_analyzer/python/mde_tools/certinfocollection.py
import logging
import subprocess
from .constants import LOGGER_NAME, WDAVENGINE_PATH
from .utils import log

log = logging.getLogger(LOGGER_NAME)

def certinfocollection(args):
    log.info("Cert information collection started")
    log.debug("Running chmod on mde_tools/cert_hashes.sh")
    subprocess.run(["chmod", "a+x", "mde_tools/cert_hashes.sh"])
    log.debug("Running mde_tools/cert_hashes.sh")
    with open(args.target_file, 'w') as f:
        subprocess.run(["sudo", "mde_tools/cert_hashes.sh", WDAVENGINE_PATH], stdout=f)
    log.info(f"Cert information has been logged in file: {args.target_file}")