Notes

Web Server

Web servers deliver documents, applications, and data over HTTP/HTTPS. They are common targets during assessments and are also useful for transferring files or hosting phishing pages. Common Linux web servers: Apache, Nginx, Lighttpd, and Caddy.

Apache Web Server

Apache is widely used and supports extensive configuration and modules.

Install Apache

$ sudo apt install apache2 -y

Apache Configuration

Global settings live in /etc/apache2/apache2.conf. Example directory configuration:

<Directory /var/www/html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

Directory-level overrides can be set with .htaccess files. Modules like mod_rewrite, mod_security, and mod_ssl add functionality and security.

Python Web Server

Python includes a simple HTTP server for quick file transfers.

Install Python and Start Server

$ sudo apt install python3 -y
$ python3 -m http.server

Serve Another Directory

$ python3 -m http.server --directory /home/cry0l1t3/target_files

Use a Different Port

$ python3 -m http.server 443