Location: PHPKode > scripts > phport-scanner > pscan.php
<?php
	error_reporting(0);
	set_time_limit(0);
	class ASCII {
		public static function BOLD_RED($text) { return "\033[31;1m" . $text . "\033[0m"; }
		public static function BOLD_GRN($text) { return "\033[32;1m" . $text . "\033[0m"; }
		public static function BOLD_YLW($text) { return "\033[33;1m" . $text . "\033[0m"; }
		public static function BOLD_BLU($text) { return "\033[34;1m" . $text . "\033[0m"; }
		public static function BOLD_PUR($text) { return "\033[35;1m" . $text . "\033[0m"; }
		public static function BOLD_TUR($text) { return "\033[36;1m" . $text . "\033[0m"; }
		public static function BOLD_WHT($text) { return "\033[37;1m" . $text . "\033[0m"; }
		public static function BOLD_WHT_BGRED($text) { return "\033[41;1m" . $text . "\033[0m"; }
		public static function BOLD_WHT_BGGRN($text) { return "\033[42;1m" . $text . "\033[0m"; }
		public static function BOLD_WHT_BGGLD($text) { return "\033[43;1m" . $text . "\033[0m"; }
		public static function BOLD_WHT_BGBLU($text) { return "\033[44;1m" . $text . "\033[0m"; }
		public static function BOLD_WHT_BGPUR($text) { return "\033[45;1m" . $text . "\033[0m"; }
		public static function BOLD_WHT_BGTUR($text) { return "\033[46;1m" . $text . "\033[0m"; }
	}
	print "Server IP: " . ASCII::BOLD_TUR(gethostbyname($argv[1])) . "\n";
	print "Connecting To Server" . "\n\n";
	
	# Add More Ports Here If You Wish
	$ports = array(20, 21, 22, 23, 25, 53, 80, 137, 139, 443, 445, 1337, 3306, 3389, 5800, 5900, 6667, 8080, 10000);
	foreach($ports as $port) {
		$delay = 1; # Timer For Scanner. Lower Then 1 = BAD; Higher Then 5 = BAD
		$fp = fsockopen($argv[1], $port, $errno, $errstr, $delay);
		if(getservbyport($port, 'tcp') == "") { $PORTNAME = ASCII::BOLD_PUR("N/A"); } else { $PORTNAME = ASCII::BOLD_PUR(getservbyport($port, 'tcp')); }
		if($fp) {
			print "[+] Port " . ASCII::BOLD_BLU($port) . " [" . $PORTNAME . "] Is " . ASCII::BOLD_GRN("Active") . "\n";
		} else {
			print "[-] Port " . ASCII::BOLD_BLU($port) . " [" . $PORTNAME . "] Is " . ASCII::BOLD_RED("Inactive") . "\n";
		}
	}
?>
Return current item: phport-scanner