Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- netstat -an | find "8080"
- telnet 192.168.100.132 8080
- <?php
- $host_connection = 'example.com'; // domain name
- $ports_number = array(21, 25, 80, 81, 110,143, 443, 3306); //checking port number
- foreach ($ports_number as $port)
- {
- $connection_check = @fsockopen($host_connection, $port);
- if (is_resource($connection_check))
- {
- echo '<h5>' . $host_connection . ':' . $port . ' ' . '(' . getservbyport($port, 'tcp') . ') is open now.</h5>' . "n";
- fclose($connection_check);
- }
- else
- {
- echo '<h5>' . $host_connection . ':' . $port . ' is not open now.</h5>' . "n";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement