logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: blocking trace with mod_rewrite
Author
ali_fareed



Joined: 04 Jul 2006
Posts: 61
Location: Bahrain

PostPosted: Fri 07 Jul '06 14:55    Post subject: blocking trace with mod_rewrite Reply with quote

hello everybody, I am using mod_rewrite to block trace requests by adding this code to the configuration:
<IfModule rewrite_module>
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* – [F]
</IfModule>
and it seems to work fine but when I tried connecting with ssl using openssl s_client I was able to get a trace response is there something missing in my configuration or is there a problem with mod_rewrite and I'm really sorry for asking so many questions.
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Fri 07 Jul '06 15:20    Post subject: Reply with quote

There no known issues with mod_rewrite.

Do not know openssl s_client, but it should block the Trace REQUEST_METHOD, maybe you are talking about a different trace in s_client.

We use the rule:

RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule ^ - [F]


Steffen
Back to top
ali_fareed



Joined: 04 Jul 2006
Posts: 61
Location: Bahrain

PostPosted: Fri 07 Jul '06 15:33    Post subject: Reply with quote

You dont know the s_client in openssl? it's an ssl client in openssl which gives you the ability to send raw request to any type of servers like using netcat or telnet but for ssl you can use it by invoking openssl with "openssl s_client -connect server:port" and I mean the trace method the one where you make a request and get a reply with you request echoed. But i'm still having a problem can anybody help me. one more thing i forgot to mention when i connect without ssl the trace request is responded with a forbidden so it's working if the request is made without ssl
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Fri 07 Jul '06 15:53    Post subject: Reply with quote

When you use vhosts (most of us have SSL in a vhost) then you must have in the Vhost container:
RewriteEngine on
RewriteOptions inherit

OR place the rewrite code in the Vhost container.
Back to top
ali_fareed



Joined: 04 Jul 2006
Posts: 61
Location: Bahrain

PostPosted: Fri 07 Jul '06 16:02    Post subject: Reply with quote

no I still seem to have the problem.
Back to top
ali_fareed



Joined: 04 Jul 2006
Posts: 61
Location: Bahrain

PostPosted: Tue 11 Jul '06 19:52    Post subject: Reply with quote

I finally got it thanks for the help.
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Wed 12 Jul '06 11:59    Post subject: Reply with quote

What was causing your issue ?
Back to top
ali_fareed



Joined: 04 Jul 2006
Posts: 61
Location: Bahrain

PostPosted: Wed 12 Jul '06 20:05    Post subject: Reply with quote

like you said i had to add :
RewriteEngine on
RewriteOptions inherit

in the virtual host container in the httpd-ssl.conf file thanks for your help again.
Back to top
ali_fareed



Joined: 04 Jul 2006
Posts: 61
Location: Bahrain

PostPosted: Tue 18 Jul '06 18:56    Post subject: Reply with quote

speaking of trace why dont you block trace no one really uses it because it's used for debugging and its a security risk because it may be used for XSS or credential theft http://www.cgisecurity.com/whitehat-mirror/WhitePaper_screen.pdf
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Tue 18 Jul '06 19:11    Post subject: Reply with quote

Thanks for the info.

I agrre, but I rather do not want to change the official code.

I think we must advice Apacherians not to allow the REQUEST_METHOD Trace, this can be done like you with mod_rewrite or with mod_security.


Steffen
Back to top


Reply to topic   Topic: blocking trace with mod_rewrite View previous topic :: View next topic
Post new topic   Forum Index -> Apache