403Webshell
Server IP : 103.234.187.230  /  Your IP : 216.73.216.216
Web Server : Apache
System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/b2bzend/library/Catabatic/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/b2bzend/library/Catabatic/ValidateCustomer.php
<?php

class Catabatic_ValidateCustomer extends Zend_Controller_Action
{

    public $requestedId;
    public $checkCode;
    public $checkId;
    public $finalCode;
    public $input_data;
    private $secureCode = "SECURE";
    private $key = "GTX";
    public $amount;
    public $userID;
    private $ENC_KEY = "tripsbanklockkey";
    private $VECTOR = "myvector";

    public function init() {}

    function sanitize_data($input_data)
    {
        $searchArr = array("document", "write", "alert", "@", "$", ";", "+", "|", "#", "<", ">", "\'");
        $input_data = str_replace("script", "", $input_data);
        $input_data = str_replace("iframe", "", $input_data);
        $input_data = str_replace($searchArr, "", $input_data);
        return htmlentities(stripslashes($input_data), ENT_QUOTES);
    }
    static function sanitize_data_static($input_data)
    {
        $searchArr = array("document", "write", "alert", "@", "$", ";", "+", "|", "#", "<", ">", "\'");
        $input_data = str_replace("script", "", $input_data);
        $input_data = str_replace("iframe", "", $input_data);
        $input_data = str_replace($searchArr, "", $input_data);
        return htmlentities(stripslashes($input_data), ENT_QUOTES);
    }

    function sanitize_data_html($input_data)
    {
        $searchArr = array("document", "write", "alert", "@", "$", ";", "|");
        $input_data = str_replace("script", "", $input_data);
        $input_data = str_replace("iframe", "", $input_data);
        $input_data = str_replace($searchArr, "", $input_data);
        return $input_data;
    }

