Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 23rd, 2001, 12:22 PM
rycamor rycamor is offline
Gödelian monster
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 1999
Location: Pembroke Pines, Florida, USA
Posts: 2,300 rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 3 h 12 m 27 sec
Reputation Power: 56
what module does this?

This is driving me nuts. In my default compile of Apache with PHP, I often do "--enable-module=most". One of the features that gets enabled is a very nice feature which automatically redirects a request to the nearest match, if there is no file extension. For example:

If I request

http://myserver/test
And I happen to have a file named "test.php" in that directory, then that is the file that loads, even though the original request URL remains in the address bar. I can even do:

http://myserver/test?var1=value1&var2=value2

And "test.php" receives the query string vars.


Now, I think this is a useful feature sometimes, but the problem is, I don't know where to control it. Some of my servers don't have this feature, and I would like to find out how to enable it. Also, I might want to turn off this feature for performance tuning.

I know this is not using mod_rewrite, so I am trying to figure out which other module does this.

Here are two server examples; the first one has this feature, and the second one doesn't:

--------------- has auto redirect feature ---------------

Apache Version: 1.3.17
PHP Version: 4.0.4pl1

Loaded Modules: mod_php4, mod_setenvif, mod_auth, mod_access, mod_alias, mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_status, mod_negotiation, mod_mime, mod_log_config, mod_env, http_core


---------------- does not have auto redirect ---------------

Apache Version: 1.3.12
PHP Version: 4.0.1

Loaded Modules: mod_php4, mod_setenvif, mod_auth, mod_access, mod_alias, mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_status, mod_negotiation, mod_mime, mod_log_config, mod_env, http_core

--------------------------------

Can anyone give me a clue where to look? What httpd.conf directive would deal with this?
__________________
The real n-tier system:

FreeBSD -> PostgreSQL -> [any_language] -> Apache -> Mozilla/XUL

Amazon wishlist -- rycamor (at) gmail.com

Reply With Quote
  #2  
Old October 23rd, 2001, 08:52 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> Some of my servers don't have this feature

Are they identical? Check and see if another directive is overriding one and others.

Check this -> http://httpd.apache.org/docs/sections.html

Reply With Quote
  #3  
Old October 24th, 2001, 12:18 AM
rycamor rycamor is offline
Gödelian monster
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 1999
Location: Pembroke Pines, Florida, USA
Posts: 2,300 rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 3 h 12 m 27 sec
Reputation Power: 56
AHA!! MultiViews.

It *was* available on all servers, just not in the /~userdir.

When I try this method in the main DocumentRoot (/usr/local/apache/htdocs), it works on all my servers, and it correspondingly did NOT work anywhere in a /~userdir, because I had left those with the default untouched configuration.

All I had to do was add a <Directory> section for "/home/*/public_html" and give it "Options MultiViews".

For those who want to see, my complete section (based on the example found in httpd.conf) for users is now:
Code:
<Directory /home/*/public_html>
    AllowOverride FileInfo AuthConfig Limit
    Options MultiViews SymLinksIfOwnerMatch IncludesNoExec 
    <Limit GET POST OPTIONS PROPFIND>
        Order allow,deny
        Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS PROPFIND>  
        Order deny,allow
        Deny from all
    </LimitExcept>
</Directory>


freebsd - any potential security hazards in this? And thanks for the tip.

Reply With Quote
  #4  
Old October 24th, 2001, 01:28 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Yes, three bugs were found in version prior to 1.3.22. MultiViews was one of those.

http://www.securityfocus.com/bid/3009

Reply With Quote
  #5  
Old October 24th, 2001, 02:18 AM
rycamor rycamor is offline
Gödelian monster
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 1999
Location: Pembroke Pines, Florida, USA
Posts: 2,300 rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 3 h 12 m 27 sec
Reputation Power: 56
I remember now... I tested that exploit several times, and couldn't get it to work. Am I missing something? Wasn't http://my_site/?M=A or http://my_site/?S=D supposed to reveal my directory contents? I couldn't get this to happen even on my older Apache installs.

Reply With Quote
  #6  
Old October 24th, 2001, 03:22 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> Am I missing something?

Yes.

>> Wasn't http://my_site/?M=A or http://my_site/?S=D supposed to reveal my directory contents?

Not just M=A and S=D but also N=D, S=A and D=A.

>> I couldn't get this to happen even on my older Apache installs

Because you need to use %3F instead of ?.

Example:

http://my_site/%3FS=D

ATTENTION EVERYONE!

This example is for educational purpose. Don't abuse it!


I believe 80% of web servers running Apache out there are still vulnerable to this critical exploit.

Last edited by freebsd : October 24th, 2001 at 03:57 AM.

Reply With Quote
  #7  
Old October 25th, 2001, 02:52 AM
rycamor rycamor is offline
Gödelian monster
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 1999
Location: Pembroke Pines, Florida, USA
Posts: 2,300 rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 3 h 12 m 27 sec
Reputation Power: 56
I still couldn't get the exploit to work on any of my servers. I noticed at SecurityFocus that FreeBSD is only mentioned in a couple combinations with Apache 1.3.19. I run only FreeBSD, but none of my machines has exactly kernel 4.2 with 1.3.19. I don't know if that list is a restrictive list, or merely a list of confirmed combinations that have been exploited.

Just to confirm, I should just be able to put that query string on my URL, and then I will get a directory listing, as if the index file is not there, and directory viewing is turned on, right?

I notice that the SecurityFocus explanation says 'likely the result of an error in "multiview" functionality'. Maybe there is another feature involved, because I have multiviews turned on, and this didn't happen.

Is it possible this is more of a Linux thing than a BSD one?

Reply With Quote
  #8  
Old October 25th, 2001, 03:11 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> I still couldn't get the exploit to work on any of my servers

Make sure MultiViews is enabled. You can test by mkdir a directory, say under http://yourserver/foo/ and create http://yourserver/foo/index.html. Then create http://yourserver/foo/.htaccess with the content Options +MultiViews.
Go to http://yourserver/foo/, then test the exploit by going to http://yourserver/foo/%3FS=D.

>> I noticed at SecurityFocus that FreeBSD is only mentioned in a couple combinations with Apache 1.3.19

I believe this exploit happens on all platform (even OpenBSD) with version prior to 1.3.22. I have tested dozen sites (which I am not going to show here) that are still vulnerable.

>> I should just be able to put that query string on my URL

Not sure, I have never had a need to enable MultiViews so I can't confirm. Maybe you can test it.

>> Maybe there is another feature involved

MultiViews in Apache has a bad record in vulnerability and it's not the first time.

>> Is it possible this is more of a Linux thing than a BSD one?

No different.

BTW, if you wish to use MultiViews with query string, you MUST NOT upgrade to 1.3.22. MultiViews is BROKEN in 1.3.22 when using it with query string. You would get an empty string. Yes, they fixed the bug in 1.3.22 but eventually broke that feature.

Last edited by freebsd : October 25th, 2001 at 03:14 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > what module does this?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT