def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("ParentImage", default="").endswith("\\cmd.exe"),
                    event.deep_get("ParentImage", default="").endswith("\\cscript.exe"),
                    event.deep_get("ParentImage", default="").endswith("\\mshta.exe"),
                    event.deep_get("ParentImage", default="").endswith("\\powershell.exe"),
                    event.deep_get("ParentImage", default="").endswith("\\pwsh.exe"),
                    event.deep_get("ParentImage", default="").endswith("\\regsvr32.exe"),
                    event.deep_get("ParentImage", default="").endswith("\\wscript.exe"),
                ]
            ),
            event.deep_get("Image", default="").endswith("\\rundll32.exe"),
            any(
                [
                    ":\\ProgramData\\" in event.deep_get("CommandLine", default=""),
                    ":\\Users\\Public\\" in event.deep_get("CommandLine", default=""),
                    ":\\Windows\\Installer\\" in event.deep_get("CommandLine", default=""),
                    "\\AppData\\Local\\Temp\\" in event.deep_get("CommandLine", default=""),
                    "\\AppData\\Roaming\\" in event.deep_get("CommandLine", default=""),
                ]
            ),
            not any(
                [
                    any(
                        [
                            ".cpl " in event.deep_get("CommandLine", default=""),
                            ".cpl," in event.deep_get("CommandLine", default=""),
                            ".dll " in event.deep_get("CommandLine", default=""),
                            ".dll," in event.deep_get("CommandLine", default=""),
                            ".inf " in event.deep_get("CommandLine", default=""),
                            ".inf," in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    any(
                        [
                            event.deep_get("CommandLine", default="").endswith(".cpl"),
                            event.deep_get("CommandLine", default="").endswith('.cpl"'),
                            event.deep_get("CommandLine", default="").endswith(".dll"),
                            event.deep_get("CommandLine", default="").endswith('.dll"'),
                            event.deep_get("CommandLine", default="").endswith(".inf"),
                            event.deep_get("CommandLine", default="").endswith('.inf"'),
                            event.deep_get("CommandLine", default="").endswith(".cpl'"),
                            event.deep_get("CommandLine", default="").endswith(".dll'"),
                            event.deep_get("CommandLine", default="").endswith(".inf'"),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
