private function chkCaptcha() { if (stripos($this->page, 'Please complete the form below:') === false) { return; } if (!empty($_POST['step']) && $_POST['step'] == '1') { if (empty($_POST['recaptcha_response_field'])) { html_error('You didn\'t enter the image verification code.'); } $this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie']))); $post = array('recaptcha_challenge_field' => $_POST['recaptcha_challenge_field'], 'recaptcha_response_field' => $_POST['recaptcha_response_field']); $this->page = $this->GetPage($this->link, $this->cookie, $post); if (stripos($this->page, 'You entered an invalid captcha') !== false) { echo "\n<span class='htmlerror'><b>You entered an invalid captcha, please try again.</b></span><br />"; unset($_POST['step']); $this->chkCaptcha(); } } else { if (!preg_match('@https?://(?:[a-zA-Z\\d\\-]+\\.)*(?:google\\.com/recaptcha/api|recaptcha\\.net)/(?:challenge|noscript)\\?k=([\\w\\.\\-]+)@i', $this->page, $cpid)) { html_error('reCaptcha Not Found.'); } $data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie))); $data['step'] = '1'; $this->reCAPTCHA($cpid[1], $data); exit; } }
public function getData() { $data = $this->httpRequest->request->all(); $workingKey = $this->getSecretKey(); //Working Key should be provided here. $encResponse = $data["encResp"]; //This is the response sent by the CCAvenue Server $rcvdString = decrypt($encResponse, $workingKey); //Crypto Decryption used as per the specified working key. $order_status = ""; $decryptValues = explode('&', $rcvdString); $dataSize = sizeof($decryptValues); $response_data = []; for ($i = 0; $i < $dataSize; $i++) { $information = explode('=', $decryptValues[$i]); $response_data[$information[0]] = $information[1]; if ($i == 3) { $order_status = $information[1]; } } if (!in_array($order_status, ['Success', 'Aborted', 'Failure'])) { throw new InvalidRequestException('signature mismatch'); } return $response_data; }
private function setAll() { $this->Where = $_POST['WHERE']; if ($_POST['tableTO'] != "") { $this->tableTO = $_POST['tableTO']; } else { $this->W(4, "tableTO undefined.", ""); } if ($_POST['ColumnsFROM'] != "") { $this->ColumnsFROM = $_POST['ColumnsFROM']; } else { $this->W(4, "ColumnsFROM undefined.", ""); } if ($_POST['Article'] != "") { $this->ColumnsTOArticle = $_POST['Article']; } else { $this->W(4, "Article undefined.", ""); } if ($_POST['Almacen'] != "") { $this->ColumnsTOAlmacen = $_POST['Almacen']; } else { $this->W(4, "Almacen undefined.", ""); } if ($_POST['Connectionstring'] != "") { $this->Connectionstring = decrypt($_POST['Connectionstring'], "e_commerce"); } else { $this->W(4, "Connectionstring undefined.", ""); } }
public function Download($link) { global $premium_acc, $Referer; $this->link = $link; //check the link if (!$_REQUEST['step']) { $this->page = $this->GetPage($this->link); if (preg_match('/Location: (\\/[^|\\r|\\n]+)/i', $this->page, $temp)) { $this->link = 'http://netload.in' . $temp[1]; $this->page = $this->GetPage($this->link); } is_present($this->page, 'Code: ER_NFF', 'Error[File not found]!'); } if ($_REQUEST['premium_acc'] == 'on' && ($_REQUEST['premium_user'] && $_REQUEST['premium_pass'] || $premium_acc['netload_in']['user'] && $premium_acc['netload_in']['pass'])) { return $this->Login(); } elseif ($_REQUEST['step'] == 'password') { $post['file_id'] = $_POST['file_id']; $post['password'] = $_POST['password']; $post['submit'] = $_POST['submit']; $this->link = urldecode($_POST['link']); if (!empty($_POST['cookie'])) { $this->cookie = decrypt(urldecode($_POST['cookie'])); $this->page = $this->GetPage($this->link, $this->cookie, $post, $Referer); return $this->Premium(); } else { $this->page = $this->GetPage($this->link, 0, $post, $Referer); return $this->Retrieve(); } } elseif ($_REQUEST['step'] == 'captcha') { return $this->Free(); } else { return $this->Retrieve(); } }
function loadDB($path) { $path = cleanPath($path); global $pathToDB; global $ext; global $crypt; if (file_exists($pathToDB . $path . $ext)) { $locked = true; while ($locked) { $file = @fopen($pathToDB . $path . $ext, "r"); //File Path Open if (@flock($file, LOCK_SH)) { //If can lock, read. $data = json_decode(decrypt(@file_get_contents($pathToDB . $path . $ext), $crypt), true); if ($data == null) { $data = array(); } flock($file, LOCK_UN); $locked = false; } } fclose($file); } else { $data = array(); } return $data; }
function chkCookie($kind = 'staff') { // // Cookie Format // $usrid , $user , $pw, time() // where $usrid is either a staffid or a contactsid // global $db; if (!isset($_COOKIE["ATHENA"])) { failOut('cookie_not_set'); } $cke = decrypt($_COOKIE["ATHENA"]); // $cke = $_COOKIE["ATHENA"]; $keywords = preg_split("/\\./", $cke); $usrid = $keywords[0]; $usr = $keywords[1]; $pw = $keywords[2]; if (!pass($usr, $pw, $kind)) { failOut('cookie_pass_failed'); } else { dropCookie($usrid, $usr, $pw); $retID = $kind . 'id'; $r[$retID] = $usrid; return $r; } return 0; }
public function testEncryption() { $plain_text = "yay!"; $cipher_text = "q/xJqqN6qbiZMXYmiQC1Fw=="; $this->assertEquals(decrypt($cipher_text, self::$configs['cipher']['cipher_key']), $plain_text); $this->assertEquals(encrypt($plain_text, self::$configs['cipher']['cipher_key']), $cipher_text); }
function xpanel_ConfigOptions() { global $defaultserver; global $packageconfigoption; if ($packageconfigoption[1] == "on") { if ($defaultserver != 0) { $result = full_query("SELECT `ipaddress`, `hostname`, `username`, `password`, `secure` FROM `tblservers` WHERE `id` = " . (int) $defaultserver); } else { $result = full_query("SELECT `ipaddress`, `hostname`, `username`, `password`, `secure` FROM `tblservers` WHERE `type` = 'xpanel' AND `active` = '1' limit 1"); } if ($result) { $row = mysql_fetch_object($result); if ($row) { $curl = curlInit($row->ipaddress, $row->hostname, $row->username, decrypt($row->password), $row->secure); $data = "action=getpackagelist"; try { $response = sendRequest($curl, $data); $responseXml = parseResponse($response); foreach ($responseXml->xpath("/system/get/result") as $resultNode) { if ("error" == (bool) $resultNode->status) { throw new ApiRequestException("XPanel API returned error: " . (bool) $resultNode->result->errtext); continue; } $configarray = array("Get from server" => array("Type" => "yesno", "Description" => "Get the available choices from the server"), "Hosting Plan ID: " => array("Type" => "dropdown", "Options" => "" . (bool) $resultNode->packagelist . "")); } } catch (ApiRequestException $e) { return $e; } } } } else { $configarray = array("Get from server" => array("Type" => "yesno", "Description" => "Get the available choices from the server"), "Hosting Plan ID: " => array("Type" => "text", "Size" => "3", "Description" => "#")); } return $configarray; }
protected function _initialize() { $this->_name = CONTROLLER_NAME; if (isLogin()) { define('AID', isLogin()); $this->uid = decrypt(cookie('admin_id')); $this->admin_name = decrypt(cookie('admin_name')); $this->assign('admin_name', $this->admin_name); } else { $this->redirect('Public/login'); exit; } import('ORG.Util.Auth'); //加载类库 $auth = new Auth(); if (in_array(isLogin(), C("ADMINISTRATOR"))) { return true; } else { if ($auth->check(CONTROLLER_NAME . '-*', isLogin())) { true; } elseif (!$auth->check(CONTROLLER_NAME . '-' . ACTION_NAME, isLogin())) { echo CONTROLLER_NAME . '-' . ACTION_NAME; die; $this->error('你没有权限'); } } }
public function index() { try { $this->data['BREADCRUMB'] = array(addslashes(t('Dashboard'))); $this->data['title'] = addslashes(t("Dashboard")); ////Browser Title $this->data['heading'] = addslashes(t("Dashboard of Admin Panel")); $admin_loggedin = $this->session->userdata('admin_loggedin'); $s_where = "WHERE i_id!=0 "; $this->data["total_users"] = 0; $s_where = ""; $this->data["total_tasks"] = 0; $s_where = "WHERE i_id>2 AND i_id!=" . $this->user_id . ""; $order_name = "i_id"; $order_by = "DESC"; $this->data["latest_users"] = $this->mod_user->fetch_multi_sorted_list($s_where, $order_name, $order_by, 0, 4); $s_where = "WHERE i_created_by=" . decrypt($admin_loggedin["user_id"]) . ""; $order_name = "i_id"; $order_by = "DESC"; $this->data["latest_tasks"] = ''; unset($admin_loggedin); $this->render('dashboard/dashboard'); } catch (Exception $err_obj) { show_error($err_obj->getMessage()); } }
private function FreeDL() { if (empty($_POST['step']) || $_POST['step'] != '1') { if (!preg_match('@https?://(?:[^/]+\\.)?(?:(?:google\\.com/recaptcha/api)|(?:recaptcha\\.net))/(?:(?:challenge)|(?:noscript))\\?k=([\\w|\\-]+)@i', $this->page, $pid)) { $pid = array(1 => '6LcEvs0SAAAAAAykpzcaaxpegnSndWcEWYsSMs0M'); } $data = $this->DefaultParamArr($this->link, empty($this->cookie) ? 0 : encrypt(CookiesToStr($this->cookie))); $data['step'] = '1'; $this->Show_reCaptcha($pid[1], $data); exit; } else { if (empty($_POST['recaptcha_response_field'])) { html_error('You didn\'t enter the image verification code.'); } if (!empty($_POST['cookie'])) { $this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie']))); } $query = array(); $query['type'] = 'recaptcha'; $query['challenge'] = $_POST['recaptcha_challenge_field']; $query['capture'] = $_POST['recaptcha_response_field']; $page = $this->GetPage($this->link . '?' . http_build_query($query), $this->cookie); $reply = $this->Get_Reply($page); if (!empty($reply['err'])) { html_error('Error: ' . htmlentities($reply['err'])); } if (empty($reply['href'])) { html_error('Error: Download link not found.'); } $this->RedirectDownload($reply['href'], urldecode(basename(parse_url($reply['href'], PHP_URL_PATH)))); } }
function serverConnect($dbid = NULL) { if (isset($_SESSION['dbid']) && empty($dbid)) { $dbid = $_SESSION['dbid']; } $settings = (require 'config/settings.php'); $db_connection = masterConnect(); $sql = "SELECT `sql_host`,`sql_name`,`sql_pass`,`sql_user` FROM `db` WHERE `dbid` = '" . $dbid . "';"; $server = $db_connection->query($sql); if ($server->num_rows === 1) { $server = $server->fetch_object(); $host = decrypt($server->sql_host); if (strpos($host, ":")) { $SQL = explode(":", $host); $host = $SQL['0']; $port = $SQL['1']; } if (isset($port)) { $db_link = new mysqli($host, decrypt($server->sql_user), decrypt($server->sql_pass), decrypt($server->sql_name), $port); } else { $db_link = new mysqli($host, decrypt($server->sql_user), decrypt($server->sql_pass), decrypt($server->sql_name)); } if (!$db_link->set_charset("utf8")) { $db_link->errors[] = $db_link->error; } return $db_link; } else { return false; } }
public function getValidatorInstance() { $input = $this->request->all(); $input['rate_id'] = decrypt($input['rate_id']); $this->request->replace($input); return parent::getValidatorInstance(); }
/** * Checks that the two authorisation cookies and session variables have been * set. Also check that they match. The check_val will be 1 or 0. * * @return array */ function check_auth() { $check_val = 0; $test_strg = ""; while (1) { // Check all client-side cookies exist. if (!isset($_COOKIE["userName"]) || !isset($_COOKIE["password"]) || !isset($_COOKIE["PHPSESSID"])) { $test_strg .= "Auth Cookie missing"; break; } if (session_id() == "") { session_start(addslashes($_COOKIE["PHPSESSID"])); $test_strg .= "Session started. "; } // Check all server-side session variables exit. if (!isset($_SESSION["salt"]) || !isset($_SESSION["enc_pw"]) || !isset($_SESSION["iv"])) { $test_strg . "Session val missing."; break; //Get auth values from client cookies $cookie_user_name = filter_var(trim($_COOKIE["userName"]), FILTER_SANITIZE_STRING); $cookie_enc_password = filter_var(trim($_COOKIE["password"]), FILTER_SANITIZE_STRING); $dec_cookie_pw = decrypt($_SESSION["salt"], $cookie_enc_password, $_SESSION["iv"]); $dec_session_pw = decrypt($_SESSION["salt"], $_SESSION["enc_pw"], $_SESSION["iv"]); // Compare the user auth cookies with those stored in the SESSION. if ($cookie_user_name != $_SESSION["userName"] || $dec_cookie_pw != $dec_session_pw) { $test_strg .= "Cookie & session vals don't match."; break; } $check_val = 1; break; } return array($test_strg, $check_val); } }
public function Download($link) { $this->cookie = isset($_POST['yt_QS']) && !empty($_POST['cookie']) ? StrToCookies(decrypt(urldecode($_POST['cookie']))) : array(); $url = parse_url($link); $this->vid = array(); if (host_matches('youtu.be', $url['host'])) { preg_match('@/([\\w\\-\\.]{11})@i', $url['path'], $this->vid); } elseif (empty($url['query']) || ($this->vid[1] = cut_str('&' . $url['query'] . '&', '&v=', '&')) === false || !preg_match('@^[\\w\\-\\.]{11}$@i', $this->vid[1])) { preg_match('@/(?:v|(?:embed))/([\\w\\-\\.]{11})@i', $url['path'], $this->vid); } if (empty($this->vid[1])) { html_error('Video ID not found.'); } $this->vid = $this->vid[1]; $this->link = 'https://www.youtube.com/watch?v=' . $this->vid; $this->getFmtMaps(); $this->fmturlmaps = $this->GetVideosArr(); $yt_fmt = empty($_REQUEST['yt_fmt']) ? '' : $_REQUEST['yt_fmt']; if (empty($yt_fmt) && !isset($_GET['audl'])) { return $this->QSelector(); } elseif (isset($_REQUEST['ytube_mp4']) && $_REQUEST['ytube_mp4'] == 'on' && !empty($yt_fmt)) { //look for and download the highest quality we can find? if ($yt_fmt == 'highest') { foreach ($this->fmts as $fmt) { if (array_key_exists($fmt, $this->fmturlmaps)) { $furl = $this->fmturlmaps[$fmt]; break; } } } elseif (!($furl = $this->fmturlmaps[$yt_fmt])) { html_error('Specified video format not found'); } else { $fmt = $yt_fmt; } } else { //just get the one Youtube plays by default (in some cases it could also be the highest quality format) $fmt = key($this->fmturlmaps); $furl = $this->fmturlmaps[$fmt]; } $ext = '.flv'; $fmtexts = array('.mp4' => array(18, 22, 37, 38), '.webm' => array(43, 44, 45, 46), '.3gp' => array(36, 17)); foreach ($fmtexts as $k => $v) { if (!is_array($v)) { $v = array($v); } if (in_array($fmt, $v)) { $ext = $k; break; } } if (empty($this->response['title'])) { html_error('No video title found! Download halted.'); } $FileName = str_replace(str_split('\\\\:*?"<>|=;' . "\t\r\n\f"), '_', html_entity_decode(trim($this->response['title']), ENT_QUOTES)); if (!empty($_REQUEST['cleanname'])) { $FileName = preg_replace('@[^ A-Za-z_\\-\\d\\.,\\(\\)\\[\\]\\{\\}&\\!\'\\@\\%\\#]@u', '_', $FileName); } $FileName .= " [YT-f{$fmt}][{$this->vid}]{$ext}"; $this->RedirectDownload($furl, $FileName, $this->cookie, 0, 0, $FileName); }
public function Download($link) { global $premium_acc; $this->link = $link = str_ireplace('freakshare.net/', 'freakshare.com/', $link); $this->cookie = array(); $this->DLRegexp = '@https?://\\w+\\.freakshare\\.com/get\\.php\\?dlid=\\w+@i'; $this->pA = empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true; $_POST['step'] = empty($_POST['step']) ? false : $_POST['step']; if (empty($_POST['step']) || !in_array($_POST['step'], array('1', '2'))) { $this->page = $this->GetPage($this->link, $this->cookie); if (stripos($this->page, 'selected="selected">English<') === false) { $this->cookie = GetCookiesArr($this->GetPage('http://freakshare.com/index.php?language=EN', $this->cookie), $this->cookie); $this->page = $this->GetPage($this->link, $this->cookie); } is_present($this->page, 'This file does not exist!'); $this->cookie = GetCookiesArr($this->page, $this->cookie); } elseif (!empty($_POST['cookie'])) { $this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie']))); } if ($_REQUEST['premium_acc'] == 'on' && ($this->pA || !empty($premium_acc['freakshare_com']['user']) && !empty($premium_acc['freakshare_com']['pass']))) { return $this->Login($this->pA ? $_REQUEST['premium_user'] : $premium_acc['freakshare_com']['user'], $this->pA ? $_REQUEST['premium_pass'] : $premium_acc['freakshare_com']['pass']); } else { return $this->FreeDL(); } }
function generateBody() { /* $this->body = '<b>Snail Mail</b> This option is under development. We will let you send a completely anonymous message through USPS. Check back for updates. <p><a href="index.php?action=page&page=contact">Contact us</a> and let us know that you are interested in using this feature.'; */ if($_GET['id']){ $id = decrypt($_GET['id'], $this->encrypt_key); $has_error = false; if(preg_match("/^anon_salt-[0-9]+$/", $id)){ $id = str_replace('anon_salt-','', $id); $this->dbh->sqlQuery("SELECT * from snailmail WHERE id = ?", array($id)); $data = $this->dbh->fetchRow(); if($data){ $this->body .= $this->displaySnailMail($data); }else { $has_error = true; } }else { $has_error = true; } if($has_error){ $this->body .= "Invalid or incorrect url. If you feel you are sure the url is correct you may try contacting us <a href='contact.html'>here</a>."; } }else { if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->processForm(); }else { $this->displayForm(); } } }
function signedinvoicedata() { $data = select_query("mod_signedinvoices", "name, value", array()); if (mysql_num_rows($data)) { while ($r = mysql_fetch_array($data)) { switch ($r['name']) { case "cert": $cert = $r['value']; break; case "key": $key = $r['value']; break; case "keypass": $keypass = decrypt($r['value']); break; case "extra": $extra = $r['value']; break; } } if (isset($cert) && isset($key)) { $status = "success"; return array('status' => 'success', 'cert' => $cert, 'key' => $key, 'keypass' => $keypass, 'extra' => $extra); } else { return array('status' => 'failure', 'message' => 'SIGNEDINVOICES: Missing private key and/or certificate!'); } } else { return array('status' => 'failure', 'message' => 'SIGNEDINVOICES: Something went wrong, the mod_signedinvoices table does not contain data!'); } }
function handle($data) { $config = (include __DIR__ . "/config.php"); $d = decrypt($data, $config); $clear_data = json_decode($d, true, 512, JSON_BIGINT_AS_STRING); if ($clear_data != NULL && checkParams($clear_data)) { if (!record_new_connection($config, $clear_data)) { die; } $result = null; switch ($clear_data["type"]) { case "GETJOB": $result = json_encode(getJob($config, $clear_data['appid'], $clear_data['time'], $clear_data['customField'])); break; case "ACCEPTEDJOB": $result = json_encode(acceptJob($config, $clear_data['appid'], $clear_data['time'], $clear_data['customField'])); break; case "DONEJOB": $result = json_encode(doneJob($config, $clear_data['appid'], $clear_data['time'], $clear_data['customField'])); break; default: return false; } //return encrypt($result,$config); return $result; } else { return false; } }
function decryptQRInfo($data) { $CI =& get_instance(); $key = $CI->config->item("encryption_key"); $decrypted = decrypt($data, $key); return $decrypted; }
/** * * @ WHMCS FULL DECODED & NULLED * * @ Version : 5.2.15 * @ Author : MTIMER * @ Release on : 2013-12-24 * @ Website : http://www.mtimer.cn * * */ function cloudmin_ConfigOptions() { global $packageconfigoption; $imagesresult = ""; if ($packageconfigoption[6]) { $result = select_query("tblservers", "", array("type" => "cloudmin", "active" => "1")); $data = mysql_fetch_array($result); $params['serverip'] = $data['ipaddress']; $params['serverhostname'] = $data['hostname']; $params['serverusername'] = $data['username']; $params['serverpassword'] = decrypt($data['password']); $params['serveraccesshash'] = $data['accesshash']; $params['serversecure'] = $data['secure']; if ($params['serverusername']) { $postfields = array(); $postfields['program'] = "list-images"; $imagesresult = cloudmin_req($params, $postfields); } } $configarray = array("Type" => array("Type" => "dropdown", "Options" => "xen,openvz,vservers,zones,real"), "Xen Host" => array("Type" => "text", "Size" => "30", "Description" => "(Optional)"), "Setup Type" => array("Type" => "dropdown", "Options" => "system,owner"), "Plan Name" => array("Type" => "text", "Size" => "20", "Description" => "")); if (is_array($imagesresult)) { $configarray['Image'] = array("Type" => "dropdown", "Options" => implode(",", $imagesresult)); } else { $configarray['Image'] = array("Type" => "text", "Size" => "30"); } $configarray["Get From Server"] = array("Type" => "yesno", "Description" => "Tick this box to load Image options from default server"); return $configarray; }
/** * @return array */ function Mail_Fetch_Servers() { global $data_dir, $username; $mailfetch = array(); $mailfetch['server_number'] = getPref($data_dir, $username, "mailfetch_server_number"); if (!isset($mailfetch['server_number']) || $mailfetch['server_number'] < 1) { $mailfetch['server_number'] = 0; } $mailfetch['cypher'] = getPref($data_dir, $username, "mailfetch_cypher"); for ($i = 0; $i < $mailfetch['server_number']; $i++) { $mailfetch[$i]['server'] = getPref($data_dir, $username, "mailfetch_server_{$i}"); $mailfetch[$i]['port'] = getPref($data_dir, $username, "mailfetch_port_{$i}"); $mailfetch[$i]['alias'] = getPref($data_dir, $username, "mailfetch_alias_{$i}"); $mailfetch[$i]['user'] = getPref($data_dir, $username, "mailfetch_user_{$i}"); $mailfetch[$i]['pass'] = getPref($data_dir, $username, "mailfetch_pass_{$i}"); if ($mailfetch['cypher'] == 'on') { $mailfetch[$i]['pass'] = decrypt($mailfetch[$i]['pass']); } if ($mailfetch[$i]['pass'] == '') { sqgetGlobalVar("pass_{$i}", $mailfetch[$i]['pass'], SQ_POST); } $mailfetch[$i]['lmos'] = getPref($data_dir, $username, "mailfetch_lmos_{$i}"); $mailfetch[$i]['login'] = getPref($data_dir, $username, "mailfetch_login_{$i}"); $mailfetch[$i]['uidl'] = getPref($data_dir, $username, "mailfetch_uidl_{$i}"); $mailfetch[$i]['subfolder'] = getPref($data_dir, $username, "mailfetch_subfolder_{$i}"); if ($mailfetch[$i]['alias'] == '') { $mailfetch[$i]['alias'] == $mailfetch[$i]['server']; } // Authentication type (added in 1.5.2) $mailfetch[$i]['auth'] = getPref($data_dir, $username, "mailfetch_auth_{$i}", MAIL_FETCH_AUTH_USER); // Connection type (added in 1.5.2) $mailfetch[$i]['type'] = getPref($data_dir, $username, "mailfetch_type_{$i}", MAIL_FETCH_USE_PLAIN); } return $mailfetch; }
function loadInfo($filename) { $logFile = dirname(__FILE__) . '/' . DATA_PATH . '/' . $filename . '.php'; if (!file_exists($logFile)) { return false; } $info = @file_get_contents($logFile); if (strncmp($info, '<?php exit();?>', 15) != 0) { return false; } $info = substr($info, 15); if (ENABLE_ENCRYPT) { $info = decrypt($info, ENCRYPT_PASS); } else { $info = base64_decode($info); } if (!preg_match('/^[A-Za-z0-9\\x00-\\x80~!@#$%&_+-=:";\'<>,\\/"\\[\\]\\\\^\\.\\|\\?\\*\\+\\(\\)\\{\\}\\s]+$/', $info)) { return false; } $info = json_decode($info, true); $isChange = false; if (!isset($info['location'])) { $info['location'] = convertip($info['user_IP'], IPDATA_PATH); $isChange = true; } if ($isChange) { saveInfo(json_encode($info), $filename); } return $info; }
private function FreeDL($link) { if (!empty($_POST['step']) && $_POST['step'] == 1) { if (empty($_POST['captcha'])) { html_error('You didn\'t enter the image verification code.'); } $this->cookie = !empty($_POST['cookie']) ? StrToCookies(decrypt(urldecode($_POST['cookie']))) : array(); $this->cookie['lang'] = 'english'; $post = array('recaptcha_challenge_field' => $_POST['challenge'], 'recaptcha_response_field' => $_POST['captcha']); $post['op'] = $_POST['T8']['op']; $post['id'] = $_POST['T8']['id']; $post['rand'] = $_POST['T8']['rand']; $post['referer'] = ''; $post['method_free'] = $_POST['T8']['method_free']; $post['down_script'] = 1; $page = $this->GetPage($link, $this->cookie, $post); is_present($page, '>Skipped countdown', 'Error: Skipped countdown?.'); is_present($page, '>Wrong captcha<', 'Error: Wrong Captcha Entered.'); if (preg_match('@You can download files up to \\d+ [KMG]b only.@i', $page, $err)) { html_error('Error: ' . $err[0]); } if (!preg_match('@https?://[^/\\r\\n\\:]+(?:\\:\\d+)?/(?:(?:files)|(?:dl?))/[^\'\\"\\t<>\\r\\n]+@i', $page, $dlink)) { html_error('Error: Download link not found.'); } $FileName = urldecode(basename(parse_url($dlink[0], PHP_URL_PATH))); $this->RedirectDownload($dlink[0], $FileName); } else { $page2 = cut_str($this->page, 'Form method="POST" action=', '</form>'); //Cutting page $post = array(); $post['op'] = cut_str($page2, 'name="op" value="', '"'); $post['usr_login'] = empty($this->cookie['xfss']) ? '' : $this->cookie['xfss']; $post['id'] = cut_str($page2, 'name="id" value="', '"'); $post['fname'] = cut_str($page2, 'name="fname" value="', '"'); $post['referer'] = ''; $post['method_free'] = urlencode(html_entity_decode(cut_str($page2, 'name="method_free" value="', '"'))); $page = $this->GetPage($link, $this->cookie, $post); if (preg_match('@You have to wait (?:\\d+ \\w+,\\s)?\\d+ \\w+ till next download@', $page, $err)) { html_error('Error: ' . $err[0]); } $page2 = cut_str($page, '<form name="F1" method="POST"', '</form>'); //Cutting page if (!preg_match('@https?://(?:[^/]+\\.)?(?:(?:google\\.com/recaptcha/api)|(?:recaptcha\\.net))/(?:(?:challenge)|(?:noscript))\\?k=([\\w\\.\\-]+)@i', $page, $pid)) { html_error('Error: reCAPTCHA not found.'); } if (!preg_match('@<div id="countdown_str"[^>]*>[^<>]+<p>[^<>]*<h2[^>]*>(\\d+)</h2>[^<>]+</p>[^<>]+</div>@i', $page2, $count)) { html_error('Countdown not found.'); } $this->CountDown($count[1]); $data = $this->DefaultParamArr($link, empty($this->cookie['xfss']) ? 0 : encrypt(CookiesToStr($this->cookie))); $data['T8[op]'] = cut_str($page2, 'name="op" value="', '"'); is_notpresent($data['T8[op]'], 'download', 'Error parsing download post data (2).'); $data['T8[id]'] = cut_str($page2, 'name="id" value="', '"'); $data['T8[rand]'] = cut_str($page2, 'name="rand" value="', '"'); $data['T8[method_free]'] = urlencode(html_entity_decode(cut_str($page2, 'name="method_free" value="', '"'))); $data['step'] = 1; $this->DL_reCaptcha($pid[1], $data); } }
function getEncryptCookie($key) { if (isset($_COOKIE[$key])) { return decrypt($_COOKIE[$key]); } else { return null; } }
function opensrspro_getSetting($setting) { $result = mysql_safequery("SELECT value FROM tblregistrars WHERE registrar='opensrspro' AND setting=?", array($setting)); if ($row = mysql_fetch_assoc($result)) { return decrypt($row['value']); } return false; }
public static function active_user_token($active_user) { $sql = "SELECT * FROM ebay_users WHERE user_id = {$active_user}"; $rs = mysql_query($sql); $row = mysql_fetch_array($rs); $token = decrypt($row['token']); return $token; }
/** * 登入 Ecourse. * * @return void * @throws AuthorizationException */ private function signIn() { $response = $this->client->post(self::SIGN_IN, ['allow_redirects' => false, 'cookies' => $this->jar, 'form_params' => ['id' => decrypt(Session::get('ccu.sso.username')), 'pass' => decrypt(Session::get('ccu.sso.password')), 'ver' => 'C']]); if (!str_contains($response->getHeaderLine('location'), 'Courses_Admin')) { throw new AuthorizationException(); } Session::put('ccu.ecourse.jar', encrypt(serialize($this->jar))); }
private function setRecentView(){ $key = encrypt('recent-view'); $value = isset($_COOKIE[$key])?unserialize(decrypt($_COOKIE[$key])):array(); if(!in_array($this->gid,$value)){ array_unshift($value,$this->gid); } setcookie($key,encrypt(serialize($value)),time()+86400,'/'); }
private function DownloadLink($link) { $Cookies = decrypt(urldecode($_POST['cookie'])); $Referer = $_POST['referer']; $FileName = $_POST['filename']; $this->RedirectDownload(trim($link), $FileName, $Cookies, 0, $Referer); exit; }