Jump to content

XopcX

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by XopcX

  1. un mic script perl pentru a verifica socks

    #!/usr/bin/perl

    use IO::Socket::Socks;

    #use strict;

    #use warnings;

    my $file = 'list.txt';

    open (FILE, "$file") || die "Could not open $file\n";

    my @data = <FILE>;

    close FILE;

    my $socksdata;

    foreach my $socks (@data) {

    eval {

    my $status = 'FAILED';

    local $SIG{ALRM} = sub {print ' ' . $status . "\n";goto ALARM;};

    alarm 5;

    chomp $socks;

    print $socks;

    my ($socks_ip,$socks_port) = split(/\:/,$socks);

    my $socket = new IO::Socket::Socks( ProxyAddr=>"$socks_ip", ProxyPort=>"$socks_port", ConnectAddr=>"mail.goldhost.com", ConnectPort=>"25") or next;

    if ($socket) {

    print $socket "QUIT\r\n";

    }

    while (my $res = <$socket>) {

    if ( $res =~ /^220/) {

    $status = 'SUCCESS';

    }

    }

    close($socket);

    if ($status eq 'SUCCESS') {

    $socksdata .= $socks . "\n";

    }

    print ' ' . $status . "\n";

    alarm 0;

    ALARM:

    }

    }

    open FH, ">$file";

    print FH $socksdata;

    close FH;

×
×
  • Create New...