#!/usr/bin/perl # ProxyHunter 0.4 # By Sock (http://www.socklabs.com) # ChangeLog # 18.5.2004 First release use strict; #use warnings; use LWP::UserAgent; use HTTP::Request::Common; use Getopt::Long; my $opt_page = 1; our %info = (version => "0.4", format => 0, agent => "Sock's Proxy Hunter/0.3", clear => 0, anonymous => 0, spranonymous => 1, elite => 1 ); our @data; our @marks; # Lets define the data structure for the proxy array # ip/host, port, type, country, anon level, use (0 no:1 yes) push @data, { host => '127.0.0.1', port => 8080, type => "http", country => "USA", level => "http", use => 0, }; # Name, target page, clear all whitespace (1 yes, 0 no) push @marks, [1, "Stayinvisible.com", "http://www.stayinvisible.com/index.pl/proxy_list?order=&offset=0", 1]; push @marks, [1, "PublicProxyServer.com", "http://www.publicproxyservers.com/page1.html", 1]; push @marks, [1, "Proxy4Free.com", "http://www.proxy4free.com/page1.html", 1]; print <<"EOF"; ProxyHunter $info{version} (c) 2003-2004 Sock Released without warranty under the terms of the Artistic License. EOF our $opt_debug; our $opt_format; our $opt_verbose; GetOptions("help|?",\&showhelp, "debug", \$opt_debug, "page=s", \$opt_page, "output=s", \$opt_format, "verbose|v", \$opt_verbose); sub showhelp() { print << "EOF" ; Usage: $0 [options] dir1 dir2 file1 file2 ... Options: --debug Show extra debug information --spage=x Set the page to read from on the stayinvis website. Not Used --output=x Set the output format. See examples: [0] 192.168.1.1 80 [1] http 192.168.1.1 8080 # Highly Anonymous - Russia [2] 192.168.1.1:80\@http --help Display this help message EOF exit; } our $debug = $opt_debug; our $format = $opt_format ? $opt_format : $info{format}; our $t = 0; print "Debug option set.\n" if ($debug); #stayinvis(); markloop(); sub markloop() { foreach my $m (@marks) { if ($m->[0] == 1) { print "[+Scan] Starting engine for $m->[1]\n"; print " [Debug] Initilizing agent.\n" if ($debug); my $proxhunter = LWP::UserAgent->new(); $proxhunter->agent($info{agent}); print " [Debug] Retrieving site: $m->[2].\n" if ($debug); my $http_res = $proxhunter->request(POST $m->[2]); my $stuff = $http_res->content; print " [Debug] Error pulling site contents.\n" and return unless ($http_res->is_success); if ($m->[3] == 1){ print " [Debug] Removing white spaces.\n" if ($debug); $stuff =~ s/\s//g; } print " [Debug] Sifting through results.\n" if ($debug); while ($stuff =~ m/