<?php
ini_set('max_execution_time', 0);
ini_set('memory_limit', -1);

$host = $_GET['host'];
$port = $_GET['port'];

$connection = @fsockopen($host, $port, $errno, $errstr, 2);

if (is_resource($connection)){
	echo '<h2>' . $host . ':' . $port . ' ' . '' . getservbyport($port, 'tcp') . ' OPEN.</h2>' . "\n";

	fclose($connection);
}else{
	echo '<h2>' . $host . ':' . $port . ' BAD.</h2>' . "\n";
}