[CentOS] Apache + mod_evasive : problem with test.pl

Sun Jul 9 12:41:34 UTC 2017
Nicolas Kovacs <info at microlinux.fr>

Le 09/07/2017 à 13:17, Alexander Dalloz a écrit :
> What does apache log? I guess it logs more than just HTTP status 400.

I wonder if something is wrong with the test.pl script. Here's what I have:

#!/usr/bin/perl

# test.pl: small script to test mod_dosevasive's effectiveness

use IO::Socket;
use strict;

for(0..20) {
  my($response);
  my($SOCKET) = new IO::Socket::INET( Proto   => "tcp",
                                      PeerAddr=> "127.0.0.1:80");
  if (! defined $SOCKET) { die $!; }
  print $SOCKET "GET /?$_ HTTP/1.0\n\n";
  $response = <$SOCKET>;
  print $response;
  close($SOCKET);
}

With this script (present in /usr/share/doc/mod_evasive-1.10.1/) I get a
"HTTP/1.1 400 Bad Request" error back on a standard CentOS installation.

Hmmmm. I'm clueless.

Niki


-- 
Microlinux - Solutions informatiques durables
7, place de l'église - 30730 Montpezat
Web  : http://www.microlinux.fr
Mail : info at microlinux.fr
Tél. : 04 66 63 10 32