def rule(event):
    if all(
        [
            any(
                [
                    "for " in event.deep_get("CommandLine", default=""),
                    "foreach " in event.deep_get("CommandLine", default=""),
                ]
            ),
            any(
                [
                    "nslookup" in event.deep_get("CommandLine", default=""),
                    "ping" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
