def __init__(self, proxy, target, payload=None): """ Constructor :param proxy: Proxy object used by this attack method :param target: Target (Destination Object) of the DOS attack :param payload: Optional payload to send to the target (default= None) """ AttackMethod.__init__(self, proxy, target) self._payload = payload
def __init__(self, proxy, target_host, method="GET"): """ Constructor :param proxy: The proxy that this Attack method will use. :param target_host: The target address and port in the form of a Destination object. :param method: The request method which the HTTPAttack will use. The method can be POST or GET (GET by default) """ AttackMethod.__init__(self, proxy, target_host) if method == "GET" or method == "POST": self._http_request = HttpRequest(method, "/", ExampleHttpHeaders['default']) else: raise ValueError("The method " + method + " is not recognised as a valid option for the HTTPAttack module.")