{"id":948,"date":"2012-08-03T09:49:44","date_gmt":"2012-08-03T01:49:44","guid":{"rendered":"http:\/\/rmohan.com\/?p=948"},"modified":"2012-08-03T09:49:44","modified_gmt":"2012-08-03T01:49:44","slug":"hide-apache-info","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=948","title":{"rendered":"Hide Apache Info"},"content":{"rendered":"<p>One of the things which gives a potential attacker some help is them knowing which versions of software you use. This can be very easy to find out, particularly if you have never taken steps to secure this information.<\/p>\n<p>For example: I would like to know what software apache.org are using\/have used so I look at netcraft (for example) http:\/\/toolbar.netcraft.com\/site_report?url=http:\/\/www.apache.org<\/p>\n<p>&nbsp;<\/p>\n<p>192.87.106.226 Linux <strong>Apache\/2.2.3 Unix mod_ssl\/2.2.3 OpenSSL\/0.9.7g<\/strong> 12-Apr-2007<\/p>\n<p>I now know that I should look for exploits relating to linux, apache v2.2.3, mod_ssl 2.2.3 and OpenSSL0.9.7g.<\/p>\n<p>By hiding this information you can either report simply \u201cunknown\u201d or just \u201capache\u201d and no other info. This doesn\u2019t directly make your box more secure, what it does do is start to make the task more difficult for a would-be attacker and for such a small amount of effort it really does seem silly not to do it. So how?<\/p>\n<p>The first thing is to set the ServerTokens directive. I am using a RH linux box so if you know your OS differs, find the corresponding location of your httpd.conf:<\/p>\n<blockquote><p>vi or <strong>pico \/etc\/httpd\/conf\/httpd.conf<\/strong><\/p><\/blockquote>\n<p>Find the line(s) containing ServerTokens and ServerSignature<\/p>\n<p>ServerTokens has the following options (I used Prod):<\/p>\n<p>ProductOnly \u00a0\u00a0\u00a0 Server: Apache<br \/>\nMajor \u00a0\u00a0\u00a0 Server: Apache\/2<br \/>\nMinor \u00a0\u00a0\u00a0 Server: Apache\/2.2<br \/>\nMinimal \u00a0\u00a0\u00a0 Server: Apache\/2.2.3<br \/>\nOS \u00a0\u00a0\u00a0 Server: Apache\/2.2.3 (RedHat)<br \/>\nFull (or not specified) default \u00a0\u00a0\u00a0 Server: Apache\/2.2.34 (RedHat) mod_ssl\/2.2.3 OpenSSL\/0.9.7g<br \/>\nThe syntax is as follows:<\/p>\n<blockquote><p><strong>ServerTokens ProductOnly<br \/>\nServerSignature Off<\/strong><\/p><\/blockquote>\n<p>Close the config file and restart apache (service apache restart OR <strong>\/etc\/init.d\/httpd restart<\/strong>)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the things which gives a potential attacker some help is them knowing which versions of software you use. This can be very easy to find out, particularly if you have never taken steps to secure this information.<\/p>\n<p>For example: I would like to know what software apache.org are using\/have used so I look [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/948"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=948"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/948\/revisions"}],"predecessor-version":[{"id":949,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/948\/revisions\/949"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=948"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=948"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=948"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}