Advertisement
supercutevr2

Untitled

May 27th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. <?php
  2. ini_set('max_execution_time', 0);
  3. ini_set('memory_limit', -1);
  4. $host = $_GET['host'];
  5. $ports = array();
  6. for ($i = 1; $i < 256 * 256; $i++)
  7. {
  8. $ports[] = $i;
  9. }
  10. echo "<ul>";
  11. foreach ($ports as $port)
  12. {
  13. $connection = @fsockopen($host, $port, $errno, $errstr, 2);
  14. if (is_resource($connection))
  15. {
  16. echo '<li style="color:green">' . $host . ':' . $port . ' ' . '(' . getservbyport($port, 'tcp') . ') is open.</li>' . "\n";
  17. fclose($connection);
  18. }
  19. else
  20. {
  21. echo '<li>' . $host . ':' . $port . ' is not responding.</li>' . "\n";
  22. }
  23. }
  24. echo "</ul>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement