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 to connect to serial port using java     -  
 How to find server IP, PORT using String     -  
 HOW I Access the Parallel Port in Java?     -  
 Automatic Pairing and initialization of com port     -  
 Java Programing to communicating port parallel     -  
 Problem on BlueSoleil Serial Port Profile     -  
 Parse URL in java get Protocol,File,Reference,Host and Port     -  

Topic Tags

PHP Networking