top of page
Search
  • Writer's pictureotw

Linux Basics for Hackers, Part 13: Running Kali Linux in Windows (WSL)

Updated: Dec 28, 2022

Welcome back my aspiring cyber warriors!


As most of you know, I am the author of the best-selling book, Linux Basics for Hackers from No Starch Press. I was inspired to write it from experience teaching hacking to US military and intelligence personnel. Over and over again, I found very talented students who were stymied in their pursuit of penetration testing/exploitation/hacking careers by their unfamiliarity with Linux. Many very good people have spent their careers in Windows or MacOS and have never used the Linux command line. Linux Basics for Hackers was designed to fill that gap in quick, accessible and un-intimidating way with examples from hacking and cybersecurity.


The superiority and versatility of Linux is not limited to hacking and cybersecurity. About 70% of the Internet servers and cloud servers run Linux. To advance in your career in IT security, Linux is almost an essential.


Now, Microsoft--of all companies--has acknowledged the advantages of Linux and has developed a way to use your favorite Linux distribution inside Windows. They call it WSL or Windows Subsystem for Linux. For some of you, this may be the easiest way to become familiar with and use Linux and start your career in cybersecurity!


In this tutorial, we will install our favorite Linux distribution, Kali Linux, inside Windows 10 and set it up for pentesting and other administrative tasks.


Step #1: Enable WSL


The first step is to enable WSL on your Windows 10 system. Simply open Powershell and enter:


PS> Enable_windowsOptionalFeature -Online - FeatureName Microsoft-Subsystem-Linux


As you can see above, Powershell will then prompt you whether you want to restart your system to enable WSL. Hit ENTER


Step #2: Install Kali Linux


Now that you have enabled this feature in Windows and restarted your system, you will need to install Kali. Go to the Windows Application store


There, you will see icons for many major Linux distributions. Click on Kali Linux.


This opens up a screen like that below.

Click on the Blue Get button.


Kali will begin to download. This is stripped down, essentials-only version of Kali so the image is much smaller than what you may be accustomed to and the download is much quicker.

Once the download is complete, you will then be prompted for a username and password.

Step #3: Install Kali Tools


The minimal version you just installed has little-to-no tools (it depends on your definition of the word "tool"). At this point, we need to download all the Kali tools to our Linux. To do so, enter the following command to update, upgrade and install all the tools from the Kali repository.


$ sudo apt update && sudo apt upgrade -y && sudo apt install kali-linux-everything -y



You will need to enter your username and password to proceed.



This can take quite awhile, so take a break and get your favorite beverage.


Step #4: Check the Networking Settings


In this step, we will run ifconfig to test our network setting


$ sudo ifconfig

Note a few things. First, your first Ethernet connection is designated eth1. Also, your Wi-Fi adapter is designated wifi0. This may be different than you are accustomed to running Kali natively or in VirtualBox.


Now, open a command prompt on your Windows host system and run ipconfig.


> ipconfig




Note that the IP addresses of each of the interfaces is the same as the Linux system. Windows and Linux are sharing these interfaces. This is further confirmed by noting the MAC addresses of these interfaces. They are the same on both operating systems. This is notably different than your Oracle or VMware VM's, where the interfaces have different IP's and MAC addresses.


Step #5: Enable ping


Unfortunately, several functions on this virtualized Linux are not enabled by default. One of these is ping, the Linux utility for testing whether a host is up. When we try to ping another system on our local network or google.com, both return the cryptic message,

ping:socket: Operation not permitted



To enable ping on our newly install Kali Linux system, enter the following command;


sudo setcap cap_net_raw+p /bin/ping



After do so, you can see in the screenshot above, that we can now ping google.com.


We are now ready to use our trusted Kali Linux within Windows 10 for our hacking/pentesting and cybersecurity activities!



Summary


Linux is the operating system of choice for hackers, web site hosting, cloud providers and many more IT security professionals. It is essential that you gain a thorough understanding of at least it must fundamental capabilities and utilities. For many of you, Microsoft's new WSL might be just the thing to get you started using Linux. For the seasoned Linux user, WSL makes it quick and easy to drop into Kali Linux from your Windows 10 system and test your tools and scripts. I still recommend a native install for professional penetration testing, but WSL can provide an easy to use test bed between jobs.


Now that you have WSL enabled and Kali installed, check out my series here on Linux Basics for Hackers or my book, Linux Basics for Hackers to learn how to use Linux in a cybersecurity environment.




10,270 views3 comments

Recent Posts

See All

3 Comments


astriddavina54
astriddavina54
Jan 03, 2023

I’m excited to write about Henry Hacker, he is a great and brilliant hacker who penetrated my spouse’s phone without a physical installation app. And I was able to access my spouse’s phone, SMS, Whatsapp, Instagram, Facebook, Wechat, Snapchat, Call Logs, Kik, Twitter and all social media. The most amazing thing there is that he restores all phone deleted text messages. And I also have access to everything including the phone gallery without touching the phone.I can see the whole secret of my spouse. Contact him for any hacking service. He is also a genius in repairing Credit Score, increasing school grade, Clear Criminal Record etc. His service is fast. Contact:, Henryclarkethicalhacker@gmail.com and on whatsapp him on +1262-236-7526...


Like

Hire a professional cell Phone Hacker who has the skills that can grant you remotely access to your spouse cell phone and grant access to cheating spouse cell phone information on their cell phone. He can also use he skills to spy on other people’s cell phones device. It is also known as a cell phone spy who are capable to provide you all you require to infiltrate any type of smartphone and iPhone. I was able to got access to partner iPhone, the job was prefect to the extended he didn’t knowing anything about it, was so prefect you can conatct him via kelvinethicalhacker @ gmail. com. reach to him to help spy on your cheating spouse...

Like

You can hire Henryclarkethicalhacker for all your hacking needs which include clearing of criminal and driving records, credit hack fix, college grade changes, cloning phones, spying on anyone, hacking all social media accounts, etc,. Reach him via Henryclarkethicalhacker at gmail com,

Text him,, Whatsapp,,+1 8 1 3 4 2 1 1 3 2 6.


Like
bottom of page