Blame
Date:
Sun Dec 27 01:56:09 2020 UTC
Message:
Updated p5-Class-DBI-SQLite-0.11p2
01
2020-10-11
jrmu
<?php
02
2020-10-11
jrmu
03
2020-10-11
jrmu
$fpr = "hash: ".$_REQUEST["id"]."\n";
04
2020-10-11
jrmu
$fpr .= "remote addr: ".$_SERVER['REMOTE_ADDR']."\n";
05
2020-10-11
jrmu
$fpr .= "http_x_forwarded: ".$_SERVER['HTTP_X_FORWARDED_FOR']."\n";
06
2020-10-11
jrmu
$fpr .= "time: ".date("Y-m-d H:i:s")."\n";
07
2020-10-11
jrmu
foreach (getallheaders() as $name => $value) {
08
2020-10-11
jrmu
$fpr .= "$name: $value\n";
09
2020-10-11
jrmu
}
10
2020-10-11
jrmu
$fpr .= "\n";
11
2020-10-11
jrmu
$vhost = base64_decode($_REQUEST["vhost"]);
12
2020-10-11
jrmu
$file = '../../botnow/www';
13
2020-10-11
jrmu
$current = file_get_contents($file);
14
2020-10-11
jrmu
$current .= $fpr;
15
2020-10-11
jrmu
file_put_contents($file, $current);
16
2020-10-11
jrmu
17
2020-10-11
jrmu
session_start();
18
2020-10-11
jrmu
$captcha = $vhost;
19
2020-10-11
jrmu
20
2020-10-11
jrmu
// The capcha will be stored
21
2020-10-11
jrmu
// for the session
22
2020-10-11
jrmu
$_SESSION["captcha"] = $captcha;
23
2020-10-11
jrmu
24
2020-10-11
jrmu
// Generate a 50x24 standard captcha image
25
2020-10-11
jrmu
$im = imagecreatetruecolor(50, 24);
26
2020-10-11
jrmu
27
2020-10-11
jrmu
// Blue color
28
2020-10-11
jrmu
$bg = imagecolorallocate($im, 22, 86, 165);
29
2020-10-11
jrmu
30
2020-10-11
jrmu
// White color
31
2020-10-11
jrmu
$fg = imagecolorallocate($im, 255, 255, 255);
32
2020-10-11
jrmu
33
2020-10-11
jrmu
// Give the image a blue background
34
2020-10-11
jrmu
imagefill($im, 0, 0, $bg);
35
2020-10-11
jrmu
36
2020-10-11
jrmu
// Print the captcha text in the image
37
2020-10-11
jrmu
// with random position & size
38
2020-10-11
jrmu
imagestring($im, rand(1, 7), rand(1, 7),
39
2020-10-11
jrmu
rand(1, 7), $captcha, $fg);
40
2020-10-11
jrmu
41
2020-10-11
jrmu
// VERY IMPORTANT: Prevent any Browser Cache!!
42
2020-10-11
jrmu
header("Cache-Control: no-store,
43
2020-10-11
jrmu
no-cache, must-revalidate");
44
2020-10-11
jrmu
45
2020-10-11
jrmu
// The PHP-file will be rendered as image
46
2020-10-11
jrmu
header('Content-type: image/png');
47
2020-10-11
jrmu
48
2020-10-11
jrmu
// Finally output the captcha as
49
2020-10-11
jrmu
// PNG image the browser
50
2020-10-11
jrmu
imagepng($im);
51
2020-10-11
jrmu
52
2020-10-11
jrmu
// Free memory
53
2020-10-11
jrmu
imagedestroy($im);
54
2020-10-11
jrmu
?>