import re


def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("Image", default="").endswith("\\certoc.exe"),
                    event.deep_get("OriginalFileName", default="") == "CertOC.exe",
                ]
            ),
            re.match(
                r"://[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}",
                event.deep_get("CommandLine", default=""),
            ),
            "-GetCACAPS" in event.deep_get("CommandLine", default=""),
        ]
    ):
        return True
    return False
