3 //$search = "(linux|apache|debian|ubuntu|redhat)";
4 $search = "(microsoft|iis|windows)";
8 $stdin = fopen("php://stdin", "r");
9 function readline($echo="") {
11 return trim(fgets($GLOBALS["stdin"]));
14 function get_http_header($host, $port = 80, $timeout = 1) {
15 $fp = pfsockopen($host, $port, $errno, $err, $timeout);
16 $header = "GET / HTTP/1.1\n\n";
19 while(!feof($fp) && $fp) {
21 if (trim($line) == "") { break; }
22 $header = $header.$line;
28 function get_banner($host, $port, $timeout = 1) {
29 $fp = pfsockopen($host, $port, $errno, $err, $timeout);
30 $header = "CAO-VOE\n\n";
32 stream_set_blocking($fp, 0);
36 //die(get_http_header('server00.skola')); //Debug
37 //die(get_banner('pernicek.mooo.com', $port)); //Debug
39 error_reporting(0); //Vypneme vypis chyb
40 while(!feof($stdin) && $stdin) {
41 while(!feof($stdin) && $stdin) {
42 $host = readline(); //Nacteme url
43 if($port == 80 ||
$port == 8080 ||
$port == 443) {
44 $header = get_http_header($host, $port, $timeout);
46 $header = get_banner($host, $port, $timeout);
48 //echo("$header\n"); //Debug
49 if ( eregi($search, $header) ) {
50 echo("\t!Match: $host:$port\r\n$header\n\n");
52 //echo($header); //debug
This page took 0.324561 seconds and 4 git commands to generate.