Skip to content

Instantly share code, notes, and snippets.

@kolobus
Last active December 12, 2015 03:28
Show Gist options
  • Save kolobus/4706633 to your computer and use it in GitHub Desktop.
Save kolobus/4706633 to your computer and use it in GitHub Desktop.
Simple PHP backend used for ip.cx traceroute backend locations (some ot them).
<?php
$do = preg_match("/^[a-z0-9-.]+$/iD", $_GET["host"]);
if ($do) {
$host = escapeshellcmd($_GET["host"]);
passthru("`which traceroute` -m15 -w3 ".$host." 2>&1");
} else {
echo "Invalid input.";
}
?>
<?php
set_time_limit(0);
error_reporting(0);
$do = preg_match("/^[a-z0-9-.]+$/iD", $_GET["host"]);
if ($do) {
$host = escapeshellcmd($_GET["host"]);
passthru("tracert -h 25 -w 1000 ".$host);
} else {
echo "Invalid input.";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment