<?php
/* Function that sends the payload to the specified url

Used for sending a payload to a target url and get the response

PARAMETERS:
$sUrl: url to attack
$aOptions: curl options

RETURNS:
ARRAY: connection statistics
*/

function PayloadSend($sUrl,$aOptions){
    
$ch curl_init($sUrl);
    
curl_setopt_array($ch,$aOptions);
    
$aResponse = array();
    
$aResponse['data'] = curl_exec($ch);
    
$aResponse['errornumber'] = curl_errno($ch);
    
$aResponse['errorstring'] = curl_error($ch);
    
curl_close($ch);
    return(
$aResponse);
}
// sets the curl options
$_CONTEXT['curloptions'] = array();
$_CONTEXT['curloptions'][CURLOPT_RETURNTRANSFER] = true;
$_CONTEXT['curloptions'][CURLOPT_SSL_VERIFYHOST] = false;
$_CONTEXT['curloptions'][CURLOPT_HEADER] = false;
$_CONTEXT['curloptions'][CURLOPT_FOLLOWLOCATION] = true;
$_CONTEXT['curloptions'][CURLOPT_USERAGENT] = "Googlebot/2.1 (+http://www.googlebot.com/bot.html)";
$_CONTEXT['curloptions'][CURLOPT_CONNECTTIMEOUT] = 30;
$_CONTEXT['curloptions'][CURLOPT_TIMEOUT] = 30;
$_CONTEXT['curloptions'][CURLOPT_MAXREDIRS] = 3;
?>