-
Notifications
You must be signed in to change notification settings - Fork 0
/
pixel.png
55 lines (47 loc) · 1.97 KB
/
pixel.png
File metadata and controls
55 lines (47 loc) · 1.97 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
<?php
if (!isset($_GET['e'])) {
header('Content-Type: image/png');
readfile('frown.png');
exit();
}
require_once dirname(__FILE__) . '/_classes/_include.php';
$decoder = new Encryption('iHateMonkeys');
$encoder = new Encryption('iLoveMonkeys'); // encoder for cancelation link
$resubEnc = new Encryption('iFuckMonkeys');
$email = $decoder->decrypt($_GET['e']);
$emailList = new EmailList(dirname(__FILE__) . '/_secret/blocked_emails.dat');
if (!$emailList->containsEmail($email)) {
$referrer = $_SERVER['HTTP_REFERER'];
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$ipAddress = $_SERVER['REMOTE_ADDR'];
$hostName = $_SERVER['REMOTE_HOST'];
if (empty($hostName) || !isset($_SERVER['REMOTE ADDR'])) {
$hostName = @gethostbyaddr($ipAddress);
}
$urlAddr = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$encE = $encoder->encrypt($email);
$encE1 = $resubEnc->encrypt($email);
$unsubAddr = $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/pixel.blocker.php?e=' . urlencode($encE);
$resubAddr = $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/pixel.unblocker.php?e=' . urlencode($encE1);
$msg = sprintf("Someone has viewed your custom image from %s\n\n" .
"IP: %s\nHostname: %s\nUserAgent: %s\nReferrer: %s\n\n" .
"If you did not subscribe to get these messages, you can cancel email " .
"notifications by visiting the URL: %s\n" .
"You can also re-subscribe to these messages here: %s\n\n" .
"\nThank you,\nPixel Tracker team",
$urlAddr, $ipAddress, $hostName, $userAgent, $referrer, $unsubAddr, $resubAddr
);
$headers = 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'Message-id: PixelMagic' . "\r\n" .
'X-Mailer: PixelMagic';
mail($email, 'Hit from Pixel Tracker', $msg, $headers);
// echo 'Sent message to ' . $email;
} else {
// echo 'Sucker is blacklisted.';
// TODO: note this in the log.
}
$emailList->closeFile();
header('Content-Type: image/png');
readfile('pixel.secret.png.txt');
?>