top of page

Installing Kasm Workspaces and Setting Up Kali Linux for Penetration Testing

Updated: Sep 15, 2022

In this post, I demonstrate how to install Kasm Workspaces on a Linux Machine, and then set up a Kali Linux Hacking Lab for pen testing.


Kasm is a container-streaming platform that enables you to stream docker apps from your web browser! That's right! Imagine isolated docker containers, but from the comfort of your browser - That's Kasm!



Installing Kasm


The community edition of Kasm Workspaces is available for free and can be installed on a local Linux Machine. I prefer to install it on a cloud instance because it makes it easier to access my docker apps from anywhere on the Internet, and also since the apps are not running on my own Computer, I do not have to worry about any malicious activity of zero-day attacks.

But if you want to install it on your local Linux machine, go for it! It doesn't make Kasm less capable in any aspect.



Step1. Create a swap partition of 1GiB


sudo dd if=/dev/zero bs=1M count=1024 of=/mnt/1GiB.swap
sudo chmod 600 /mnt/1GiB.swap
sudo mkswap /mnt/1GiB.swap
sudo swapon /mnt/1GiB.swap

Step2. Make the swap partition available on boot

echo '/mnt/1GiB.swap swap swap defaults 0 0' | sudo tee -a /etc/fstab

Step3. Download the latest version of the Kasm Workspaces community edition

curl -O https://kasm-static-content.s3.amazonaws.com/kasm_release_1.11.0.18142e.tar.gz

Step4. Extract the file

tar -xf kasm_release*.tar.gz

Step5. Run the installation script

sudo bash kasm_release/install.sh

This will install Kasm Workspaces on your machine and download all the pre-built images. It takes around 10 minutes for this process to complete.


Once installed, you will be given the randomly generated login credentials to your Kasm Workspaces, note them down.


Now, access your Kasm Workspaces UI by going to https://<YOUR_IP>




Log in with your credentials, and you will be taken to your dashboard. Here you can see all the pre-built apps. You can spawn up a container of any of these apps instantly by clicking on "Launch Session".





Setting Up Kali Linux


Kali Linux is one of the pre-built apps that comes with Kasm but as you can see from the screenshot above, it is disabled (greyed out) by default.


- To enable it, go to the "Admin" tab, and then "Images".

- Search for Kali Linux and click "Edit"

- Check the box that says "Enable"


- Then, scroll down and paste the following JSON value in the "Docker Run Config Override" field. This JSON enables you to use OpenVPN from your Kali Linux container.

{"user":"root","cap_add":["NET_ADMIN"],"devices":["dev/net/tun","/dev/net/tun"],"privileged":true}

- Finally, click Save.



It takes some time for Kasm to download the image of Kali Linux and set it up for you, so just be patient. In my case, it took around 5 minutes before Kali Linux was usable.


Once Kali Linux is available, click on it and select "Launch Session". This will spawn up an isolated Kali Linux container in your browser!



Now, you can use Kali Linux right from your browser! Once you are done with it, you can simply destroy your session which will kill the container completely leaving no tracks!




Installing OpenVPN


If you're intending to use this Kali Linux container for penetration testing, you will most probably also need OpenVPN so that you can connect to the target's network.

OpenVPN is installed by default, but you still have to upgrade it to the latest version to be able to use it without any issues.


- First, update your repos

sudo apt-get update

- Next, upgrade OpenVPN to the latest version

sudo apt install openvpn

- And that's it! You can now use OpenVPN without any issues!

sudo openvpn myfile.ovpn


So, that'll be all for this post. If you want to watch the full video where I demonstrate how to install Kasm, setup Kali Linux, and also hack a TryHackMe room called "Internal" from the Kali Linux container, check it out on YouTube: https://youtu.be/ir3QhZp8864


5 Kommentare


Aman Ved
Aman Ved
26. Mai

Nippon India Small Cap Fund is truly a great option for long-term investors! I like how it focuses on growing small companies that can turn into big players. Yes, it has some ups and downs, but the returns over time can be very rewarding if you stay invested patiently. A good choice if you want to build wealth slowly and steadily. I personally track my investments through MySIPonline—it makes the process super easy!

Gefällt mir

Odin Valhalla Rising: A Beginner's Guide to Success

Welcome to the world of Odin Valhalla Rising! Whether you're a fresh new player or someone who's dabbled a bit and realized there’s much more underneath the surface, this guide is designed to help you navigate the game effectively. Here Odin Valhalla Rising Diamonds, you'll find essential tips to start strong, progress wisely, and avoid common pitfalls that can hinder your journey. Additionally, as you explore the game and develop your character, don't forget to consider options to buy Valhalla Rising Diamonds, which can significantly enhance your experience and streamline your progress.

Focus on Your Main Quests

First things first: focus only on your main quests. While it might seem tempting to wander off and grind…


Gefällt mir

denweremadu
03. Jan.

Hi TechRaj, Having the below error running in my windows CLI:


Installing All Services

Docker network kasm_default_network already exists. Will not create

Initializing Database

Setting Seed file as /opt/kasm/1.11.0/conf/database/seed_data/default_properties.yaml

yaml: unmarshal errors:

line 26: mapping key "restart" already defined at line 6

line 43: mapping key "restart" already defined at line 38

kasm_db_1.11.0

yaml: unmarshal errors:

line 26: mapping key "restart" already defined at line 6

line 43: mapping key "restart" already defined at line 38


How do i resolve this?

Gefällt mir

Joshua Mohammed
Joshua Mohammed
14. Nov. 2022

hello i'm trying to do this but i'm having issues i don't know if u can help

Gefällt mir
Ashvani Kumar
Ashvani Kumar
17. Apr. 2023
Antwort an

Yeah, sure!


Gefällt mir

© 2019 Tech Raj. Designed by Teja Swaroop

  • YouTube
  • Facebook Page
  • Twitter
bottom of page