Class 9 Lab 1 ‐ Personal HTTP Server - Justin-Boyd/Ethical-Hacking-Class GitHub Wiki

Task 1: Basic Apache Configuration

Step 1

  • Start your Kali machine.

Step 2

  • Start the Apache service and verify that it is active.

Step 3

  • Change the Apache port configuration file to listen on port 9191. Now restart the Apache service.
  1. Open Terminal
  2. service apache2 start
  3. service apache2 status
  4. Q to quit
  5. nano /etc/apache2/ports.conf
  6. Find Listen 80 and change 80 to 9191
  7. CTRL + X and then Y
  8. service apache2 restart

Step 4

  • Browse to the website (127.0.0.1:9191) and verify that it is active.

Task 2: Enable HTTP Headers

Step 1

  • Via the browser inspector, locate the content type header and examine it.
  1. Right click and selected inspect element
  2. Go to the Network tab
  3. Refresh page
  4. Click on the first GET request
  5. Check the response headers to detect the “Content-Type” attribute that describes the content of the page.

Step 2

  • In the terminal, enable HTTP headers for the HTTP service
  1. a2enmod headers
  2. systemctl restart apache2

Task 3: Create a Custom Header

Step 1

  • Open the Apache security.conf file, and add a header at the bottom using: Header set Custom-Header: “Hello”. Then save and inspect the changes.
  1. nano /etc/apache2/conf-available/security.conf
  2. Scroll to the bottom and add: Header set Custom-Header: “Hello”
  3. CTRL + X and then Y
  4. service apache2 restart

Step 2

  • Make a request to the localhost to examine the change in the header.
  1. Refresh the webpage
  2. Inspect the first GET request
  3. Review the new field "Custom-Header"