import re


def rule(event):
    if all(
        [
            event.deep_get("Image", default="").endswith("\\ScreenConnect.Service.exe"),
            any(
                [
                    re.match(
                        r"^.*ScreenConnect\\App_Extensions\\.*.ashx$",
                        event.deep_get("TargetFilename", default=""),
                    ),
                    re.match(
                        r"^.*ScreenConnect\\App_Extensions\\.*.aspx$",
                        event.deep_get("TargetFilename", default=""),
                    ),
                ]
            ),
            not re.match(
                r"^.*ScreenConnect\\App_Extensions\\.*\\.*$",
                event.deep_get("TargetFilename", default=""),
            ),
        ]
    ):
        return True
    return False
