LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Yo Jeremy...How the heck did you change your response headers???? (https://www.linuxquestions.org/questions/linux-general-1/yo-jeremy-how-the-heck-did-you-change-your-response-headers-11909/)

ForumKid 01-16-2002 11:08 AM

Yo Jeremy...How the heck did you change your response headers????
 
Hi,
Scanning http://www.linuxquestions.org with id serve from grc.com shows that you running "Server: Jeremys HTTPD (OS??)
".
Lets assume your running apache. Maybe you can help me.

1) Did u change httpd.h?
2) Did u change something else?
3) If its httpd.h, is there a way to reflect the changes without recompiling
4) If i have to recompile, is there a way to get the necessary scripts to recompile. Oracle http uses apache server. But it does not install with the necessary scripts to recompile.

Please help me since i Have been searching and trying to figure this out for almost a month
THanks

ForumKid 01-16-2002 08:44 PM

Well then.............does anyone know how?

Scotty2435 01-16-2002 08:54 PM

i'd put this in the website sugggestions page Jeremy reads and posts there I think

jeremy 01-16-2002 09:04 PM

I read and post everywhere :study:

As for how I made the web server do that, I wouldn't recommend what I did. You can edit the apache source to return whatever you want though. Offhand I wouldn't know the exact file to edit, but I quick look at the source should tell you.

--jeremy

unSpawn 01-17-2002 01:40 AM

You usually would look for a line like "#define VERSION" for 2.x series I think it's in include/httpd.h. Else you could try using apache-mod_headers (mod_headers.so) to change headers, but I havent got any experience with that.
Changes in httpd.h can't work w/o recompiling.

ForumKid 01-17-2002 10:10 AM

Hey guys,
I will take a look at apache-mod_headers (mod_headers.so) to see if i can find a way to do this and then ill let youz know. Most normal situations you can just edit httpd.h. But as i stated before, i cant recompile.

Thanks

ForumKid 01-17-2002 05:17 PM

Well the module is not good because the main goal is to change the server version.

Taken from apache::
The Header directives are processed just before the response is sent by its handler. These means that some headers that are added just before the response is sent cannot be unset or overridden. This includes headers such as "Date" and "Server".

So what the F. I simply want to change the server thats shown for the response header. Nothing is ever easy. Ill take any more suggestions.
Thanks

Mik 01-18-2002 03:13 AM

If I telnet in to my apache server and give the command:
GET / HTTP 1.0
(followed by a blank line)

At the top bit it says something like
Server: Apache/1.3.20 (Unix)

Now if I scan the executable httpd I can find that exact same string.
strings httpd | grep "Apache/1.3.20 (Unix)"

So I guess if you can't recompile all you would have to do is use a hex editor to modify that string. Make sure you backup the original file just in case you totally mess it up. And remember the string you replace it with should be the same length. If it's shorter you can always replace the last few characters with spaces.

You'll also find more of them if you run the command
strings httpd | grep -i "apache"

I don't know when each one is used but I'll leave that to you to figure out.

ForumKid 01-18-2002 05:35 AM

Hi,
I found a few. Changed them and still nothing.

Question: Is there a way to just compile httpd.h somehow. When httpd.h is compiled, where is the object. And can the object be modified.

My security book says the headers are coming from httpd.h. I changed and somehow i have to recompile the sucker.
Thanks again

ForumKid 01-18-2002 06:05 AM

well well well....I finally did it. Hey Mik!!! You the man.
I downloaded a free trial hex editor. The file to edit is httpd binary. I edited and changed all references of my server version and waaaaa laaaaa.

I start apache like this.
/bin/apachectl start
in the dir /bin there is a file called httpd. Thats the one to change just in case someone that reads this wants to do it.

I thank everyone.


All times are GMT -5. The time now is 02:59 AM.