I had the opportunity to participate in a hacking contest, so I wanted to use a Debian-based distribution called Kali Linux, which comes with all the necessary software.
I think there are three easy ways to do it: This time I will use method 3.
- Install directly on your old PC
- Allows booting directly from USB
- Built on cloud (AWS etc.)
How to do it on Digital OceanThere was also an image file (even though it had an image file...), but I couldn't use it because an error occurred every time I uploaded the image, probably due to a connection problem.
Therefore, this time we will use kali linux from the AWS image marketplace.
Use images from EC2 Market Place
Proceed to the EC2 service provision page.

Select Instances.

Select Launch Instances.

Proceed to the AMI selection screen, so type kali linux in the search window and select it.

The amount will be displayed, so select Continue.

The recommendation seems to be t2.medium, so let's use t2.medium for now.

Check the settings and click Launch.

Select your ssh key. If you have created one previously, you can select it from the Select a key pair dropdown.
You will be asked to check the box that says ``I am aware that I cannot enter without the key.'' . .
Click Launch Instance.

Once created, it will appear in your EC2 instance.

It's easy.
After login
After creation, you can log in via ssh to the displayed public IP by specifying the key directly as shown below. The username seems to be kali.
ssh -i selectedKeyName [email protected]
Since I want to install various things, I become a root user using the following command.
sudo -s
RDP (remote desktop protocol) connection
Since I also want to use the GUI, I will make the necessary settings for remote desktop connection.
First update the package list and include the required packages.
apt-get update apt install nvidia-driver nvidia-cuda-toolkit -y apt-get install kali-desktop-xfce xorg xrdp -y apt install xrdp
Not enough capacity...
The following error occurred around the second command. . .
failed to write (No space left on device)

...(´;ω;`) It seems like there isn't enough volume, so I'll increase it.

Increase the capacity and select "Fix".
Now that we have increased the volume, let's restart the instance.

Yeah, it seems to be working without any problems. /dev/xvda1, which was full earlier, now has 26GB of free space.

Kali user password setting
Set a password so that you can log in to the kali user.
sudo passwd kali
Using Microsoft Remote Desktop
On the Mac side, it seems that the xrdp client is not installed by default, so let's get Microsoft Remote Desktop from the App store.
Enter the appropriate connection information. Since we are planning to perform port forwarding from localhost after this, the connection destination can be localhost.

SSH port forwarding
I tried accessing port 3389 (xrdp's default port) directly from my Mac, but the port was probably closed and I couldn't get it in.
Use the following ssh command to perform port forwarding. (From the Mac's perspective, it looks like it tunnels its own port 3389 to the server set up in AWS.)
ssh -i {ssh key file} -p 10022 -L 3389:localhost:3389 [email protected]
After executing the above command, you will be able to log in normally, but I will leave it as is.
I was finally able to connect via RDP...!
Select the Microsoft Remote Desktop profile you set up earlier and connect. A username and password entry field will appear, so enter the password you set.

I was able to log in!

It will take some time...
I would like to play with this kali in the future. fun!


comment