![]() |
To prevent the collection of specific system calls that could offer attackers Windows running Apache servers a backdoor, we can Turn off unwanted HTTP methods on the Apache web server. This increases the security of our web application and prevents unwanted attacks. Prerequisites
Steps to disable HTTP methods in ApacheStep 1: Locating Apache Configuration FileThe main configuration file for Apache is named httpd.conf.this file is located at the following: C:\Apache24\conf\httpd.conf
Step 2: Opening httpd.conf FileUsing text editor like Notepad open the above file. Step 3: Uncomment the lineFirstly, unclomment the following line in the apache configuration file opened #LoadModule access_compat_module modules/mod_access_compat.so Step 4: Add or Modify the <Limit> Directive
TraceEnable off
<Limit TRACE TRACK>
Step 5: Restrict Methods in Specific Directories if neededIf you want to restrict methods in specific directories, you can use the <Directory> directive. For example, to disable methods in the /var/www/html directory: <Directory "C:/Apache24/htdocs"> Step 6: Save the Configuration File
Step 7: Restart Apache Server
httpd -k restart
httpd -k start
Verifying the Changes
Invoke-WebRequest -Uri http://localhost:809 -Method TRACE
Output: ![]() trace method is limited as we kep traceEnable off Invoke-WebRequest -Uri http://localhost:809 -Method DELETE
Output: ![]() detele method is limited Invoke-WebRequest -Uri http://localhost:809 -Method GET
Output: ![]() gt method is accepted ConclusionDisabling HTTP methods in apache enhaces the servers security preventing the acctacks on server. One can easily disable the unwanted methods to a directory or overall server level using the steps provided in this article. |
Reffered: https://www.geeksforgeeks.org
Web Technologies |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 13 |