Ignore:
Timestamp:
07/06/07 11:37:53 (6 years ago)
Author:
jmax
Message:

added azn with previous versions; updated proxysuite

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trollforge/jmax/proxysuite/proxysuite.pl

    r193 r247  
    11#!/usr/bin/perl 
    22 
    3 # this is proxysuite, written in GNU/PURL 
    4 # by Jmax, of bantown and the GNAA 
    5 #  
    6 # This product is licensed under the BPL.   
    7 # You should have recieved a copy of both  
    8 # licenses with this script, and the  
    9 # accompanying README.   
    10  
    11 use warnings;  # warnings ... 
    12 use strict;    # ... and stricture 
    13 use LWP;       # for the pseudo-browser 
    14 use POSIX qw(:signal_h :sys_wait_h); # for forking 
    15 use IO::Handle; # for skipping perl buffering 
     3# This is proxysuite, written in GNU/PURL 
     4# by Jmax, of bantown and the GNAA. 
     5# It gathers and tests http proxies 
     6 
     7# This product is licensed under the BPL. 
     8# You should have recieved a copy of the 
     9# license with this program, along with 
     10# the README, sockssuite.pl, sites.txt,  
     11# and sockssites.txt 
     12 
     13# el8 tr0ll c0dez by Jmax [ BANTOWN irc.bantown.com #bantown ] [ GNAA irc.gnaa.us #gnaa ] 
     14 
     15use warnings; 
     16use strict; 
     17# for forking 
     18use POSIX qw(:signal_h :sys_wait_h); 
     19my ($forkcount, $pid, $dead_nigger_storage, $maxfork) = (0, undef, 0, 50); 
     20$SIG{INT} = sub { kill('INT', (getpgrp(0) * -1)) && exit; }; 
     21$SIG{CHLD} = sub { $dead_nigger_storage++ while(($pid = waitpid(-1, WNOHANG)) > 0); }; 
     22# end 
     23use LWP; 
     24use IO::Handle; 
    1625use Getopt::Long; 
    1726use HTML::Form; 
     27use vars qw($VERSION); 
     28$VERSION = "2.5.1-http"; 
    1829 
    1930#------------------------------------------------ 
     
    2233 
    2334# time in seconds to wait for a proxy to timeout 
    24 my $timeout = 3; 
     35my $timeout = 2; 
    2536 
    2637# query to google for 
    27 my $query   = "gnaa";       
     38my $query = "gnaa"; 
    2839 
    2940# user agent to use 
    3041my $agent = "JEW/Lunix FireFAKE 1.5.101"; 
    3142 
    32 # list of sites to slurp proxies from 
    33 # must be in ip:port form 
    34 my @URLS = qw(  
    35 http://www.multiproxy.org/txt_all/proxy.txt 
    36 http://www.atomintersoft.com/products/alive-proxy/proxy-list/80/ 
    37 http://www.atomintersoft.com/products/alive-proxy/proxy-list/81/ 
    38 http://www.atomintersoft.com/products/alive-proxy/proxy-list/3128/ 
    39 http://www.atomintersoft.com/products/alive-proxy/proxy-list/8000/ 
    40 http://www.atomintersoft.com/products/alive-proxy/proxy-list/8080/ 
    41 http://www.atomintersoft.com/products/alive-proxy/proxy-list/high-anonymity/ 
    42 http://www.atomintersoft.com/products/alive-proxy/proxy-list/anonymous/ 
    43 http://www.atomintersoft.com/products/alive-proxy/proxy-list/transparent/ 
    44 http://www.atomintersoft.com/products/alive-proxy/proxy-list/com/ 
    45 http://www.atomintersoft.com/products/alive-proxy/proxy-list/net/ 
    46 http://www.atomintersoft.com/products/alive-proxy/proxy-list/org/ 
    47 http://www.atomintersoft.com/products/alive-proxy/proxy-list/edu/ 
    48 http://www.atomintersoft.com/products/alive-proxy/proxy-list/us/ 
    49 http://www.atomintersoft.com/products/alive-proxy/proxy-list/jp/ 
    50 http://www.atomintersoft.com/products/alive-proxy/proxy-list/bess/ 
    51 http://www.nntime.com/index.php?start=1 
    52 http://www.nntime.com/index.php?start=51 
    53 http://www.nntime.com/index.php?start=101 
    54 http://www.nntime.com/index.php?start=151 
    55 http://www.nntime.com/index.php?start=201 
    56 http://www.nntime.com/index.php?start=251 
    57 http://www.nntime.com/index.php?start=301 
    58 http://www.nntime.com/index.php?start=351 
    59 http://www.nntime.com/index.php?start=401 
    60 http://www.nntime.com/index.php?start=451 
    61 http://www.nntime.com/index.php?start=501 
    62 http://www.nntime.com/index.php?start=551 
    63 http://www.nntime.com/index.php?start=601 
    64 http://www.nntime.com/index.php?start=651 
    65 http://www.nntime.com/index.php?start=701 
    66 http://www.nntime.com/index.php?start=751 
    67 http://www.nntime.com/index.php?start=801 
    68 http://www.nntime.com/index.php?start=851 
    69 http://www.nntime.com/index.php?start=901 
    70 http://www.nntime.com/index.php?start=951 
    71 http://www.proxy-list.net/anonymous-proxy-lists.shtml 
    72 http://www.proxy-list.net/transparent-proxy-lists.shtml 
    73 http://proxy.org/port80.shtml 
    74 http://proxy.org/port443.shtml 
    75 http://proxy.org/port444.shtml 
    76 http://proxy.org/port2301.shtml 
    77 http://proxy.org/port3124.shtml 
    78 http://proxy.org/port3127.shtml 
    79 http://proxy.org/port3128.shtml 
    80 http://proxy.org/port3382.shtml 
    81 http://proxy.org/port6588.shtml 
    82 http://proxy.org/port8000.shtml 
    83 http://proxy.org/port8080.shtml 
    84 http://proxy.org/port8081.shtml 
    85 http://proxy.org/port8086.shtml 
    86 http://proxy.org/port8888.shtml 
    87 http://proxy.org/portx.shtml                     
    88 http://www.digitalcybersoft.com/ProxyList/fresh-proxy-list.shtml 
    89 http://www.proxylists.net/http_highanon.txt 
    90 http://www.proxylists.net/http.txt 
    91 http://www.proxyleech.com/proxylist.txt 
    92 http://www.proxy-server.info/proxy-server-list.shtml ); 
    93  
    94 # do not edit the below variables 
    95 # they are initilazing for stricture 
    96 # or have other purposes 
    97 my $version = '2.0'; 
    98 my $forkcount; 
    99 my $pid; 
    100 my $dead_nigger_storage = 0; 
    101 my %settings; 
    102 my $pseudo_browser; 
    103 my $GET_page; 
    104 my $GET_result; 
    105 my $POST_result; 
    106 my $form; 
    107 my @proxies; 
    108 my $proxy; 
    109 my $status; 
    110 my $n_per_proxies; 
    111 my $current_proxy_array; 
    112 my $current_proxy_number; 
    113 my $current_proxy; 
    114 my @array_of_proxies; 
    115 my $response; 
    116 my $content; 
    117 my $slurper; 
    118 my $proxies_acquired; 
    119 my $total_proxies_acquired; 
    120 my $total_uniq_proxies; 
    121 my $URL; 
    122 my $first_octet; 
    123 my $second_octet; 
    124 my $third_octet; 
    125 my $fourth_octet; 
    126 my $full_proxy; 
    127 my $gather_only = ''; 
    128 my $test_only = ''; 
    129 my $gather_and_test = ''; 
    130 my $print_version_message = ''; 
    131 my $print_help_message = ''; 
    132  
    133 # for forking 
    134 $SIG{CHLD} = \&handler; 
    135 $SIG{INT} = \&exit_nicely; 
    136  
    137 # for perl buffering 
    138 GETONLY->autoflush(1); 
    139 CANPOST->autoflush(1); 
    140  
    14143#------------------------------------------------ 
    14244# check arguments 
    14345#------------------------------------------------ 
    14446 
    145 GetOptions('gather-only|g' => \$gather_only,  
    146            'test-only|t' => \$test_only,  
    147            'gather-and-test|both|b' => \$gather_and_test,  
    148            'version' => \$print_version_message,  
    149            'help|h|?' => \$print_help_message); 
     47my ($gather_only, $test_only, $gather_and_test, $print_version_message, $print_help_message); 
     48GetOptions('gather-only|g'          => \$gather_only,  
     49           'test-only|t'            => \$test_only,  
     50           'gather-and-test|both|b' => \$gather_and_test,  
     51           'version'                => \$print_version_message,  
     52           'help|h|?'               => \$print_help_message); 
    15053 
    15154#------------------------------------------------ 
     
    15356#------------------------------------------------ 
    15457if ($gather_only) { 
    155   gather_proxies(); 
    156   open(PROXIESFILE,">proxies.untested.txt") or die "!!!! couldn't open proxies.untested.txt: $!\n"; 
    157   foreach $proxy (@proxies) { 
    158     print PROXIESFILE $proxy; 
    159     print PROXIESFILE "\n"; 
    160   } 
    161   close(PROXIESFILE) or warn "!!!! couldn't close proxies.untested.txt: $!\n"; 
     58    my @URLS; 
     59    open (SITES, "sites.txt") or die "!!!! couldn't open sites.txt: $!"; 
     60    while (<SITES>) { 
     61        chomp; 
     62        next if /^\s*$/; 
     63        next if /^#/; 
     64        push(@URLS, $_); 
     65    } 
     66    close (SITES) or warn "!!!! couldn't close sites.txt: $!"; 
     67    my @proxies = gather_proxies(@URLS); 
     68    open(PROXIESFILE, ">proxies.untested.txt") or die "!!!! couldn't open proxies.untested.txt: $!\n"; 
     69    foreach my $proxy (@proxies) { 
     70        print PROXIESFILE "$proxy\n"; 
     71    } 
     72    close(PROXIESFILE) or warn "!!!! couldn't close proxies.untested.txt: $!\n"; 
    16273} elsif ($test_only) { 
    163   open(PROXIESFILE,"proxies.untested.txt") or die "!!!! couldn't open proxies.untested.txt: $!\n"; 
    164   while(<PROXIESFILE>) { 
    165     chomp; 
    166     push(@proxies,$_); 
    167   } 
    168   @proxies = keys ( %{ { map { $_ => 1 } @proxies } } ); 
    169   $total_uniq_proxies = @proxies; 
    170   print ">>>> acquired $total_uniq_proxies total unique proxies.\n"; 
    171   test_proxies(); 
    172   close(PROXIESFILE) or warn "!!!! couldn't close proxies.untested.txt: $!\n"; 
     74    my @proxies; 
     75    open(PROXIESFILE, "proxies.untested.txt") or die "!!!! couldn't open proxies.untested.txt: $!\n"; 
     76    while(<PROXIESFILE>) { 
     77        chomp; 
     78        push(@proxies,$_); 
     79    } 
     80    @proxies = keys ( %{ { map { $_ => 1 } @proxies } } ); 
     81    my $total_uniq_proxies = @proxies; 
     82    print ">>>> acquired $total_uniq_proxies total unique proxies.\n"; 
     83    close(PROXIESFILE) or warn "!!!! couldn't close proxies.untested.txt: $!\n"; 
     84    test_proxies(@proxies);     
    17385} elsif ($gather_and_test) { 
    174   gather_proxies(); 
    175   test_proxies(); 
     86    my @URLS; 
     87    open (SITES, "sites.txt") or die "!!!! couldn't open sites.txt: $!"; 
     88    while (<SITES>) { 
     89        chomp; 
     90        next if /^\s*$/;         
     91        next if /^#/; 
     92        push(@URLS, $_); 
     93    } 
     94    close (SITES) or warn "!!!! couldn't close sites.txt: $!"; 
     95    my @proxies = gather_proxies(@URLS); 
     96    test_proxies(@proxies); 
    17697} elsif ($print_help_message) { 
    177   print "proxysuite version $version by Jmax\n"; 
    178   print "\n"; 
    179   print "\n"; 
    180   print "options:\n"; 
    181   print "\n"; 
    182   print "-g  : gather proxies\n"; 
    183   print "        gathers proxies from a list of sites (that have proxies in ip:port format).\n"; 
    184   print "        stores the un-tested proxies in proxies.untested.txt\n"; 
    185   print "-t  : test proxies\n"; 
    186   print "        tests proxies from a list of proxies in ip:port format titled proxies.untested.txt\n"; 
    187   print "        for speed (by GET'ing google in under 3 seconds) and against a blacklist, and for \n"; 
    188   print "        anonymity (by detecting your ip from whatismyip.com and comparing against that) and \n"; 
    189   print "        stores the proxies that can POST in proxies.canpost.txt and the proxies that can only\n"; 
    190   print "        GET in proxies.getonly.txt.  If you do not know what GET or POST means, read the README.\n"; 
    191   print "-b  : both\n"; 
    192   print "        does both testing and gathering of proxies.  stores proxies as with the -t flag, but does NOT\n"; 
    193   print "        store the un-tested proxies.\n"; 
     98    print "proxysuite version $VERSION by Jmax\n". 
     99          "\n". 
     100          "\n". 
     101          "options:\n". 
     102          "\n". 
     103          "-g  : gather proxies\n". 
     104          "        gathers proxies from a list of sites (that have proxies in ip:port format).\n". 
     105          "        stores the un-tested proxies in proxies.untested.txt\n". 
     106          "-t  : test proxies\n". 
     107          "        tests proxies from a list of proxies in ip:port format titled proxies.untested.txt\n". 
     108          "        for speed (by GET'ing google in under $timeout seconds) and against a blacklist, and\n". 
     109          "        stores the proxies that can POST in proxies.canpost.txt and the proxies that can only\n". 
     110          "        GET in proxies.getonly.txt.  If you do not know what GET or POST means, read the README.\n". 
     111          "-b  : both\n". 
     112          "        does both testing and gathering of proxies.  stores proxies as with the -t flag, but does NOT\n". 
     113          "        store the un-tested proxies.\n"; 
    194114} elsif ($print_version_message) { 
    195   print "proxysuite version $version by Jmax\n"; 
     115    print "proxysuite version $VERSION by Jmax\n"; 
    196116} else { 
    197   print "!!!! please run 'perl proxysuite.pl --help' for more information\n"; 
    198 } 
    199  
     117    print "!!!! please run 'perl proxysuite.pl --help' for more information\n"; 
     118} 
     119 
     120exit 0; 
    200121 
    201122#------------------------------------------------ 
     
    204125 
    205126sub gather_proxies { 
    206   # create pseudo web browser 
    207   $slurper = LWP::UserAgent->new; 
    208   $slurper->agent("$agent"); 
    209   # slurp proxies from sites 
    210   PROXYSLURP: foreach my $URL (@URLS) { 
    211     $proxies_acquired = 0; 
    212     print ">>>> slurping proxies from $URL ... \n"; 
    213     my $response = $slurper->get( $URL ); 
    214     if (!($response->is_success)) { 
    215       print STDERR "!!!! could not slurp from $URL : " . $response->status_line . "\n"; 
    216       next PROXYSLURP; 
    217     } 
    218     my $content = $response->content; 
    219     foreach ($content =~ /(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?):\d+/ig) { 
    220       $proxies_acquired++; 
    221       chomp; 
    222       push(@proxies,$_); 
    223     } 
    224     print ">>>> slurped $proxies_acquired proxies from $URL \n"; 
    225     $total_proxies_acquired += $proxies_acquired; 
    226   } 
    227   print ">>>> slurped $total_proxies_acquired total proxies\n"; 
    228   print ">>>> uniq'ing ...\n"; 
    229   # 00:37:53 < simcop2387-home> Jmax: we make hashkeys out of values then turn them back and automagically they become uniq 
    230   @proxies = keys ( %{ { map { $_ => 1 } @proxies } } ); 
    231   $total_uniq_proxies = @proxies; 
    232   print ">>>> acquired $total_uniq_proxies unique proxies\n"; 
     127    my @URLS = @_; 
     128    # create pseudo web browser 
     129    my $slurper = LWP::UserAgent->new; 
     130    $slurper->agent( $agent ); 
     131    $slurper->timeout( 10 ); 
     132    # slurp proxies from sites 
     133    my $total_proxies_acquired = 0; 
     134    my @proxies; 
     135    PROXYSLURP: foreach my $URL ( @URLS ) { 
     136        my $proxies_acquired = 0; 
     137        print ">>>> slurping proxies from $URL ... \n"; 
     138        my $response = $slurper->get( $URL ); 
     139        if (!($response->is_success)) { 
     140            print STDERR "!!!! could not slurp from $URL : " . $response->status_line . "\n"; 
     141            next PROXYSLURP; 
     142        } 
     143        my $content = $response->content; 
     144        foreach ($content =~ /(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?):\d+/ig) { 
     145            $proxies_acquired++; 
     146            chomp; 
     147            push(@proxies,$_); 
     148        } 
     149        print ">>>> slurped $proxies_acquired proxies from $URL \n"; 
     150        $total_proxies_acquired += $proxies_acquired; 
     151    } 
     152    print ">>>> slurped $total_proxies_acquired total proxies\n"; 
     153    print ">>>> uniq'ing ...\n"; 
     154    @proxies = keys ( %{ { map { $_ => 1 } @proxies } } ); 
     155    my $total_uniq_proxies = @proxies; 
     156    print ">>>> acquired $total_uniq_proxies unique proxies\n"; 
     157    return @proxies; 
    233158} 
    234159 
    235160sub test_proxies { 
    236   # divide array @proxies into 10 seperate lists 
    237   $n_per_proxies = int $#proxies / 10; 
    238   foreach $current_proxy_array ( 0 .. 9 ) { 
    239     foreach $current_proxy_number ( 0 .. $n_per_proxies ) { 
    240       if (scalar @proxies == 0) { 
    241         last; 
    242       } 
    243       $current_proxy = shift(@proxies); 
    244       $array_of_proxies[$current_proxy_array][$current_proxy_number] = $current_proxy; 
    245     } 
    246   } 
    247   print ">>>> initializing (forking) proxy testers\n"; 
    248   open(GETONLY, ">proxies.getonly.txt") or die "!!!! couldn't open proxies.getonly.txt\n"; 
    249   open(CANPOST, ">proxies.canpost.txt") or die "!!!! couldn't open proxies.canpost.txt\n"; 
    250   for ($forkcount = 0; $forkcount < 10; $forkcount++) { 
    251     sleep 1;                          # so we don't overload ourselves 
    252     if (!defined(my $pid = fork())) { # fork 
    253       die "!!!! couldn't fork: $!";   # die if fork fails 
    254     } elsif ($pid == 0) {             # fork successful, in child, do stuff 
    255       test_proxy( @{ $array_of_proxies[$forkcount] } ); 
    256       sleep(1); 
    257       exit 0; # kills child 
    258     } else {  # this is the parent 
    259     }  
    260   } 
    261   while ($dead_nigger_storage < 10) { 
    262     sleep 1; 
    263   } 
    264   close(GETONLY) or warn "!!!! couldn't close proxies.getonly.txt: $!\n"; 
    265   close(CANPOST) or warn "!!!! couldn't close proxies.canpost.txt: $!\n"; 
    266   print ">>>> Testing complete.\n"; 
     161    my @proxies = @_; 
     162    # divide array @proxies into $maxfork different seperate lists 
     163    my $n_per_proxies = int $#proxies / $maxfork; 
     164    my @array_of_proxies; 
     165    foreach my $current_proxy_array ( 0 .. ($maxfork - 1) ) { 
     166        foreach my $current_proxy_number ( 0 .. $n_per_proxies ) { 
     167            if (scalar @proxies == 0) { 
     168                last; 
     169            } 
     170            my $current_proxy = shift(@proxies); 
     171            $array_of_proxies[$current_proxy_array][$current_proxy_number] = $current_proxy; 
     172        } 
     173    } 
     174    print ">>>> initializing (forking) proxy testers\n"; 
     175    open(GETONLY, ">proxies.getonly.txt") or die "!!!! couldn't open proxies.getonly.txt: $!\n"; 
     176    open(CANPOST, ">proxies.canpost.txt") or die "!!!! couldn't open proxies.canpost.txt: $!\n"; 
     177    GETONLY->autoflush(1); 
     178    CANPOST->autoflush(1); 
     179    for ($forkcount = 0; $forkcount < $maxfork; $forkcount++) { # $forkcount must _not_ be local to here 
     180        sleep 1;                          # so we don't overload ourselves 
     181        if (!defined(my $pid = fork())) { # fork 
     182            die "couldn't fork: $!";      # die if fork fails 
     183        } elsif ($pid == 0) {             # fork successful, in child, do stuff 
     184            test_proxy( @{ $array_of_proxies[$forkcount] } ); 
     185            sleep 1;  
     186            exit 0; # kills child 
     187        } else {  # this is the parent 
     188        }  
     189    } 
     190    sleep while ($dead_nigger_storage < $maxfork); 
     191    close(GETONLY) or warn "!!!! couldn't close proxies.getonly.txt: $!\n"; 
     192    close(CANPOST) or warn "!!!! couldn't close proxies.canpost.txt: $!\n"; 
     193    print ">>>> Testing complete.\n"; 
    267194} 
    268195 
    269196sub test_proxy { 
    270   PROXYTEST: foreach $proxy (@_) { 
    271     # create pseudo-web-browser with user-agent of firefux 
    272     my $pseudo_browser = LWP::UserAgent->new; 
    273     $pseudo_browser->agent("$agent"); 
    274     # set up proxy 
    275     $pseudo_browser->proxy('http', "http://$proxy/");  
    276     $pseudo_browser->timeout($timeout); 
    277     # set up GET  
    278     $GET_page = HTTP::Request->new(GET => 'http://www.google.com/webhp'); 
    279     # GET 
    280     $GET_result = $pseudo_browser->request($GET_page); 
    281     # check GET result 
    282     if (($GET_result->is_success) && ($GET_result->content =~ /&copy;\d* Google/)) { 
    283       # POST 
    284       $form = HTML::Form->parse($GET_result); 
    285       $form->value(q => "$query"); 
    286       $POST_result = $pseudo_browser->request($form->click); 
     197    PROXYTEST: foreach my $proxy (@_) { 
     198        if (is_blacklisted($proxy)) { 
     199            printf '%-25s', $proxy; 
     200            print "FAILURE - BLACKLISTED PROXY\n";  
     201            next PROXYTEST; 
     202        } 
     203        # create pseudo-web-browser with user-agent of firefux 
     204        my $pseudo_browser = LWP::UserAgent->new; 
     205        $pseudo_browser->agent( $agent ); 
     206        # set up proxy 
     207        $pseudo_browser->proxy('http', "http://$proxy/");  
     208        $pseudo_browser->timeout($timeout); 
     209        # set up GET  
     210        my $GET_page = HTTP::Request->new(GET => 'http://www.google.com/webhp'); 
     211        # GET 
     212        my $GET_result = $pseudo_browser->request($GET_page); 
     213        # check GET result 
     214        my $POST_result; 
     215        if (($GET_result->is_success) && ($GET_result->content =~ /&copy;\d* Google/)) { 
     216            # POST 
     217            my $form = HTML::Form->parse($GET_result); 
     218            $form->value(q => $query); 
     219            $POST_result = $pseudo_browser->request($form->click); 
     220        } else { 
     221            printf '%-25s', $proxy; 
     222            print "FAILURE - COULD NOT GET\n"; 
     223            next PROXYTEST; 
     224        } 
     225        # check POST result 
     226        if ($POST_result->is_success) { 
     227            if ($POST_result->decoded_content !~ /Results.*for <b>$query<\/b>/i) { 
     228                printf '%-25s', $proxy; 
     229                print "FAILURE - UNKNOWN\n"; 
     230            } else { 
     231                printf '%-25s', $proxy; 
     232                print "SUCCESS !\n"; 
     233                print CANPOST "$proxy\n"; 
     234            } 
     235        } else { 
     236            printf '%-25s', $proxy; 
     237            print "FAILURE - COULD NOT POST\n"; 
     238            print GETONLY "$proxy\n"; 
     239        } 
     240    } 
     241} 
     242 
     243sub is_blacklisted { 
     244    my $full_proxy = $_[0]; 
     245    my ($first_octet, $second_octet, $third_octet, $fourth_octet, $port) = $full_proxy =~ /(\d+)\.(\d+)\.(\d+)\.(\d+):(\d+)/; 
     246    # check against my blacklist 
     247    if ($first_octet =~ /^(?:6|7|11|21|22|25|26|29|30|49|50|55|164|155|147|144|143|140|138|137|132|131|128|129|134|136|138|139|205|216|160|150)$/) { 
     248        return 1;   
     249    } elsif ($first_octet == 207 && $second_octet =~ /60|61|120/) {  
     250        return 1;   
     251    } elsif ($first_octet == 204 && $second_octet == 34) {  
     252        return 1;   
     253    } elsif ($first_octet == 163 && $second_octet =~ /205|206/) {  
     254        return 1;   
     255    } elsif ($first_octet == 158 && $second_octet =~ /(?:[0-9]|1[0-9]|2[0-9]|30)/) {  
     256        return 1;   
     257    } elsif ($first_octet == 158 && $second_octet =~ /(?:23[5-9]|24[0-9]|25[0-5])/) {  
     258        return 1;   
     259    } elsif ($first_octet == 153 && $second_octet =~ /(?:2[1-9]|3[0-1])/) { 
     260        return 1;   
     261    } elsif ($first_octet == 24 && $second_octet == 198) { 
     262        return 1;   
     263    } elsif ($first_octet == 62 && $second_octet =~ /(?:[0-9]|2[0-9]|30)/) { 
     264        return 1;   
     265    } elsif ($first_octet == 64 && $second_octet =~ /70|224|225|226/) { 
     266        return 1;   
     267    } elsif ($first_octet == 212 && $second_octet =~ /56|143|149|159|179|208/) { 
     268        return 1;   
     269    } elsif ($first_octet == 158 && $second_octet =~ /(?:23[5-9]|24[0-9]|25[0-5])/) { 
     270        return 1;   
     271    } elsif ($first_octet == 146 && $second_octet =~ /17|80|98|154|165/) { 
     272        return 1;   
     273    } elsif ($first_octet == 148 && $second_octet == 114) { 
     274        return 1;   
     275    } elsif ($first_octet == 152 && $second_octet =~ /82|151|152|154|229/) { 
     276        return 1;   
     277    } elsif ($first_octet == 156 && $second_octet == 9) { 
     278        return 1;   
     279    } elsif ($first_octet == 159 && $second_octet == 120) { 
     280        return 1;   
     281    } elsif ($first_octet == 161 && $second_octet == 124) { 
     282        return 1;   
     283    } elsif ($first_octet == 167 && $second_octet == 44) { 
     284        return 1;   
     285    } elsif ($first_octet == 169 && $second_octet =~ /252|253/) { 
     286        return 1;   
     287    } elsif ($first_octet == 195 && $second_octet == 10) { 
     288        return 1;  
     289    } elsif ($first_octet == 199 && $second_octet == 122) { 
     290        return 1;   
     291    } elsif ($first_octet == 203 && $second_octet == 59) { 
     292        return 1;   
     293    } elsif ($first_octet == 207 && $second_octet == 30) { 
     294        return 1;   
     295    } elsif ($first_octet == 208 && $second_octet == 240) { 
     296        return 1;   
     297    } elsif ($first_octet == 209 && $second_octet == 35) { 
     298        return 1;   
     299    } elsif ($first_octet == 213 && $second_octet == 8) { 
     300        return 1;   
     301    } elsif ($first_octet == 157 && $second_octet =~ /150|153|202|217/) { 
     302        return 1;   
     303    } elsif ($first_octet == 162 && $second_octet =~ /32|45|46/) { 
     304        return 1; 
     305    } elsif ($first_octet == 168 && $second_octet =~ /68|85|102/) {  
     306        return 1; 
    287307    } else { 
    288       printf '%-25s', $proxy; 
    289       print "FAILURE - COULD NOT GET\n"; 
    290       next PROXYTEST; 
    291     } 
    292     # check POST result 
    293     if ($POST_result->is_success) { 
    294       if (is_blacklisted($proxy)) { 
    295         printf '%-25s', $proxy; 
    296         print "FAILURE - BLACKLISTED PROXY\n"; 
    297       } else { 
    298         printf '%-25s', $proxy; 
    299         print "SUCCESS !\n"; 
    300         print CANPOST "$proxy\n"; 
    301       } 
    302     } else { 
    303       printf '%-25s', $proxy; 
    304       print "FAILURE - COULD NOT POST\n"; 
    305       print GETONLY "$proxy\n"; 
    306     } 
    307   } 
    308 } 
    309  
    310 sub is_blacklisted { 
    311   my $full_proxy = $_[0]; 
    312   my ($first_octet, $second_octet, $third_octet, $fourth_octet, $port) = $full_proxy =~ /(\d+)\.(\d+)\.(\d+)\.(\d+):(\d+)/; 
    313   # check against my blacklist 
    314   if ($first_octet =~ /^(?:6|7|11|21|22|25|26|29|30|49|50|55|164|155|147|144|143|140|138|137|132|131|128|129|134|136|138|139|205|216|160|150)$/) { 
    315     return 1;   
    316   } elsif ($first_octet == 207 && $second_octet =~ /60|61|120/) {  
    317     return 1;   
    318   } elsif ($first_octet == 204 && $second_octet == 34) {  
    319     return 1;   
    320   } elsif ($first_octet == 163 && $second_octet =~ /205|206/) {  
    321     return 1;   
    322   } elsif ($first_octet == 158 && $second_octet =~ /(?:[0-9]|1[0-9]|2[0-9]|30)/) {  
    323     return 1;   
    324   } elsif ($first_octet == 158 && $second_octet =~ /(?:23[5-9]|24[0-9]|25[0-5])/) {  
    325     return 1;   
    326   } elsif ($first_octet == 153 && $second_octet =~ /(?:2[1-9]|3[0-1])/) { 
    327     return 1;   
    328   } elsif ($first_octet == 24 && $second_octet == 198) { 
    329     return 1;   
    330   } elsif ($first_octet == 62 && $second_octet =~ /(?:[0-9]|2[0-9]|30)/) { 
    331     return 1;   
    332   } elsif ($first_octet == 64 && $second_octet =~ /70|224|225|226/) { 
    333     return 1;   
    334   } elsif ($first_octet == 212 && $second_octet =~ /56|143|149|159|179|208/) { 
    335     return 1;   
    336   } elsif ($first_octet == 158 && $second_octet =~ /(?:23[5-9]|24[0-9]|25[0-5])/) { 
    337     return 1;   
    338   } elsif ($first_octet == 146 && $second_octet =~ /17|80|98|154|165/) { 
    339     return 1;   
    340   } elsif ($first_octet == 148 && $second_octet == 114) { 
    341     return 1;   
    342   } elsif ($first_octet == 152 && $second_octet =~ /82|151|152|154|229/) { 
    343     return 1;   
    344   } elsif ($first_octet == 156 && $second_octet == 9) { 
    345     return 1;   
    346   } elsif ($first_octet == 159 && $second_octet == 120) { 
    347     return 1;   
    348   } elsif ($first_octet == 161 && $second_octet == 124) { 
    349     return 1;   
    350   } elsif ($first_octet == 167 && $second_octet == 44) { 
    351     return 1;   
    352   } elsif ($first_octet == 169 && $second_octet =~ /252|253/) { 
    353     return 1;   
    354   } elsif ($first_octet == 195 && $second_octet == 10) { 
    355     return 1;  
    356   } elsif ($first_octet == 199 && $second_octet == 122) { 
    357     return 1;   
    358   } elsif ($first_octet == 203 && $second_octet == 59) { 
    359     return 1;   
    360   } elsif ($first_octet == 207 && $second_octet == 30) { 
    361     return 1;   
    362   } elsif ($first_octet == 208 && $second_octet == 240) { 
    363     return 1;   
    364   } elsif ($first_octet == 209 && $second_octet == 35) { 
    365     return 1;   
    366   } elsif ($first_octet == 213 && $second_octet == 8) { 
    367     return 1;   
    368   } elsif ($first_octet == 157 && $second_octet =~ /150|153|202|217/) { 
    369     return 1;   
    370   } elsif ($first_octet == 162 && $second_octet =~ /32|45|46/) { 
    371     return 1; 
    372   } elsif ($first_octet == 168 && $second_octet =~ /68|85|102/) {  
    373     return 1; 
    374   } else { 
    375     return 0;  
    376   } 
    377 } 
    378  
    379 sub handler { 
    380   my $signame = shift; 
    381   if($signame eq "CHLD") {  
    382     while(($pid = waitpid(-1, WNOHANG)) > 0) { 
    383       $dead_nigger_storage++; 
    384     } 
    385   } 
    386 } 
    387  
    388 sub exit_nicely { 
    389   kill('INT', (getpgrp(0) * -1)) && exit; 
    390 } 
     308        return 0;  
     309    } 
     310} 
Note: See TracChangeset for help on using the changeset viewer.