LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 05-22-2016, 05:06 AM   #1
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Rep: Reputation: 11
Post Change Apache and Fingerprint.


Hello.
I want to install Apache on CentOS but I want change the version of it and hide it from scanners. For example, Nmap detect my Apache as Nginx. Can you show me the correct file in source code of Apache for do it?

Tnx.
 
Old 05-22-2016, 07:05 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,307
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
It would probably be the part that sets ServerTokens

But changing that won't hide it from scanners. What are you trying to solve?
 
Old 05-23-2016, 01:24 AM   #3
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Original Poster
Rep: Reputation: 11
How can I change my Apache to Nginx when scanner scan it?
 
Old 05-23-2016, 01:58 AM   #4
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
You can only mask the apache version by setting...

Code:
ServerTokens Prod
... Which will make it report only as "Apache".

To change it to something else like Nginix you have two main choices as far as I know...

1. Modify the source code and recompile (not actually difficult).
2. Use ModSecurity which has the ability to replace the ident string, within some strict length constraints.

Use of ModSecurity is very advisable anyway, for an internet facing server, but you will need to learn how to configure it - it is not plug-n-play.
 
Old 05-23-2016, 01:58 AM   #5
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,307
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Install the SRPM for the package and then modify the included source, using the above clue as to where to look. Then rebuild an RPM from the spec file.


Edit: Or astrogeek's suggestion of mod_security would be easier. SecServerSignature is probably the setting you want.

Last edited by Turbocapitalist; 05-23-2016 at 02:02 AM.
 
Old 05-23-2016, 02:27 AM   #6
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,307
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
If mod_security is not enough, then you might need to modify more headers. That can be done with mod_headers
 
Old 05-23-2016, 02:36 AM   #7
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Original Poster
Rep: Reputation: 11
Quote:
Originally Posted by astrogeek View Post
You can only mask the apache version by setting...

Code:
ServerTokens Prod
... Which will make it report only as "Apache".

To change it to something else like Nginix you have two main choices as far as I know...

1. Modify the source code and recompile (not actually difficult).
2. Use ModSecurity which has the ability to replace the ident string, within some strict length constraints.

Use of ModSecurity is very advisable anyway, for an internet facing server, but you will need to learn how to configure it - it is not plug-n-play.
Which file in source code must be changed?
 
Old 05-23-2016, 02:46 AM   #8
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
The one which defines the identity string?

I do not know what the exact filename is, but should not be difficult to find.

But from my own experience, ModSecurity is a better option if you are looking for better security anyway.

Last edited by astrogeek; 05-23-2016 at 03:11 AM.
 
  


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
fingerprint match against collection of previos fingerprint mukesh.methaniya Linux - Software 1 04-18-2023 05:51 PM
fingerprint-gui "Could not open fingerprint device" exactiv Linux - Security 4 12-15-2015 04:50 PM
How to Change Apache Location gemmajid Linux - Newbie 4 06-05-2012 12:46 AM
how to change Charset in apache 2.0.63 rbala14 Linux - Software 2 11-11-2009 10:21 AM
apache program writes files in the apache group, how can I change? muskiediver Linux - Security 5 01-17-2007 12:27 PM

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

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