All pastes #754712 Raw Edit

Anonymous

public php v1 · immutable
#754712 ·published 2007-10-30 05:13 UTC
rendered paste body
<?phpif($_SERVER['REQUEST_METHOD']=='POST'){	$br_nl = "<br>";	$host = htmlspecialchars($_POST['host']);	$s_port = (int)$_POST['s_port'];	$e_port = (int)$_POST['e_port'];	echo "<body>			<center>			<form method='POST' action=" . $_SERVER['PHP_SELF'] . ">				Host:<br>				<input type='text' name='host'><br>				Starting Port:<br>				<input type='text' name='s_port'><br>  				Ending Port:<br>  				<input type='text' name='e_port'><br>				<input type='submit'>			</form>";}else{	$br_nl = "\n";	$host = $argv[1];	$s_port = $argv[2];	$e_port = $argv[3];}error_reporting(0);if($host == ""){	$host = '127.0.0.1';}if($s_port == "" && $e_port == ""){	$s_port = 0;	$e_port = 10000;}do{	if (fsockopen($host, $s_port)){		echo "port " . $s_port . "/" . getservbyport($s_port, tcp) . " open" . $br_nl;	}	$s_port++;}while($s_port <= $e_port);?>