Question:Find out the correct output of the following :
<?php
  ini_set("max_execution_time",120);
   $rangeStart = 0;
   $rangeStop = 1024;
   $target = "localhost";
   $range= range($rangeStart,$rangeStop);
  echo "<p>Scan results for $target</p>";
 
   foreach($range as $p){
     $result=@fsockopen($target,$p,$errno,$errstr,1);
     if($result) echo "<p>Socket open at port $p</p>";
}
?> 

A Scan results for localhost
Socket open at port 631
Socket open at port 22
Socket open at port 80

 

B Socket open at port 22
Socket open at port 80
Socket open at port 631
Scan results for localhost 

C Scan results for localhost
Socket open at port 22
Socket open at port 80
Socket open at port 631 

D Scan results for localhost
Socket open at port 80
Socket open at port 28
Socket open at port 631 

+ Answer
+ Report
Total Preview: 574

Copyright © 2024. Powered by Intellect Software Ltd