Friday, November 23, 2012

GET HTTP with Simplified Option(proxy / non-proxy)

#!/usr/bin/perl
############################################
#           [+]  Get HTTP
#       Created
#              BY
#                Pretorians
#
###########################################
use LWP::Simple;
use Time::localtime;
use LWP::UserAgent;
##
print "[+] GET Http Modem\n";
##
sub timestamp {
  my $c = localtime;
  return sprintf( "%04d-%02d-%02d_%02d-%02d-%02d",
                  $c->year + 1900, $c->mon + 1, $c->mday,
                  $c->hour, $c->min, $c->sec );
}
print '[+] Date: [' . timestamp() . ']'. "\n";
##
##
if (@ARGV == 0) {&usg;}
while (@ARGV > 0) {
$type = shift(@ARGV);
$t = shift(@ARGV);
if ($type eq "-p") {
print "[!] Target: $t\n";
my $ua = LWP::UserAgent->new;
     $ua->agent('Mozilla/5.0 ');
       $ua->proxy([(http )] => 'socks://127.0.0.1:9050');
        $ua->cookie_jar({});
      my $r = $ua->get("http://$t/") or die ("Unable to get page!");
print $r->content;
}}
if ($type eq "-n") {
print "[!] Target: $t\n";
my $r = getprint("http://$t/") or die ("Unable to get page!");
}
##
sub usg(){
print "[!] usg: perl get.pl [-p or -n] \n";
print "[!]  -p: With Proxy\n";
print "[!]  -n: Without Proxy\n";
}
exit ;

No comments:

Post a Comment