Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = '51.210.156.16';
- $ports = array(21, 25, 80, 81, 110, 443, 3306);
- foreach ($ports as $port)
- {
- $connection = @fsockopen($host, $port);
- if (is_resource($connection))
- {
- echo '<h2>' . $host . ':' . $port . ' ' . '(' . getservbyport($port, 'tcp') . ') is open.</h2>' . "\n";
- fclose($connection);
- }
- else
- {
- echo '<h2>' . $host . ':' . $port . ' is not responding.</h2>' . "\n";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement