-
Notifications
You must be signed in to change notification settings - Fork 1
/
DDoS.php
108 lines (65 loc) · 2.46 KB
/
DDoS.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
require 'classes/Session.class.php';
$session = new Session();
$error = '';
if(!$session->issetLogin()){
header("Location:index");
exit();
}
if($_SERVER['REQUEST_METHOD'] != 'POST'){
$error = 'Invalid request type.';
}
if(!isset($_POST['ip']) || empty($_POST['ip'])){
$error = 'Invalid IP address.';
}
require 'classes/System.class.php';
$system = new System();
if(!$system->validate($_POST['ip'], 'ip')){
$error = 'Invalid IP address.';
}
if($error == ''){
require 'classes/Player.class.php';
require 'classes/PC.class.php';
require 'classes/List.class.php';
$virus = new Virus();
$player = new Player();
$list = new Lists();
$ip = ip2long($_POST['ip']);
$playerInfo = $player->getIDByIP($ip, '');
if($playerInfo['0']['existe'] == 1){
if($list->isListed($_SESSION['id'], $ip)){
if($virus->DDoS_count() >= 3){
$process = new Process();
if($playerInfo['0']['pctype'] == 'VPC'){
$isNPC = 0;
} else {
$isNPC = 1;
}
if($process->newProcess($_SESSION['id'], 'DDOS', $playerInfo['0']['id'], 'remote', '', '', '', $isNPC)){
$session->addMsg(sprintf(_('DDoS attack against <strong>%s</strong> launched.'), $_POST['ip']), 'notice');
header("Location:list?action=ddos");
} else {
if (!$session->issetMsg()) {
$pid = $process->getPID($_SESSION['id'], 'DDOS', $playerInfo['0']['id'], 'remote', '', '', '', $isNPC);
header("Location:processes?id=".$pid);
} else {
header("Location:list?action=ddos");
}
}
} else {
$session->addMsg('You need to have at least 3 working DDoS viruses.', 'error');
header("Location:list?action=ddos");
}
} else {
$session->addMsg('This IP is not on your Hacked Database.', 'error');
header("Location:list?action=ddos");
}
} else {
$session->addMsg('This IP doesnt exists.', 'error');
header("Location:list?action=ddos");
}
} else {
$session->addMsg($error, 'error');
header("Location:list?action=ddos");
}
?>