LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-08-2011, 11:04 AM   #1
nkd
Member
 
Registered: Oct 2006
Location: india
Distribution: fedora 8, ubuntu 10.10
Posts: 318

Rep: Reputation: 34
apache2 : problem with dynamic module headers


hi all,
I am running ubuntu 10.10 on my system.
I am trying to change the header of Apache2 Server using the mod_header. The objective is that no one should be able to retrieve the Apache banner, OS, etc, by telnetting into the system. I know the header can be totally taken off with the
Quote:
ServerSignature Off
directive, but I would instead like to change it to something misleading rather than switch off the signature, so that the hacker is misled ?!?

I used the following command :-
Quote:
a2enmod headers
I checked the links to the headers.load file has been added in the /etc/apache2/mods-enabled directory. Also the headers.load file is pointing to the correct file as under :-
Quote:
LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so
I have included the following command in the /etc/apache2/apache2.conf file and expected it to set the server header to the string between the double quotes. But it didn't work !?!
Quote:
Header set "AnArbitaryServerNameAndVersion"
Also let me know how to find out the status of the shared objects loaded by apache2 at any time. The /etc/apache2 -l command lists only the compiled modules and not the modules enabled using the a2enmod command.

Plz help me out. Thanks in advance
nishith

Last edited by nkd; 08-08-2011 at 11:40 AM.
 
Old 08-08-2011, 01:28 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

You have an error (missed the header name "Server")
Code:
Header set Server "AnArbitaryServerNameAndVersion"
but it's not guaranteed it works (for my apache 2.2.19 it's not). If that's not working, you can use:
Code:
ServerSignature Off 
ServerTokens Prod
that will hide anything except "Server: Apache" in the headers.

If you want to remove or change "Apache" use mod_security to do this. Or change the AP_SERVER_BASEPRODUCT in ap_release.h and recompile apache.

BTW
Code:
httpd -M
should show the loaded modules
 
1 members found this post helpful.
Old 08-08-2011, 03:28 PM   #3
nkd
Member
 
Registered: Oct 2006
Location: india
Distribution: fedora 8, ubuntu 10.10
Posts: 318

Original Poster
Rep: Reputation: 34
Thanks a lot.
The headers module did not work as brought out by you.
I Tried out the mod_security2.so module and it worked nicely. The only thing to remember is use the

Quote:
SecServerSignature "Microsoft-IIS/5.0"
and ensure the following are set as under :-
Quote:
ServerTokens Full
ServerSignature On
If the above two directives are not set as shown the SecServerSignature directive won't work.

The best part is even Nmap could be spoofed as it reported the Apache2 as IIS server.

Thanks once again.
bye
nishith
 
  


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
[SOLVED] How to build module against headers that are not from the running kernel? eantoranz Programming 1 04-13-2011 06:09 PM
Apache2 + no-ip (dynamic ip) pyre Linux - General 12 11-05-2006 01:23 AM
Apache2 Virtual Dynamic Hosts and defaults techrolla Linux - Networking 1 11-01-2004 04:01 PM
python email module extracting headers artur Programming 3 02-06-2004 01:59 PM
php static module & dynamic module install. eye Linux - Software 0 10-18-2003 12:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:24 PM.

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