def rule(event):
    if all(
        [
            any(
                [
                    any(
                        [
                            event.deep_get("Image", default="").endswith("\\InstallUtil.exe"),
                            event.deep_get("Image", default="").endswith("\\RegAsm.exe"),
                            event.deep_get("Image", default="").endswith("\\RegSvcs.exe"),
                            event.deep_get("Image", default="").endswith("\\regsvr32.exe"),
                            event.deep_get("Image", default="").endswith("\\rundll32.exe"),
                        ]
                    ),
                    event.deep_get("OriginalFileName", default="")
                    in [
                        "InstallUtil.exe",
                        "RegAsm.exe",
                        "RegSvcs.exe",
                        "REGSVR32.EXE",
                        "RUNDLL32.EXE",
                    ],
                ]
            ),
            any(
                [
                    "Default.GetString" in event.deep_get("CommandLine", default=""),
                    "DownloadString" in event.deep_get("CommandLine", default=""),
                    "FromBase64String" in event.deep_get("CommandLine", default=""),
                    "ICM " in event.deep_get("CommandLine", default=""),
                    "IEX " in event.deep_get("CommandLine", default=""),
                    "Invoke-Command" in event.deep_get("CommandLine", default=""),
                    "Invoke-Expression" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
