def rule(event):
    if any(
        [
            all(
                [
                    "for /f" in event.deep_get("CommandLine", default=""),
                    "tokens=" in event.deep_get("CommandLine", default=""),
                    "in (" in event.deep_get("CommandLine", default=""),
                    "dir" in event.deep_get("CommandLine", default=""),
                ]
            ),
            all(
                [
                    "for /f" in event.deep_get("ParentCommandLine", default=""),
                    "tokens=" in event.deep_get("ParentCommandLine", default=""),
                    "in (" in event.deep_get("ParentCommandLine", default=""),
                    "dir" in event.deep_get("ParentCommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
