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 01-15-2005, 11:48 AM   #1
Kanon
Member
 
Registered: Sep 2004
Location: Norge
Distribution: Debian
Posts: 116

Rep: Reputation: 15
Thumbs down Tryed to hack your own server lately?


I did a small check of my server, and didnt like what I found!

The one thing that REALLY stands out is the version number. But I'd like to see the hole line go. So here are my Q's

1 How can I hide the server info!
2 Besides the browser side effects (I assume). Are there more to think of?

  • HTTP/1.1 400 Bad Request
    Date: Sat, 15 Jan 2005 17:11:16 GMT
    Server: Apache/1.3.26 (Unix) Debian GNU/Linux PHP/4.1.2
    Connection: close
    Content-Type: text/html; charset=iso-8859-1

    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <HTML><HEAD>
    <TITLE>400 Bad Request</TITLE>
    </HEAD><BODY>
    <H1>Bad Request</H1>
    Your browser sent a request that this server could not understand.<P>
    The request line contained invalid characters following the protocol string.<P>
    <P>
    <HR>
    <ADDRESS>Apache/1.3.26 Server at example.com Port 80</ADDRESS>
    </BODY></HTML>

Tnx for any help, guys!
 
Old 01-15-2005, 12:16 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

In your httpd.conf file:

#--------------------------------------------------------------------#
# ServerTokens This directive configures what you return as the
# Server HTTP response Header. The default is 'Full' which sends
# information about the OS-Type and compiled in modules. Set to one
# of: Full | OS | Minor | Minimal | Major | Prod where Full conveys
# the most information, and Prod the least.

#ServerTokens Full
ServerTokens Prod

Hope this helps.
 
Old 01-15-2005, 12:58 PM   #3
Kanon
Member
 
Registered: Sep 2004
Location: Norge
Distribution: Debian
Posts: 116

Original Poster
Rep: Reputation: 15
Arg... I dont have that in my file.

I'll cut n paste.

Thanks a million! On to the server hack test...


Found this that explains my Q in the first place:

ServerTokens and hack attempt
 
Old 01-15-2005, 01:03 PM   #4
Kanon
Member
 
Registered: Sep 2004
Location: Norge
Distribution: Debian
Posts: 116

Original Poster
Rep: Reputation: 15
That worked like a charm! :-)
 
Old 01-16-2005, 02:00 PM   #5
Kanon
Member
 
Registered: Sep 2004
Location: Norge
Distribution: Debian
Posts: 116

Original Poster
Rep: Reputation: 15
Re: Tryed to hack your own server lately?

Quote:
Originally posted by Kanon
<ADDRESS>Apache/1.3.26 Server at example.com Port 80</ADDRESS>
Eh.. How about the last line here? I didnt check to see if ServerToken tok care of that too.
 
Old 01-17-2005, 04:41 AM   #6
lowpro2k3
Member
 
Registered: Oct 2003
Location: Canada
Distribution: Slackware
Posts: 340

Rep: Reputation: 30
I was just thinking about that today actually... I read an article a while ago (or maybe a post) saying you can change the string at compile time in one of the header files (*.h) in the src/ directory. I cant remember which one, you could try grepping for it. I think it would be funny to change the name to a different Apache version to throw off would-be hackers quite a bit.
 
Old 01-17-2005, 10:06 AM   #7
Kanon
Member
 
Registered: Sep 2004
Location: Norge
Distribution: Debian
Posts: 116

Original Poster
Rep: Reputation: 15
My thoughts exactly. Or maybe have it report IIS! lol

Now, the only problem is; what is compiling? lol
I guess I have to postpone this untill I got me some more knowledge. And it looks like compiling is heading up on my list.

Thanks anyhow
 
Old 01-17-2005, 09:08 PM   #8
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
its not that hard, theres plenty of sites that give you step by step instructions on the compile process, and usually how to do it for each individual projects
 
Old 01-18-2005, 04:13 AM   #9
Kanon
Member
 
Registered: Sep 2004
Location: Norge
Distribution: Debian
Posts: 116

Original Poster
Rep: Reputation: 15
Looking at it right now. Found the code. But Im no programer.

Are there anybody, please!, that would like to have a look at the core.c
Search for Apache/2 (Yes, Apache ver 2.52)

What is needed to change the servertoken to report, say "IIS" or "Donald Trump" for that mater.
 
Old 01-18-2005, 04:33 AM   #10
dominant
Member
 
Registered: Jan 2004
Posts: 409

Rep: Reputation: 30
This is similar to

ServerSignature Off

or not?
 
Old 01-18-2005, 04:45 AM   #11
Kanon
Member
 
Registered: Sep 2004
Location: Norge
Distribution: Debian
Posts: 116

Original Poster
Rep: Reputation: 15
Well, if you look at the first post you see that Apache gives it self away both at the top and the bottom. The top one is ok. But the bottom one will not change with the ServerToken.

BTW Just tested "Off" didnt work on 1.3.

Ah...crap. Didnt read your post fully. I'll check the ServerSignature

Last edited by Kanon; 01-18-2005 at 04:47 AM.
 
Old 01-18-2005, 04:50 AM   #12
Kanon
Member
 
Registered: Sep 2004
Location: Norge
Distribution: Debian
Posts: 116

Original Poster
Rep: Reputation: 15
YES!!! Thas it!

So solution if you want to "hide" your Apache server for hacker wannabe change:

ServerToken = Prod
ServerSignature = Off

Thanks for the help druuna and dominant! :-)
 
  


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
tryed to go from mozilla 1.06 to 1.07 cooldudejz Ubuntu 3 09-25-2005 01:37 AM
HELP I've tryed everything xaos5 Linux - Networking 1 03-13-2005 04:51 AM
sound plz help iv tryed everything saneisjustaword *BSD 9 11-10-2004 09:56 PM
Apache source code hack - Server response headers 2.0.49 fireman949 Linux - Software 2 05-24-2004 10:31 AM
Has anyone tryed Mandrake 8.1? Steve_Taylor Linux - Distributions 40 02-27-2002 12:51 AM

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

All times are GMT -5. The time now is 05:17 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