How to install Kali Linux on AWS EC2 Instance

If you want your Penetration Testing Linux operating system such as Kali Linux with you always, then install it on Amazon Cloud Infrastructure AWS EC2 (Elastic computing) Instance using the steps given here. 

Kali Linux is a popular Debian-based Linux operating system designed to use for security and penetration testings of IT systems. Out of the box, this Linux distribution offers numerous tools for carrying out a wide variety to test networks or systems against hacking or finding out loopholes.

To make use of this distro friendly, Kali Linux is based on Debian and uses the popular Gnome Linux desktop environment as a desktop interface. It is an open-source project, operated and financed by Offensive Security, and is aimed primarily at professional users but can also be used by private individuals.

Kali Linux installation on Amazon AWS Ec2

Well, the installation of any Linux distro on AWS Ec2 available using Amazon Machine Image is super easy. With the help of a few clicks, we can deploy and start using Kali Linux. Follow the below-given commands…

1. Log in to Amazon Management Console

If you are new to AWS cloud then first create an account with this cloud computing service provider. The service is also available with a 1-year free trial. Hence the beginners can go for that to experience the service without paying.

2. Access Ec2 Dashboard

Once you are at Management Console, click on the Service Menu and select Ec2 to access the Dashboard dedicated to manager instances, storage, and services.

3. Launch a New Instance for Kali Linux

From the Ec2 Dashboard, you will find the Instances option given on the left side, select that. After that click on the “Launch Instance” button.

Launch Instances

4. Search for Kali Linux in AWS Market Place

Once you are at the “Choose an Amazon Machine Image (AMI)” page, select the AWS Marketplace tab given on the left side. After that, click on the Search box, type- Kali, and then hit the “Enter” key.

Choose Kali Linux Amazon Machine Image

5. Select Kali Linux Image

You will see the pre-built Kali Linux Image offered by Offensive Security at the first spot in the search results. Hit the “Select” button.

Search for Kali Linux on Amazon Market Place

6. Choose an Instance Type

Now, we have to configure the Instance or Virtual Hardware for our Kali Linux. You can select the free Instance type or the one as per the work you are planning to perform on this penetration testing Linux. After that click on the “Review and Launch” button.

Choose Ec2 Instance Type

7. Review Instance Launch

Before launching the Kali on Ec2, you can Edit various settings such as by default the storage space will be 12 GB, you can increase that if you want. Otherwise, let the default settings as it is and simply click on the “Launch” button.

Increase Storage of Amazon Instance

8. Create a new key pair

Well, the users can create a new key pair, if there is no existing one. Just from the drop-down select “Create a new key pair” option and give some name to your Key. Download and save the same somewhere safe, becuase we need it to connect out Kali Linux Ec2 Instance remotely using SSH.

create a New Pair for SSH connection

9. Connect Kali AWS Ec2 Linux using SSH

On your local system, open the Command prompt or terminal and use the downloaded Keypair. You can also use any SSH client for this.

If you are using Linux as your local system, then change the permission of the key using the command-  chmod 400 MyKali.pem

After that run:

ssh -i "path-to-your-key-pair.pem" kali@public-ip-address

Note: Use username- Kali. Also, replace the bold items in the above command with appropriate values.

Copy Public Ip address of Ec2 Instance
Kali Linux Ec2 Instance connect via SSH

10. Install Kali Linux Forensics Tools

sudo apt install kali-tools-forensics -y

11. Setting up a Remote GUI using VNC

Update your instance of Kali

sudo apt update -y

Install TightVNCServer

sudo apt install xfce4 xfce4-goodies tightvncserver -y

Install a Kali Desktop

sudo apt install gnome-core kali-defaults kali-root-login desktop-base -y

Select lightdm or xxxx when prompted

Start the TightVNCServer

tightvncserver -geometry 1024×768

Check to see if port 5901 is open

netstat -tulpn

12. Connecting to Kali via VNC from your Computer

Download and install VNC Viewer

https://www.realvnc.com/en/connect/download/viewer/

Open PowerShell, a Command Prompt, or Terminal Session and type the following

ssh -L 5901:localhost:5901 -N -f kali@awsipaddress -i keypairname.pem

Launch VNC

For VNC Server: localhost:5901

For Name: Whatever you chose

The end result is Kali in AWS with a GUI