-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbot.php
35 lines (33 loc) · 965 Bytes
/
bot.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
require("ts3admin.class.php");
$ignore_groups = 1;
$msg_kick = "un proxy a été détecté";
$login_query = "serveradmin";
$pass_query = "password";
$adres_ip = "127.0.0.1";
$query_port = "10011";
$port_ts = "9987";
$nom_bot = "Robot-Anti-VPN";
$ts = new ts3Admin($adres_ip, $query_port);
if(!$ts->getElement('success', $ts->connect())) {
die("Anti-Proxy");
}
$ts->login($login_query, $pass_query);
$ts->selectServer($port_ts);
$ts->setName($nom_bot);
while(true) {
sleep(1);
$clientList = $ts->clientList("-ip -groups");
foreach($clientList['data'] as $val) {
$groups = explode(",", $val['client_servergroups'] );
if(in_array($ignore_groups, $groups) || ($val['client_type'] == 1)) {
continue;
}
$file = file_get_contents('https://api.xdefcon.com/proxy/check/?ip='.$val['connection_client_ip'].'');
$file = json_decode($file, true);
if($file['message'] == "Proxy detected.") {
$ts->clientKick($val['clid'], "server", $msg_kick);
}
}
}
?>