Quantcast
Channel: perl – Securitron Linux blog.
Viewing all articles
Browse latest Browse all 7

A script I wrote that checks whether a host is reachable by various protocols like ICMP & TCP.

$
0
0
#!/usr/bin/perl use warnings; use Net::Ping; # code source: http://www.perlmonks.org/?node_id=943892 # More: http://stackoverflow.com/questions/3960595/how-can-i-ping-a-host-with-a-perl-one-liner-with-netping #$| = 1; print "Please type a host to check..n"; $host = <>; if (length($host) < 3) { print "You did not type a host!n"; exit(0); } my @proto = ("tcp", "udp", "icmp", "stream", "syn"); foreach my $pro ( @proto ) { print [...]

Viewing all articles
Browse latest Browse all 7

Trending Articles