exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

proxycheck.pl.txt

proxycheck.pl.txt
Posted Dec 18, 2007
Authored by Tom Van de Wiele

This is a simple proxy tool that checks for the HTTP CONNECT method and grabs verbose output from a webserver. It is primarily useful when verifying false positives from automated vulnerability assessment tools.

tags | tool, web, scanner
systems | unix
SHA-256 | 203ad5690055cb97040a956a45aea7128a31b0d77823f608d16c161a7e50eecc

proxycheck.pl.txt

Change Mirror Download
#!/usr/bin/perl
#
# Tool to easily check for the HTTP CONNECT method and get verbose output from a webserver. Mainly useful to verify false positives of
# automated web vulnerability assessment tools. 2007 - Tom Van de Wiele (tom@ashrae.be).
#
# Please use responsibly.
#
use strict; # an offering to the perl nazi's
use IO::Socket;

my ($targethost, $targetport, $useragent, $rhost, $rport, $found200, $foundmethods);

sub usage() {
print "HTTP 1.0 \"CONNECT\" method checker -- Tom Van de Wiele (tom\@ashrae.be)\n";
print "proxycheck.pl <target-to-test> <target-proxyport> [rhost] [rport] [useragent]\n";
}

if ($#ARGV < 1) {
usage();
exit(0);
}

$targethost = $ARGV[0];
$targetport = $ARGV[1];

print "HTTP 1.0 \"CONNECT\" method checker -- Tom Van de Wiele (tom\@ashrae.be)\n\n";

if ($ARGV[2]) {
$rhost = $ARGV[2];
}
else {
print "(-) No rhost specified, going to try www.google.com\n";
$rhost = "www.google.com";
}


if ($ARGV[3]) {
$rport = $ARGV[3];
}
else {
print "(-) No rport specified, gonna use port 80\n";
$rport = "80";
}


if ($ARGV[4]) {
$useragent = $ARGV[4];
}
else {
print "(-) No useragent specified, gonna use: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3) (Debian)\n";
$useragent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3) (Debian)";
}




my $request = "CONNECT $rhost:$rport HTTP/1.0\nUser-agent: $useragent\nHost: $targethost\n\n\n";

# everyone has at least one dirty sock

my $dirty_sock = new IO::Socket::INET(
PeerAddr => $targethost,
PeerPort => $targetport,
Proto => 'tcp');
$dirty_sock or die "(!) Connection failed: $!";

print $dirty_sock $request;

my @copy;

while (<$dirty_sock>) {

if (/(HTTP\/1.[0-9] 200.*)/) {
my $http_response = $1;
print "(-)\n(+) $targethost accepted the connection\n(-)\n";
$found200 = 1;
}

if (/^Allow:\s+.*CONNECT.*$/) {
print "(-)\n(+) Found \"ALLOW\" method in HTTP header\n(-)\n";
$foundmethods = 1;
}
push(@copy, $_);

}

if ($found200 == 0) {
print "(-)\n(+) Server $targethost refused or returned no HTTP 200\n(-)\n";
}
if ($foundmethods == 0) {
print "(+) Server $targethost did not give out allowed HTTP methods\n(-)\n";
}

print "(+) Response from webserver:\n(-)\n";

foreach my $line (@copy) {
print "(+) " . $line;
}
print "\n";

exit(0);

#EOF
Login or Register to add favorites

File Archive:

July 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    27 Files
  • 2
    Jul 2nd
    10 Files
  • 3
    Jul 3rd
    35 Files
  • 4
    Jul 4th
    27 Files
  • 5
    Jul 5th
    18 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    25 Files
  • 12
    Jul 12th
    11 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    28 Files
  • 16
    Jul 16th
    6 Files
  • 17
    Jul 17th
    34 Files
  • 18
    Jul 18th
    0 Files
  • 19
    Jul 19th
    0 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    0 Files
  • 23
    Jul 23rd
    0 Files
  • 24
    Jul 24th
    0 Files
  • 25
    Jul 25th
    0 Files
  • 26
    Jul 26th
    0 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close