- Kali http server setup
- How to install Apache, NGINX, or Python 3 on Kali Linux
- Configure Python 3 web server in Kali Linux step by step instructions
- Configure Apache web server in Kali Linux step by step instructions
- Configure NGINX web server in Kali Linux step by step instructions
- Closing Thoughts
- Related Linux Tutorials:
- How to Configure Apache Server in Kali Linux Guide for Beginners
- What is an apache Web Server?
- How to Configure Apache Server in Kali Linux?
- OLD Method to start Restart Apache2 web service
- Use GUIs to Start Restart Apache2 web Server in Linux
- Check the status of Apache server
- Start, Stop and Restart the Apache webserver in Kali Linux
- Another way to start, stop of restart Apache2 service by following commands
- The Default Web Page
Kali http server setup
There are multiple ways to set up an HTTP web server in Kali Linux. Apache, NGINX, and Python are a few of the ways this can be accomplished.
Since you are looking to set up a web server on Kali, it might be safe to assume that you are trying to spoof some other website, or dupe users with some sort of phishing ploy. In that case, all three web server types have their pros and cons, with Python being the quickest one to get up and running.
Whatever the purpose of your web server may be, nefarious or not, you will learn how to install and configure a simple HTTP server using either Apache, NGINX, or Python in this tutorial. Follow through our step by step instructions below to see how it’s done.
In this tutorial you will learn:
- How to install Python 3 on Kali Linux
- How to install Apache and NGINX on Kali Linux
- How to host a web server using Python 3
- How to host a web server using Apache and NGINX
Category | Requirements, Conventions or Software Version Used |
---|---|
System | Kali Linux |
Software | Python 3, Apache, NGINX |
Other | Privileged access to your Linux system as root or via the sudo command. |
Conventions | # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command $ – requires given linux commands to be executed as a regular non-privileged user |
How to install Apache, NGINX, or Python 3 on Kali Linux
The only prerequisite to follow this guide is that you have either Apache, NGINX, or Python 3 installed on your system, depending on which type of web server you want to host. Use the instructions below to install one of the software packages on your Linux system.
You can use the appropriate command below to install Python 3, Apache, or NGINX with your system’s package manager.
To install Python 3 Kali Linux:
To install Apache on Kali Linux:
To install NGINX on Kali Linux:
Configure Python 3 web server in Kali Linux step by step instructions
- To start a web server using Python 3, use the following command. With this syntax, our web server will be running on IP address 127.0.0.1 and port 9000 . You can change this to anything you want, or omit the options entirely to have Python be hosted on the default IP and port.
$ python3 -m http.server --bind 127.0.0.1 9000
$ echo Python 3 on Kali Linux > ~/index.html
Configure Apache web server in Kali Linux step by step instructions
- Once Apache installed, you can use systemd’s systemctl commands to control the service.Enable or disable Apache from starting at system boot:
$ sudo systemctl enable apache2 OR $ sudo systemctl disable apache2
$ sudo systemctl start apache2 OR $ sudo systemctl stop apache2
$ echo Apache on Kali Linux > index.html $ sudo mv index.html /var/www/html
Configure NGINX web server in Kali Linux step by step instructions
- After NGINX is installed, you can use systemd’s systemctl commands to control the service.Enable or disable NGINX from starting at system boot:
$ sudo systemctl enable nginx OR $ sudo systemctl disable nginx
$ sudo systemctl start nginx OR $ sudo systemctl stop nginx
$ echo NGINX on Kali Linux > index.html $ sudo mv index.html /var/www/html
Closing Thoughts
In this tutorial, we saw how to host an HTTP web server using Python 3, Apache, and NGINX on a Kali Linux system. This set of instructions will work for whatever purpose you have, especially to setup a fake website to try and trick users to login to. Python web servers are not as robust as full stack web servers like Apache or NGINX but, they are good for simple purposes and getting a web server up quickly.
Related Linux Tutorials:
How to Configure Apache Server in Kali Linux Guide for Beginners
In the article, I am going to cover how to configure apache server in Kali Linux, webserver apache in Kali Linux. Apache web server is similar methods are used in other Linux distribution. Simple commands can make an expert in using the webserver.
Originally this post is written on Jun 11, 2014, and last updated in April 2021. This article is not related to the cheap web server, web hosting, business web hosting, cloud hosting or any type of dedicated hosting service. This article defines only local webserver on Kali Linux for local Penetration testing.
What is an apache Web Server?
A web server is a type of server, that delivers web pages to the clients as per their request. Every Web server has an IP Address and domain name for identification. Server Administrator can make local webserver setup.
You can make a simple computer to work as a web server, It may be Windows, Linux or mac. You can install any web server software on your basic system. For example Xamp, Wamp etc.
Both of these software has apache web server.
I dont want to go in depth related this topic. So come back on the topic Web server in Kali Linux.
This is time to say thanks to Kali Linux developers, who have installed already Apache webserver in Kali Linux. But by default, apache service is not running.
I will explain in this article about configuration of apache server.
How do you know you web server is running or not? what happened if server is running.
When your server is ready to deliver web pages then you can access through web browser.
Clients access the web pages through a Web browser like Google Chrome, Firefox, Safari, etc.
You need to enter URL or IP address into the address bar of the web browser and the page will be delivered by Web server scripting.
If you enter https://www.cyberpratibha.com/blog in the Address bar it will be served by Web Server.
How to Configure Apache Server in Kali Linux?
In Kali Linux, you don’t need to set up a web server because Kali Linux has a pre-installed apache server. Hacker uses this webserver to deliver a web page containing malicious code to the victim by the help of a local webserver or by doing port forwarding.
We can trap them by using social engineering method for example Phishing. There are others who use the HTTP service in penetration testing.
it manages dedicated web server capacity to deliver pages and have web server load balancing.
OLD Method to start Restart Apache2 web service
Use GUIs to Start Restart Apache2 web Server in Linux
It is the easiest way to start, stop and restart the Apache2 service in GUI mode. Select Applications from the top bar of the Kali screen, next sub-menu bar will be displayed, Select Kali Linux menu, another fly-out display bar will appear, then go on the services menu, again next fly-out menu bar will display, In this bar web service can be start, stop and restart.
Once a selection happened, a command shell will open and the status of service will be displayed. When the Apache server has been started, the default page will be display by typing Attacker’s ip address in the web browser. IceWeasle is default web browser in Kali Linux distribution.
Note: GUI to start, stop, restart apache2 is not support in Kali Linux 2016.2 version.
Check the status of Apache server
Your first step to check the apache server is installed on your machine or not. Use the following command to check installed package apache2
apt list –installed apache2
In the above result, you can see apache2 installed.
Next check the status of apache web server in Kali Linux. Use the following command to do that:
[email protected]:~#service apache2 status ● apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; disabled; vendor preset: Active: inactive (dead) Docs: https://httpd.apache.org/docs/2.4/ [email protected]:~#
Press the “q” to exit command.
You can see in the result apache service status is inactive. If the service is inactive then you can access its web pages.
Open a web browser and type localhost/127.0.0.1 then hit enter.
You will get an error “Unable to connect”.
It means the webserver is not running on your Kali Linux machine. Now your next step to start the apache server.
Start, Stop and Restart the Apache webserver in Kali Linux
It is easy to start, stop and restart Web Server using the simple command in the terminal /etc/init.d/apache2 followed by requested action (stop, start or restart). Following commands are used
#/etc/init.d/apache2 start
Another way to start, stop of restart Apache2 service by following commands
The Default Web Page
Once the Apache service is up and running the default (It works!) page may need to be changed, to do this make the web content that ought to be shown on the page and spare it as index.html in the /var/www/ index. Then again, the current index.html document in this area could be modified what’s more new pages might be included.
MODULE 3:- Basics of Kali Linux