import json


def rule(event):
    if all(
        [
            event.deep_get("type", default="") == "EXECVE",
            event.deep_get("a0", default="").endswith("iptables"),
            event.deep_get("a1", default="") == "-t",
            event.deep_get("a2", default="") == "nat",
            any(
                [
                    "--to-ports 42" in json.dumps(event.to_dict()),
                    "--to-ports 43" in json.dumps(event.to_dict()),
                ]
            ),
        ]
    ):
        return True
    return False
