import re


def rule(event):
    if all(
        [
            event.deep_get("ParentImage", default="").endswith("\\wscript.exe"),
            event.deep_get("Image", default="").endswith("\\cmd.exe"),
            ">>%APPDATA%\\Microsoft\\" in event.deep_get("CommandLine", default=""),
            any(
                [
                    event.deep_get("CommandLine", default="").endswith(".xml"),
                    event.deep_get("CommandLine", default="").endswith(".txt"),
                ]
            ),
            any(
                [
                    re.match(r"ipconfig\\s+/all", event.deep_get("CommandLine", default="")),
                    any(
                        [
                            "dir" in event.deep_get("CommandLine", default=""),
                            "systeminfo" in event.deep_get("CommandLine", default=""),
                            "tasklist" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
