A focus on learning…

4 minutes

The holidays are a great time to focus on your education to further your career aspirations and re-energize you in your work. This holiday I decided to focus on diving in more deeply into AWS. In my daily job, I rarely get to put hands on the keyboard and dig into projects. My role is more advisory than ‘doing the thing’. However, digging into the details is something I love to do and have used these holidays on a couple of small projects. 

Kali: Many of you are likely familiar with Kali Linux. I am not going to get too deep into its purpose. It is a great operating system that comes loaded with many of the tools security professionals depend upon. So for this first project I had two goals. 1/ Create an instance of Kali in AWS that I could login to from any computer. 2/ Add Kali to my MacBook Air (M1 processor) as a virtualized instance, not emulated.

Docker: I know of Docker… I understand the concepts of Docker… I have not used Docker. I really want to learn Kubernetes, but step 1 is Docker. So, I 1/ Installed Docker in EC2 (on Ubuntu) 2/ Created my own Image 3/Pushed it to a repository 4/Created a second EC2 Instance 5/ Pulled my created image and installed it in the new EC2 Instance.

Kali Linux:

1/ Kali in AWS: First we need to get Kali installed in EC2. It is a fairly straight forward process. I will illustrate this with the screenshots below:

I will not pretend that I figured this all out on my own. I followed some really great instructions. My struggle was some of the commands I have listed below.

A couple of commands that you need to master to make this work:

1/ To SSH into your Kali instance you need the following: 

sudo ssh -i ‘/Path-to-your-key-on-your-computer/yourkey.pem’ kali@ec2-XXXXXX.compute-1.amazonaws.com OR just navigate to the directory on your local computer where your key is stored and do: ssh -i keyname.pem kali@INSERT-EC2-Address

2/ Enter this in your Mac terminal. This is to tunnel RDP over SSH: ssh -L 3390:127.0.0.1:3390 -i /Path-to-your-key-on-your-computer/yourkey.pem kali@EC2IPaddress Here are some good instructions. After you successfully run this command you launch Microsoft Remote Desktop and connect to 127.0.0.1:3390 . That’s it!

Proof it worked! 

2/ Kali on a M1 Mac…I followed some great instructions here.  These instructions also provided some help. Trust me when I tell you that my install didn’t go smoothly. The first instructions I went through instructed me to use the graphic installer, which does not work. Make sure to follow the serial connection instructions and it should go smoothly. However, my first time installing something did go wrong and I couldn’t gain access to the GUI. I troubleshot it for an hour before just blowing away the VM and starting over, which was much quicker and it worked! Pro tip… make sure you install the Spice Tools.

Bonus content: You can also add Ubuntu and Windows 11 to a Mac M1 architecture using UTM: 1/ UTM Instructions 2/ Helpful troubleshooting for Windows on UTM. 3/Ubuntu for ARM download (note: you will need to install the desktop after the install. (sudo apt install ubuntu-desktop)

Docker:

These instructions aren’t meant to be complete, but I have linked to people that have done far better work than I am capable of.

1/ Installed Docker in EC2 (on Ubuntu): Instructions here.

2/ Create my own Image: Instructions are here, but I decided to create my own website to test it.

3/Push the image it to a repository (Yes I know I could have used ECR, but at that moment Docker Hub was easier)

4/Create a second EC2 Instance 

5/ Pull my created image from Docker Hub and install it in the new EC2 Instance

Note the new IP address. This is running on the second Docker EC2 instance.

Well, that about does it! Get out there and learn something new! I hope this gives you guidance or inspiration for your own learning.