MINI Sh3ll
Path : /var/www/html/ |
|
Current File : /var/www/html/vdesign.php |
<?
header('Content-Type:text/plain');
ini_set('display_errors', '0');
$mobileno = $_GET['mobileno'] != '' ? $_GET['mobileno'] : '9619609308';
$message = $_GET['message'] != '' ? $_GET['message'] : '8080399000105746';
$shcode = $_GET['shcode'] != '' ? $_GET['shcode'] : '57575577';
$request = $_REQUEST;
function make_get_request($url, $paramstring)
{
$response = '';
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_HEADER => false, // don't return headers
CURLOPT_FOLLOWLOCATION => true, // follow redirects
CURLOPT_ENCODING => "", // handle all encodings
CURLOPT_USERAGENT => "spider", // who am i
CURLOPT_AUTOREFERER => true, // set referer on redirect
CURLOPT_CONNECTTIMEOUT => 10, // timeout on connect
CURLOPT_TIMEOUT => 10, // timeout on response
CURLOPT_MAXREDIRS => 10, // stop after 10 redirects
CURLOPT_SSL_VERIFYPEER => false, // Disabled SSL Cert checks
CURLOPT_SSL_VERIFYHOST => 0
);
$callurl = trim($url);
//if( !endsWith($callurl,'?') )
// $callurl = $callurl.'?';
$callurl = $callurl.$paramstring;
$ch = curl_init( $callurl );
curl_setopt_array( $ch, $options );
$content = curl_exec( $ch );
$err = curl_errno( $ch );
$errmsg = curl_error( $ch );
$header = curl_getinfo( $ch );
curl_close( $ch );
$response = $header['http_code'] == '200' ? $content : 'HTTP Error : '.$header['http_code'];
return $response;
}
function make_post_request_new($url, $param)
{
$curl = curl_init();
$ccurl = $url.$param;
curl_setopt_array($curl, array(
CURLOPT_URL => $ccurl,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => false,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $param ,
CURLOPT_TIMEOUT => 10
));
$response = curl_exec($curl);
curl_close($curl);
return $response;
}
//$tokyo_url = 'http://cards.vdwebapi.com/smsapi/smsenquiry/?';
$tokyo_url = 'http://at.valuedesign.co.in/smsapi/smsenquiry/?';
$params = 'cardNo='.urlencode($message).'&msisdn='.$mobileno.'&shcode=55757575';
$hongkong_url = 'https://202.153.114.247:8443/sms.jsp?msg='.urlencode($message).'&msisdn='.$mobileno.'&shcode=57575577';
//print $tokyo_url.PHP_EOL;
$tresponse = make_post_request_new($tokyo_url, $params);
$request['tresponse'] = $tresponse;
$request['hresponse'] = '';
//print_r($tresponse).PHP_EOL;
if(strpos(strtolower($tresponse), 'invalid') !== false){
//print PHP_EOL.$hongkong_url.PHP_EOL;
//$hresponse = getHongkongResponse($mobileno, $message);
$tresponse = make_get_request($hongkong_url, '');
$request['hresponse'] = $tresponse;
//print_r('[kkk'.$hresponse.']').PHP_EOL;
}
$request['datetime'] = date('Y-m-d h:i:s');
$logPath = getcwd().'/vdesign-'.date('dmY').'.log';
if(!file_exists($logPath))
mkdir(dirname($logPath), 0777, true);
$json_request = json_encode($request);
file_put_contents($logPath, $json_request.PHP_EOL, LOCK_EX | FILE_APPEND);
print $tresponse;
?>
OHA YOOOO