    public function GUID()
    {
        if (function_exists('com_create_guid') === true) {
            return trim(com_create_guid(), '{}');
        }
        return sprintf('%04X%04X%04X%04X%04X%04X%04X%04X', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(16384, 20479), mt_rand(32768, 49151), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535));
    }

    public function secureCode($id, $guid)
    {
        $requestedId = trim($id);
        $checkCode = trim($guid);
        $finalCode = $checkCode . $this->secureCode . $requestedId;
        $checkId = hash('sha256', "GTX-$finalCode");
        return $checkId;
    }

    public function walletCode($id, $guid, $amount, $userID, $planID, $BaseAmount, $StAMOUNT)
    {
        $requestedId = $this->sanitize_data($id);
        $checkCode = $this->sanitize_data($guid);
        $amount = $this->sanitize_data($amount);
        $planID = $this->sanitize_data($planID);
        $userID = $this->sanitize_data($userID);
        $BaseAmount = $this->sanitize_data(trim($BaseAmount));
        $StAMOUNT = $this->sanitize_data(trim($StAMOUNT));
        $finalCode = $checkCode . $this->secureCode . $requestedId . $this->secureCode . 'AMOUNT' . $amount . $this->secureCode . 'USERID' . $userID . $this->secureCode . 'PLANID' . $planID . $BaseAmount . $StAMOUNT;
        $checkId = hash('sha256', "$this->key-$finalCode");
        return $checkId;
    }

    public function getDec($input, $SecurityKey = '')
    {
        if (!empty($SecurityKey)) {
            $inputKey = $SecurityKey;
            $iv = substr($SecurityKey, 0, 16);
        } else {
            $inputKey = Catabatic_Helper::getEncrytInputKey();
            $iv = Catabatic_Helper::getEncrytIV();
        }
        $blockSize = Catabatic_Helper::getEncrytBlockKey();

        $aes = new Travel_Model_Encrytion($input, $inputKey, $iv, $blockSize);
        return $enc = $aes->decrypt();
    }

    public function getEnc($input, $SecurityKey = '')
    {
        if (!empty($SecurityKey)) {
            $inputKey = $SecurityKey;
            $iv = substr($SecurityKey, 0, 16);
        } else {
            $inputKey = Catabatic_Helper::getEncrytInputKey();
            $iv = Catabatic_Helper::getEncrytIV();
        }
        $blockSize = Catabatic_Helper::getEncrytBlockKey();
        $aes = new Travel_Model_Encrytion($input, $inputKey, $iv, $blockSize);
        return $enc = $aes->encrypt();
    }

    public function writeLogEmail($data, $fileName = '')
    {
        if ($fileName == '') {
            $fileName = date("Y-m-d") . "_email.txt";
        }

        $fp = fopen("data/" . $fileName, 'a+');
        $data = date("Y-m-d H:i:s") . " - " . $data;
        fwrite($fp, $data);
        fclose($fp);
    }

    static public function mailSentByElastice($emailData, $arrEmailStatistics = array(), $type = 0, $customerSysId = 0, $ccEmial = array(), $toEmail = array())
    {
        $url = 'https://api.elasticemail.com/v2/email/send';
        $to = implode(";", $emailData['to']);

        $ccEmialFinal = '';
        if (!empty($ccEmial)) {
            $ccEmialFinal = implode(";", $ccEmial);
        }
        $toEmialFinal = '';
        if (!empty($toEmail)) {
            $toEmialFinal = implode(";", $toEmail);
        } else {
            $toEmialFinal = $to;
        }
        try {
            $emailSenderKey = "";
            $agencySysId = $arrEmailStatistics['AgencySysId'];
            $model = new Gtxwebservices_Model_Webservices();
            $EmailKeyResult = $model->getAgencyEmailKey($agencySysId);
            $apiKey = isset($EmailKeyResult['EmailKey']) ? trim($EmailKeyResult['EmailKey']) : '';

            if (isset($apiKey) && $apiKey != "") {
                $emailSenderKey = $apiKey;
            } else {
                $emailSenderKey = 'CA4ED92049CFD42ADD6ABE771C0F30ECED774CA4A50D20CD1FFBD22EE33417B0ACB8BD2AA5A967BA5C87477C6529729C';
            }
            //echo $emailSenderKey; exit;
            $post = array(
                'from' => $emailData['fromEmail'],
                'fromName' => $emailData['fromName'],
                'apikey' => $emailSenderKey,
                'subject' => $emailData['subject'],
                'to' => $to,
                'msgTo' => $toEmialFinal,
                'msgCC' => $ccEmialFinal,
                'bodyHtml' => $emailData['bodyHtml'],
                'bodyText' => $emailData['bodyText'],
                'isTransactional' => true
            );

            $ch = curl_init();
            curl_setopt_array($ch, array(
                CURLOPT_URL => $url,
                CURLOPT_POST => true,
                CURLOPT_POSTFIELDS => $post,
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_HEADER => false,
                CURLOPT_SSL_VERIFYPEER => false
            ));
            $result = curl_exec($ch);
            curl_close($ch);
            if (count($arrEmailStatistics) > 0) {
                $mailResponse = json_decode($result, 1);
                $arrEmailStatistics['Title'] = $emailData['subject'];
                if ($mailResponse['success']) {
                    $arrEmailStatistics['Status'] = $mailResponse['success'];
                    $arrEmailStatistics['RefSysId'] = isset($mailResponse['data']['transactionid']) ? $mailResponse['data']['transactionid'] : '';
                }
                $arrEmailStatistics['CustomerSysId'] = $customerSysId;
                $arrEmailStatistics['UserType'] = $type;
                $objAgency = new Travel_Model_TblAgency();
                $objAgency->insertData("TB_Agency_Sent_Sms_Email", $arrEmailStatistics);
            }

            // print_r($result);die('dddddd');
        } catch (Exception $ex) {
            $result = $ex->getMessage();
        }
        return $result;
    }

    public function mailSentByElasticeForEmailer($emailData, $arrEmailStatistics = array())
    {
        $url = 'https://api.elasticemail.com/v2/email/send';
        $to = implode(";", $emailData['to']);
        try {
            $emailSenderKey = "";
            $APIKEY = $arrEmailStatistics['APIKEY'];
            if (isset($APIKEY) && $APIKEY != "") {
                $emailSenderKey = $APIKEY;
            } else {
                $emailSenderKey = 'CA4ED92049CFD42ADD6ABE771C0F30ECED774CA4A50D20CD1FFBD22EE33417B0ACB8BD2AA5A967BA5C87477C6529729C';
            }
            $post = array(
                'from' => $emailData['fromEmail'],
                'fromName' => $emailData['fromName'],
                'apikey' => $emailSenderKey,
                'subject' => $emailData['subject'],
                'to' => $to,
                'bodyHtml' => $emailData['bodyHtml'],
                'bodyText' => $emailData['bodyText'],
                'isTransactional' => false
            );
            $ch = curl_init();
            curl_setopt_array($ch, array(
                CURLOPT_URL => $url,
                CURLOPT_POST => true,
                CURLOPT_POSTFIELDS => $post,
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_HEADER => false,
                CURLOPT_SSL_VERIFYPEER => false
            ));
            $result = curl_exec($ch);
            curl_close($ch);
            //print_r($result);die('dddddd');
        } catch (Exception $ex) {
            $result = $ex->getMessage();
        }
        return $result;
    }

    public function mailSentByElasticeForEmailerUsingCSV($emailData, $arrEmailStatistics = array())
    {
        $url = 'https://api.elasticemail.com/v2/email/send';
        $to = implode(";", $emailData['to']);
        try {
            $emailSenderKey = "";
            $APIKEY = $arrEmailStatistics['APIKEY'];
            $filename = $arrEmailStatistics['FILENAME'];
            $fullPath = $_SERVER['DOCUMENT_ROOT'] . '/SendEmailCSV/';
            //$file_name_with_full_path = realpath('D:/Html/users/userweb733/Html/SendEmailCSV/'.$filename);
            $file_name_with_full_path = realpath($fullPath . $filename);
            if (isset($APIKEY) && $APIKEY != "") {
                $emailSenderKey = $APIKEY;
            } else {
                $emailSenderKey = 'CA4ED92049CFD42ADD6ABE771C0F30ECED774CA4A50D20CD1FFBD22EE33417B0ACB8BD2AA5A967BA5C87477C6529729C';
            }
            $post = array(
                'from' => $emailData['fromEmail'],
                'fromName' => $emailData['fromName'],
                'apikey' => $emailSenderKey,
                'subject' => $emailData['subject'],
                'file_contacts' => new CurlFile($file_name_with_full_path, 'text/csv', $filename),
                'mergesourcefilename' => $filename,
                'bodyHtml' => $emailData['bodyHtml'],
                'bodyText' => $emailData['bodyText'],
                'isTransactional' => false
            );
            $ch = curl_init();
            curl_setopt_array($ch, array(
                CURLOPT_URL => $url,
                CURLOPT_POST => true,
                CURLOPT_POSTFIELDS => $post,
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_HEADER => false,
                CURLOPT_SSL_VERIFYPEER => false
            ));
            $result = curl_exec($ch);
            curl_close($ch);
            //print_r($result);die('dddddd');
        } catch (Exception $ex) {
            $result = $ex->getMessage();
        }
        return $result;
    }

    public function getDecryptData($data, $iv = null)
    {
        $inputKey = Catabatic_Helper::getEncrytInputKey();
        if ($iv == null) {
            $iv = Catabatic_Helper::getEncrytIV();
        }
        $aes = new Travel_Model_Encrytion($data, $inputKey, $iv);
        return $enc = $aes->decrypt();
    }

    public function getEncrptData($data, $iv = null)
    {
        $inputKey = Catabatic_Helper::getEncrytInputKey();
        if ($iv == null) {
            $iv = Catabatic_Helper::getEncrytIV();
        }
        $aes = new Travel_Model_Encrytion($data, $inputKey, $iv);
        return $enc = $aes->encrypt();
    }

    public function base64_to_jpeg($base64_string, $FileType = 'png')
    {
        $fileName = $this->GUID();
        $output_file1 = Catabatic_Helper::getSiteUrl() . "public/ckeditor_image/" . $fileName . '.' . $FileType;
        $output_file = "public/ckeditor_image/" . $fileName . '.' . $FileType;
        $ifp = fopen($output_file, 'wb');
        $data = explode(',', $base64_string);
        fwrite($ifp, base64_decode($data[1]));
        fclose($ifp);
        return $output_file1;
    }

    function isValidDateddMMYYYY($date)
    {
        return preg_match("/^(\d{1,2})/(\d{1,2})/(\d{4})$/", $date, $m) ? checkdate(intval($m[2]), intval($m[1]), intval($m[3])) : false;
    }

    public function decrypt_cc($encryptedText, $key)
    {
        $key = $this->hextobin(md5($key));
        $initVector = pack("C*", 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
        $encryptedText = $this->hextobin($encryptedText);
        $decryptedText = openssl_decrypt($encryptedText, 'AES-128-CBC', $key, OPENSSL_RAW_DATA, $initVector);
        return $decryptedText;
    }

    public function encrypt_cc($plainText, $key)
    {
        $key = $this->hextobin(md5($key));
        $initVector = pack("C*", 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
        $openMode = openssl_encrypt($plainText, 'AES-128-CBC', $key, OPENSSL_RAW_DATA, $initVector);
        $encryptedText = bin2hex($openMode);
        return $encryptedText;
    }

    public function hextobin($hexString)
    {
        $length = strlen($hexString);
        $binString = "";
        $count = 0;
        while ($count < $length) {
            $subString = substr($hexString, $count, 2);
            $packedString = pack("H*", $subString);
            if ($count == 0) {
                $binString = $packedString;
            } else {
                $binString .= $packedString;
            }
            $count += 2;
        }
        return $binString;
    }

    public function createImageFromCkeditor($imageData, $packType = '')
    {


        $doc = new DOMDocument();
        @$doc->loadHTML($imageData);
        $tags = $doc->getElementsByTagName('img');

        foreach ($tags as $tag) {

            $imageString = $tag->getAttribute('src');
            $imageString = str_replace(['jpeg;base64', 'jpg;base64'], 'png;base64', $imageString);
            $imageStringCheck = explode('data:image/png;base64,', $imageString);
            if (count($imageStringCheck) > 1) {
                $isTrueImage = getimagesize($imageString);
                if (isset($isTrueImage['mime'])) {
                    $e = explode("/", $isTrueImage['mime']);
                    if ($e[0] == "image") {
                        $imagePath = $this->base64_to_jpeg($imageString);
                        $imageData = str_replace($imageString, $imagePath, $imageData);
                    }
                }
            }
        }
        return $imageData;
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit