-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit.php
More file actions
65 lines (62 loc) · 1.75 KB
/
git.php
File metadata and controls
65 lines (62 loc) · 1.75 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
<?php
function getReferer()
{
if(isset($_SESSION["HTTP_REFERER"]))
{
return addslashes($_SESSION['HTTP_REFERER']);
}
else
{
return "Not found";
}
}
function getSub()
{
if(isset($_GET["about"]))
{
return addslashes($_GET["about"]);
}
else
{
return time();
}
}
session_start();
header("Content-Type: image/png");
if(strpos( file_get_contents("whitelist.ips"), $_SERVER["REMOTE_ADDR"])!==false)
{
$img = imagecreate(155, 20);
$background_color = imagecolorallocate($img, 0, 0, 0);
imagefill($img, 0, 0, $background_color);
$text_color = imagecolorallocate($img, 0, 255, 0);
imagestring($img, 5, 0, 0, 'Tracking Disabled', $text_color);
imagepng($img);
imagedestroy($img);
}
else
{
$img=imagecreate(1, 1);
imagesetpixel($img, 1, 1, imagecolorallocatealpha($img, 0, 0, 0, 127));
imagepng($img);
imagedestroy($img);
$username = "u608031215_auto";
$password = "listemips";
try
{
$conn = new PDO("mysql:host=mysql.hostinger.co.uk;dbname=u608031215_ips", $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
echo "Connected successfully";
$sql="INSERT INTO ips (IP_ADDR, REFERER, USER_AGENT, ABOUT) VALUES ('" . addslashes($_SERVER['REMOTE_ADDR']) . "', '" . getReferer() . "', '" . addslashes($_SERVER['HTTP_USER_AGENT']) . "', '". getSub(). "')";
$conn->exec($sql);
}
catch(PDOException $e)
{
echo "Failed: " . $e->getMessage();
}
/*file_put_contents("logged.txt", file_get_contents("logged.txt"). "\n". $_SERVER["REMOTE_ADDR"]. ",". $_SERVER["HTTP_USER_AGENT"]. ",". $_SESSION["HTTP_REFERER"]);
$_SESSION["lastsite"]=$_SERVER['HTTP_REFERER']+$_SESSION["lastsite"];*/
}
$conn = null;
//use cookies to make this magical
// HTTO X-FORWARDED-FOR as well
?>