Page 1 of 1

Custom 401: Unauthorized page for Nagios

Posted: Mon Jul 18, 2016 11:09 am
by toolfan2k4
Hello Everyone,

I hired a "white-hat" hacker to test my install of Nagios. I have already set up HTTPS and disabled HTTP. Unfortunately he was able to breach the network because he received the Nagios servers local IP address when he cancelled the login page for Nagios. The IP then came in handy for masquerading as our Nagios server.

In an effort to prevent this attack we want to change the error received when cancelling the authentication page. I need to make this not show the Nagios server's internal IP. My Nagios server is running on Ubuntu 14.04 since this is likely relevant.

I checked Apache under the assumption that this would be an HTML page pre-configured as part of it. If the page is there I could not locate it.

Re: Custom 401: Unauthorized page for Nagios

Posted: Mon Jul 18, 2016 11:19 am
by mcapra
Few ways to do this, but it all boils down to properly configuring your Apache server. The easiest way to fix this is through the following directives:

Code: Select all

ServerSignature Off
ServerTokens Prod
Try adding those to your /etc/apache/apache2.conf file. Then restart the apache service:

Code: Select all

service apache2 restart
It's worth mentioning these changes on their own don't 100% prevent someone from sniffing the IP address of a given server via Apache. It just solves the problem you mentioned in your post.

Re: Custom 401: Unauthorized page for Nagios

Posted: Mon Jul 18, 2016 1:51 pm
by toolfan2k4
That did the trick! :D

Thanks for the sniffing tip! I will look into that too!

Re: Custom 401: Unauthorized page for Nagios

Posted: Mon Jul 18, 2016 2:39 pm
by mcapra
Happy to help! Is it alright if we lock this thread and mark the issue as resolved?

Re: Custom 401: Unauthorized page for Nagios

Posted: Mon Jul 18, 2016 2:56 pm
by toolfan2k4
Yes please! Issue is resolved.