#!/usr/bin/perl
use Socket;
use Net::hostent;
open my $netstat,"netstat -an |" or die;
while(<$netstat>) {
   if (my ($tcp,$rq,$sq,$local, $remote,$state) = /(tcp[46])\s+(\d+)\s+(\d+)\s+([.0-9.]+)\s+([.0-9]+)\.443\s+(.*)/) {
        my $h =  gethostbyaddr(inet_aton($remote), AF_INET);
        print $h->name, "\n" if ($h);
   }
}
