Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Jun 2007 07:25:59 -0400
From:      "Bob" <bob@a1poweruser.com>
To:        "Chuck Swiger" <cswiger@mac.com>
Cc:        "freebsd-questions@FreeBSD. ORG" <freebsd-questions@FreeBSD.ORG>
Subject:   RE: stopping "connect" attacks in apache
Message-ID:  <NBECLJEKGLBKHHFFANMBAEMOCDAA.bob@a1poweruser.com>
In-Reply-To: <97823238-9544-478B-BAF3-C9CC53BBB36A@mac.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Jun 15, 2007, at 7:49 PM, Bob wrote:
> Every time my apache server slows down or has denial of service the
> access
> log is full this
>
> 61.228.122.220 -  "CONNECT 66.196.97.250:25 HTTP/1.0" 200 7034 "-" "-"
> 61.228.122.220 -  "CONNECT 216.39.53.3:25 HTTP/1.0" 200 7034 "-" "-"
> 61.228.122.220 -  "CONNECT 216.39.53.1:25 HTTP/1.0" 200 7034 "-" "-"
> 61.228.122.220 -  "CONNECT 168.95.5.155:25 HTTP/1.0" 200 7034 "-" "-"
> 61.228.122.220 -  "CONNECT 168.95.5.157:25 HTTP/1.0" 200 7034 "-" "-"
> 61.228.122.220 -  "CONNECT 168.95.5.159:25 HTTP/1.0" 200 7034 "-" "-"

>IP 61.228.122.220 is using the HTTP CONNECT method to relay spam to
>port 25 on the targets via your Apache server.

>This almost certainly indicates that you've got mod_proxy loaded or
>something similar via mod_perl/mod_php/whatever, as the CONNECT
>attack would get a "405 Method not allowed" error otherwise.

>-Chuck

_______________________________________________

-----Original Message-----
From: owner-freebsd-questions@freebsd.org
[mailto:owner-freebsd-questions@freebsd.org]On Behalf Of Chuck Swiger
Sent: Monday, June 18, 2007 1:02 PM
To: bob@a1poweruser.com
Cc: freebsd-questions@FreeBSD. ORG
Subject: Re: stopping "connect" attacks in apache

The replies to my post came back saying that apache defaults to denying
CONNECT requests which I was not able to verify. That mod_proxy was causing
it. I have mod-proxy commented out.
That the CONNECT request is some how being spoofed through php  which I was
not able to verify.
My reading of php5 says it accepts all valid methods that apache hands it.
To me this indicates that apache is not denying CONNECT requests by default.
Reading a book I have titled 'Maximum Apache Security' it said to gain
explicit control over the "Methods" use the <Limit> or <LimitExcept>
declaratives with the 'Require valid-user' in the default  <Directory />
definition in the http-conf file.

So in apache http-conf around line 340 I added the <LimitExcept GET POST>
Declarative like this to the default directory definition so it looks like
this.

<Directory />
    	      Options FollowSymLinks
                  AllowOverride None
                 Order allow,deny
                 Allow from all
                 <LimitExcept GET POST>
                        Require valid-user
                </LimitExcept>
            </Directory>

            Now the access log shows this

            61.228.120.228 - - [17/Jun/2007:22:42:49 -0400] "CONNECT
66.196.97.250:25 HTTP/1.0" 500 602 "-" "-"

            And the error.log shows this

           [Sun Jun 17 22:42:49 2007] [crit] [client 61.228.120.228]
configuration error:  couldn't perform authentication. AuthType not set!: /


          As you can see the CONNECT request is now being denied with a 500.
          The CONNECT requests have been stopped from attacking others.

          I post this solution so others can find it in the questions
archives.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?NBECLJEKGLBKHHFFANMBAEMOCDAA.bob>