Advertisement
Guest User

Untitled

a guest
May 15th, 2014
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. netstat -an | find "8080"
  2.  
  3. telnet 192.168.100.132 8080
  4.  
  5. <?php
  6. $host_connection = 'example.com'; // domain name
  7. $ports_number = array(21, 25, 80, 81, 110,143, 443, 3306); //checking port number
  8.  
  9. foreach ($ports_number as $port)
  10. {
  11. $connection_check = @fsockopen($host_connection, $port);
  12.  
  13. if (is_resource($connection_check))
  14. {
  15. echo '<h5>' . $host_connection . ':' . $port . ' ' . '(' . getservbyport($port, 'tcp') . ') is open now.</h5>' . "n";
  16.  
  17. fclose($connection_check);
  18. }
  19.  
  20. else
  21. {
  22. echo '<h5>' . $host_connection . ':' . $port . ' is not open now.</h5>' . "n";
  23. }
  24. }
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement