
28.08.2008, 10:17
|
|
Познавший АНТИЧАТ
Регистрация: 12.03.2008
Сообщений: 1,379
Провел на форуме: 5866479
Репутация:
1809
|
|
SOCKS Proxy List Checker
Код:
#!/usr/bin/perl
use strict;
use warnings;
use IO::Socket::INET;
# SOCKS Proxy List Checker
# Coded by sToRm
# www.GoNullYourself.org
#
# Accepts proxy list in
# 1.2.3.4:1111 format
if ( @ARGV != 1 ) {
print "Usage: $0 <file>\n";
exit(1);
}
open(PROXIES, "<$ARGV[0]") or die($ARGV[0].' wasn\'t found');
open(VALID, '>>valid.txt') or die('valid.txt isn\'t writable');
my ($connectable, $unconnectable, $invalid) = (0, 0, 0);
while(<PROXIES>) {
chomp($_);
my $line = $_;
if ($line =~ /([0-9]){1,3}\.([0-9]){1,3}\.([0-9]){1,3}\:([0-9]){1,5}/) {
my @proxy = split(/:/, $line);
my $SOCK = IO::Socket::INET->new (
PeerAddr => $proxy[0],
PeerPort => $proxy[1],
Timeout => 2,
);
if ( $SOCK ) {
print "[+] $line\n";
print VALID $line."\n";
++$connectable;
} else {
print "[-] $line\n";
++$unconnectable;
}
} else {
print "[-] $line is invalid\n";
++$invalid;
}
}
my $total = $connectable + $unconnectable + $invalid;
print "\nProxy list exhausted\n";
print "Connectable: $connectable\n";
print "Unconnectable: $unconnectable\n";
print "Invalid Lines: $invalid\n";
print "Total Checked: $total\n";
print "Working proxies saved to valid.txt\n";
|
|
|