File: test.pl

package info (click to toggle)
libapache-mod-evasive 1.10.1-4
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 292 kB
  • sloc: ansic: 2,976; makefile: 39; perl: 12
file content (18 lines) | stat: -rw-r--r-- 406 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl

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

use IO::Socket;
use strict;

for(0..100) {
  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);
}