Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

Port scan

Tue Oct 28, 2008 2:25 pm

Code:
<?php

   
// Give the script enough time to complete the task
   
ini_set("max_execution_time",120);

   
$rangeStart = 0;
   
$rangeStop = 1024;

   
$target = "www.codemiles.com";

   
$range =range($rangeStart, $rangeStop);
   echo
"<p>Scan results for $target</p>";

   foreach (
$range as $port) {
      
$result = @fsockopen($target, $port,$errno,$errstr,1);
      if (
$result)
         echo
"<p>Socket open at port $port</p>";
   }
?>




Post a reply
  Related Posts  to : Port scan
 Get Remote port     -  
 parallel port     -  
 Writing a Counter to any PORT     -  
 HOW I Access the Parallel Port in Java?     -  
 Automatic Pairing and initialization of com port     -  
 How to connect to serial port using java     -  
 How to find server IP, PORT using String     -  
 Problem on BlueSoleil Serial Port Profile     -  
 Java Programing to communicating port parallel     -  
 Parse URL in java get Protocol,File,Reference,Host and Port     -  

Topic Tags

PHP Networking