LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 09-23-2004, 04:11 PM   #1
Cerbere
Member
 
Registered: Dec 2002
Location: California
Distribution: Slackware & LFS
Posts: 799

Rep: Reputation: 33
Using mod_security to disallow TRACE|TRACK


I've been trying out Openwall linux on an old box of mine. I just finished setting up a chroot'ed Apache/PHP/MySQL setup according to these articles: Apache, PHP, and MySQL.
So far, so good. I've been checking the server's security by running a nessus scan, which comes up fairly clean, with the following exception:
Quote:
. Warning found on port http (80/tcp)

Your webserver supports the TRACE and/or TRACK methods. TRACE and TRACK
are HTTP methods which are used to debug web server connections.

It has been shown that servers supporting this method are subject
to cross-site-scripting attacks, dubbed XST for
"Cross-Site-Tracing", when used in conjunction with
various weaknesses in browsers.

An attacker may use this flaw to trick your
legitimate web users to give him their
credentials.

Solution: Disable these methods.


If you are using Apache, add the following lines for each virtual
host in your configuration file :

RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
Now, my problem is that I compiled Apache without the mod_rewrite module. So I'm trying to deny TRACE and TRACK methods using mod_security. It seems a simple matter, but I'm not very good with regular expressions, so I was hoping someone here could give me some help.

I've tried each of the following, with no success:
Code:
SecFilterSelective REQUEST_METHOD "^(TRACE|TRACK).*$" "deny,status:405"
SecFilterSelective REQUEST_METHOD "^(TRACE|TRACK)" "deny,status:405"
SecFilterSelective REQUEST_METHOD "(^TRACE|^TRACK)" "deny,status:405"
SecFilterSelective REQUEST_METHOD "(TRACE|TRACK)" "deny,status:405"
I've also tried each of the above with double-quotes around "REQUEST_METHOD", and omitting the "deny,status:405" action (my config includes SecFilterDefaultAction "deny,log,status:500"), as well as trying each without specifying REQUEST_METHOD, using the SecFilter directive. But still no luck. Looking through the audit_log, it happily returns '200 OK' for each request.

This is one of those nagging annoyances which must have a solution that's perfectly obvious, once you know it, but I don't. Can someone help me out here?

Enjoy!
--- Cerbere

[edit] I've also tried returning a status of 403, both in the action of SecFilterSelective, and in the SecFilterDefaultAction. [/edit]

Last edited by Cerbere; 09-23-2004 at 04:14 PM.
 
Old 09-27-2004, 12:57 PM   #2
Cerbere
Member
 
Registered: Dec 2002
Location: California
Distribution: Slackware & LFS
Posts: 799

Original Poster
Rep: Reputation: 33
bump.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mod_security kingtas Linux - Security 4 01-20-2008 04:53 PM
mod_security and fedora linchat Fedora 0 09-30-2005 09:34 PM
mod_security for apache zsoltrenyi Linux - Security 0 02-08-2005 06:36 AM
mod_security running? kingtas Linux - Newbie 0 01-23-2005 10:56 AM
mod_security ridertech Linux - Security 1 09-01-2004 05:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 07:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration