Skip to content

Instantly share code, notes, and snippets.

@kaldas
Created May 13, 2011 16:21
Show Gist options
  • Select an option

  • Save kaldas/970827 to your computer and use it in GitHub Desktop.

Select an option

Save kaldas/970827 to your computer and use it in GitHub Desktop.
<?php
require "yahttp.class.php";
//config
error_reporting(0);
set_time_limit(0);
ini_set("default_socket_timeout",5);
$newLine = "<br>\n";
//html interface
echo '<br><form name="form" method="post" action="">
Host: <input type="text" name="host" /> Port: <input name="port"
type="text" value="80" size="6" /> Path: <input name="path" type="text"
value="/" /><br><br>Dirs: (one per line)<br><br> <textarea name="dirs"
cols="45" rows="5">imagens/</textarea><br><br><input type="submit"
name="button" id="button" value="Submit" /></form>';
if(empty($_REQUEST['host'])) /* if no user input came then nothing to be done */
exit;
echo $newLine."Starting response scan at ".$_REQUEST['host'].$newLine;
Yahttp::$host = $_REQUEST['host'];
Yahttp::$port = $_REQUEST['port'];
Yahttp::$path = $_REQUEST['path'];
$dirlist = explode("\n",$_REQUEST['dirs']);
foreach($dirlist as Yahttp::$currdir)
{
$output =& Yahttp::getResponseCode();
if($output)
echo $output.$newLine;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment