Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP7 Decoder for ionCube Encoder)
- *
- * @ Version : 4.0.8.0
- * @ Author : DeZender
- * @ Release on : 12.11.2018
- * @ Official site : http://DeZender.Net
- *
- */
- class AntiFlood
- {
- const OPTION_COUNTER_RESET_SECONDS = 'COUNTER_RESET_SECONDS';
- const OPTION_BAN_REMOVE_SECONDS = 'BAN_REMOVE_SECONDS';
- const OPTION_MAX_REQUESTS = 'MAX_REQUESTS';
- const OPTION_DATA_PATH = 'DATA_PATH';
- private $options;
- private $ip;
- public function __construct($overrideOptions = [])
- {
- $this->options = array_merge(['COUNTER_RESET_SECONDS' => 2, 'MAX_REQUESTS' => 5, 'BAN_REMOVE_SECONDS' => 60, 'DATA_PATH' => '/tmp/antiflood_' . str_replace(['www.', '.'], ['', '_'], $_SERVER['SERVER_NAME'])], $overrideOptions);
- @mkdir($this->options['DATA_PATH']);
- $this->ip = $_SERVER['REMOTE_ADDR'];
- }
- public function isBanned()
- {
- $controlLockFile = $this->options['DATA_PATH'] . '/' . str_replace('.', '_', $this->ip);
- if (file_exists($controlLockFile)) {
- if ($this->options['BAN_REMOVE_SECONDS'] < (time() - filemtime($controlLockFile))) {
- unlink($controlLockFile);
- }
- else {
- touch($controlLockFile);
- return true;
- }
- }
- $controlFile = $this->options['DATA_PATH'] . '/ctrl';
- $control = [];
- if (file_exists($controlFile)) {
- $fh = fopen($controlFile, 'r');
- $fileContentsArr = (0 < filesize($controlFile) ? json_decode(fread($fh, filesize($controlFile)), true) : []);
- $control = array_merge($control, $fileContentsArr);
- fclose($fh);
- }
- if (isset($control[$this->ip])) {
- if ((time() - $control[$this->ip]['t']) < $this->options['COUNTER_RESET_SECONDS']) {
- $control[$this->ip]['c']++;
- }
- else {
- $control[$this->ip]['c'] = 1;
- }
- }
- else {
- $control[$this->ip]['c'] = 1;
- }
- $control[$this->ip]['t'] = time();
- if ($this->options['MAX_REQUESTS'] < $control[$this->ip]['c']) {
- $fh = fopen($controlLockFile, 'w');
- fwrite($fh, '');
- fclose($fh);
- }
- $fh = fopen($controlFile, 'w');
- fwrite($fh, json_encode($control));
- fclose($fh);
- return false;
- }
- }
- class SmmApi
- {
- static public function registerSmm($username, $password, $repassword)
- {
- if ((strlen($username) < 5) || ($password != $repassword) || (strlen($password) < 6)) {
- return ['status' => 0, 'error' => 'Kullanıcı Adınız en 5 karakter olmalı, Şifreniz 6 yada daha uzun karakter ve tekrar yazdığınız şifreniz ile eşleşmelidir.'];
- }
- return self::request('register', 'username=' . $username . '&password=' . $password);
- }
- static public function postDataSmm($endpoint, $post = NULL)
- {
- return self::request($endpoint, $post ? http_build_query($post) : $post);
- }
- static public function getDataSmm($endpoint, $get = NULL)
- {
- return self::request($endpoint, $get ? http_build_query($get) : $get);
- }
- static private function request($endpoint, $post = NULL)
- {
- $headers = ['INSTAWEBAUTH: ' . Wow::get('ayar/InstaWebSmmAuth')];
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_USERAGENT, md5('InstaWebBot google'));
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_HEADER, true);
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- curl_setopt($ch, CURLOPT_VERBOSE, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
- curl_setopt($ch, CURLOPT_ENCODING, '');
- curl_setopt($ch, CURLOPT_URL, 'https://lsd.insta.web.tr/smm-api/' . $endpoint);
- if ($post) {
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
- }
- $resp = curl_exec($ch);
- $header_len = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
- $header = substr($resp, 0, $header_len);
- $body = substr($resp, $header_len);
- curl_close($ch);
- return json_decode($body, true, 512, JSON_BIGINT_AS_STRING);
- }
- }
- class Signatures
- {
- static public function generateSignature($data)
- {
- return hash_hmac('sha256', $data, Constants::IG_SIG_KEY);
- }
- static public function signData(array $data, array $exclude = [])
- {
- $result = [];
- foreach ($exclude as $key) {
- if (isset($data[$key])) {
- $result[$key] = $data[$key];
- unset($data[$key]);
- }
- }
- foreach ($data as &$value) {
- if (is_scalar($value)) {
- $value = (string) $value;
- }
- }
- unset($value);
- $data = json_encode((object) Utils::reorderByHashCode($data));
- $result['ig_sig_key_version'] = Constants::SIG_KEY_VERSION;
- $result['signed_body'] = self::generateSignature($data) . '.' . $data;
- return Utils::reorderByHashCode($result);
- }
- static public function generateDeviceId()
- {
- $megaRandomHash = md5(number_format(microtime(true), 7, '', ''));
- return 'android-' . substr($megaRandomHash, 16);
- }
- static public function generateUUID($keepDashes = true)
- {
- $uuid = sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 4095) | 16384, mt_rand(0, 16383) | 32768, mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535));
- return $keepDashes ? $uuid : str_replace('-', '', $uuid);
- }
- }
- class Utils
- {
- const BOUNDARY_CHARS = '-_1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
- const BOUNDARY_LENGTH = 30;
- static public function generateMultipartBoundary()
- {
- $result = '';
- $max = strlen('-_1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') - 1;
- for ($i = 0; $i < 30; ++$i) {
- $result .= '-_1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'[mt_rand(0, $max)];
- }
- return $result;
- }
- static public function hashCode($string)
- {
- $result = 0;
- $len = strlen($string);
- for ($i = 0; $i < $len; ++$i) {
- $result = ((-1 * $result) + ($result << 5) + ord($string[$i])) & 4294967295.0;
- }
- if (4 < PHP_INT_SIZE) {
- if (2147483647 < $result) {
- $result -= 4294967296.0;
- }
- else if ($result < -2147483648.0) {
- $result += 4294967296.0;
- }
- }
- return $result;
- }
- static public function reorderByHashCode(array $data)
- {
- $hashCodes = [];
- foreach ($data as $key => $value) {
- $hashCodes[$key] = self::hashCode($key);
- }
- uksort($data, function($a, $b) use($hashCodes) {
- $a = $hashCodes[$a];
- $b = $hashCodes[$b];
- if ($a < $b) {
- return -1;
- }
- else if ($b < $a) {
- return 1;
- }
- else {
- return 0;
- }
- });
- return $data;
- }
- static public function generateUploadId()
- {
- return number_format(round(microtime(true) * 1000), 0, '', '');
- }
- static public function generateUserBreadcrumb($size)
- {
- $key = 'iN4$aGr0m';
- $date = (int) microtime(true) * 1000;
- $term = (rand(2, 3) * 1000) + ($size * rand(15, 20) * 100);
- $text_change_event_count = round($size / rand(2, 3));
- if ($text_change_event_count == 0) {
- $text_change_event_count = 1;
- }
- $data = $size . ' ' . $term . ' ' . $text_change_event_count . ' ' . $date;
- return base64_encode(hash_hmac('sha256', $data, $key, true)) . "\n" . base64_encode($data) . "\n";
- }
- static public function cookieToArray($string, $domain)
- {
- $arrCookies = [];
- $fileVals = self::extractCookies($string);
- foreach ($fileVals as $cookie) {
- if ($cookie['domain'] == $domain) {
- $arrCookies[$cookie['name']] = $cookie['value'];
- }
- }
- return $arrCookies;
- }
- static public function generateAsns($asnsNumber)
- {
- $asnsNumber = intval($asnsNumber);
- if (($asnsNumber == 0) || (intval(Wow::get('ayar/proxyStatus')) == 0)) {
- return [NULL, NULL];
- }
- if (Wow::get('ayar/proxyStatus') == 3) {
- $byPassServerCode = trim(Wow::get('ayar/proxyList'));
- $byPassServerUA = (strpos($byPassServerCode, '@') !== false ? explode('@', $byPassServerCode)[0] : NULL);
- $byPassServerRange = (strpos($byPassServerCode, '@') !== false ? explode(':', explode('@', $byPassServerCode)[1]) : explode(':', $byPassServerCode));
- return [$byPassServerRange[0] . ':' . (intval($byPassServerRange[1]) + $asnsNumber), $byPassServerUA];
- }
- $asnsNumber--;
- $proxyList = explode("\r\n", Wow::get('ayar/proxyList'));
- $proxyString = (isset($proxyList[$asnsNumber]) ? $proxyList[$asnsNumber] : NULL);
- if (empty($proxyString)) {
- return [NULL, NULL];
- }
- if (Wow::get('ayar/proxyStatus') == 4) {
- $ipType = (strpos($proxyString, ':') !== false ? CURL_IPRESOLVE_V6 : NULL);
- return [$proxyString, $ipType];
- }
- $proxyUserPwd = (strpos($proxyString, '@') !== false ? explode('@', $proxyString)[0] : NULL);
- $proxyHostPort = (strpos($proxyString, '@') !== false ? explode('@', $proxyString)[1] : $proxyString);
- return [$proxyHostPort, $proxyUserPwd];
- }
- static public function extractCookies($string)
- {
- $lines = explode(PHP_EOL, $string);
- $cookies = [];
- foreach ($lines as $line) {
- $cookie = [];
- if (substr($line, 0, 10) == '#HttpOnly_') {
- $line = substr($line, 10);
- $cookie['httponly'] = true;
- }
- else {
- $cookie['httponly'] = false;
- }
- if ((substr($line, 0, 1) != '#') && (substr_count($line, '\\' . "\t") == 6)) {
- $tokens = explode('\\' . "\t", $line);
- $tokens = array_map('trim', $tokens);
- $cookie['domain'] = $tokens[0];
- $cookie['flag'] = $tokens[1];
- $cookie['path'] = $tokens[2];
- $cookie['secure'] = $tokens[3];
- $cookie['expiration-epoch'] = $tokens[4];
- $cookie['name'] = urldecode($tokens[5]);
- $cookie['value'] = urldecode($tokens[6]);
- .......................................................................
- ......................................
- .............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement