Version Disclosure
Last updated
Was this helpful?
Last updated
Was this helpful?
Version disclosure is when the application discloses the version of the server/platform etc., Then the attacker will know the version and narrow down the attacks with known vulnerabilities of the version.
To identify the webserver version, by simply looking server field in the HTTP response header of the website.
By this, we can manually check the request and response by any browser.
Right-click on the particular page and go to inspect element.
Then, go to the Network tab and click on any network available on the webpage.
Go to the headers tab, we can see the server/platform version is disclosed in the response.
In the method, we can use the tool called netcat. netcat is a simple Unix utility which reads and writes data across network connections.
In the Server field, we can understand that the server is Apache, version 1.3.3. By the same way, we can see all the server headers in the website.
For PHP, we can use the function called header_remove()
. This function is available from PHP 5.3.0.(we have to implement in each .php file)
In web.config file, include the following code to remove server and ASP.NET version details.
Do the following to remove the Server version details:
Go to IIS Manager and click on the site.
Double click on “URL Rewrite” (it should be installed).
Click View Server Variable.
Add "RESPONSE_Server"(This variable will allows URLRewrite to access to Response headers).
Click "Add Rule(s)…" on the right hand side and then select Outbound Rules > Blank rule and click Ok.
Create the rule by using the following settings:
7. Click “Apply” on the right side.
To remove the HTTP response header, go to nginx/conf and add the code in nginx.conf under server section then restart the server.
For Apache, we use unset
argument for removing the HTTP response header. The Header directive could be used in server config httpd.conf
, virtual host, or site specific .htaccess
For Node.js, we use removeHeader()
function for removing HTTP response header.We have to change in config.js file. This function was added in v0.4.0.
For Express.js, we use removeHeader()
function for removing HTTP response header.
Go to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters
Create a registry "DisableServerHeader" and add parameter with DWORD with the value of 2.
After the registry change, reboot the server to let the chance go into effect.