Last updated Mar. 8, 2018
This is the First part of Chapter 1: Installing and Configuring Kali Linux of “Wireless Pentesting and Security eBook“. As shown in the Preface before, in this Chapter we will be covering the following:
- Hardware requirements
- Software requirements
- Installing Kali Linux on a PC
- Installing Kali Linux in VMWare
- Setting up the Wireless card
- Configuring the wireless card
- Setting up Access Point
- Remove Kali Linux
As the installation process of Kali Linux on VMWare slightly differs from Installation on PC, I had split this chapter into two parts.
We will cover all the topics except those in RED , so it won’t become a stress to learn at once.
[YB]This article is an excerpt from my WiFi Penetration testing and Security eBook in which I talk about hacking WiFi enabled devices with rogue access points, war driving, custom captive portals and splash page, multiple access points from a single NIC and much more. Click here to download the sample copy[/YB]
We will be using the following setup during the series.
- One laptop with working internal Wi-Fi card: I will use a laptop to install and run Kali Linux in VMWare as attacker’s machine and host(Windows) as the victim’s machine. Kali Linux should have at least 1 GB RAM of allotted RAM. This is because we will be running a lot of memory-intensive software through out the series.
- One Alfa wireless adapter: For best results we need a USB Wi-Fi card which supports Packet injection and Packet sniffing. We will use Alfa AWUS036NH 2000mW in this series. Which you can purchase on ebay/Amazon which is retailing under $30 at the time of writing. you can purchase it from here
- One access point: We need an access point that WEP, WPA/WPA2 and WPS encryption standards.I will use TP-Link MR3420 3G wireless-N router for illustration of an access point. You can purchase it on ebay which is retailing at around $40 at the time of writing. or you can purchase it on Amazon for $37.
- An internet connection: A stable, fast connection for optimal downloading of software and other experiments.
We will be using the following setup during the series.
- VMWare Workstation: I will use VMWare Workstation 9.0 in this series for running Kali Linux and connecting wireless devices. so that it won’t be any different from a Kali Linux installed on PC with an Alfa wireless adapter connected.You can download the latest version of VMWare from its official website.
- Kali Linux : Kali Linux ISO can be downloaded from the official website’s download page located at https://www.kali.org/downloads/. It is an Open source OS which comes with a variety of pre-installed tools for penetration testing.
- Windows 8 as Host machine: We will need Windows 8 as the victim which will connect to the original Access Point in the series. The host machine’s network card will be dedicated to host(Windows 8) only and Alfa card will be dedicated to Kali Linux(in VMWare) for the Attack purpose only.
NOTE: Even though we are using windows machine to connect to AP, we can do this to any electronic device capable of performing wireless(Wi-Fi related) tasks such as Mobile, Tablet,Wireless printer etc.
Kali Linux Installation: How to Install Kali Linux in VMWare
- Start VMWare Workstation, Go to file menu and click on “New Virtual Machine“.
- Click next. with selected option “Typical(recommended)“.
- Click on Browse… and located your downloaded Kali Linux ISO file on the Hard Drive.then click Next
- Set you virtual machine name(Kali Linux in this case). you may change location for storing your virtual machine on other drive by clicking Browse button.
- Allocate disk size to Kali and click Next. NOTE: 20 GB will be optimal for virtual machine as we will be using mostly pre-installed tools during this series.
- Click Finish and then Power on this Virtual Machine. Now the virtual machine will boot.
- Select/Highlight the option Install and press [ENTER]
- Enter you Hostname (rs in this case)
- Enter password (pass in this case)
- Select disk press [ENTER] then select All files in one partition and press [ENTER].As we are not experimenting or learning about partitioning systems here, we will put all the files in single partition.
- Select Finish partitioning and write changes to disk.
- Select Yes to confirm Write changes to disks and press [ENTER].
- Wait for setup to Install the System
- Setup will ask you for selecting a Network mirror to download latest packages. Select No and then click cancel. As we do not want to waste time updating Kali Linux during setup, we will do it afterwards from the terminal when Kali is installed.
- Install GRUB(GRand Unified Bootloader) to the Master Boot Record. To choose from the options to boot Kali Linux within VMWare after installation.NOTE: If there is no GRUB or any bootloader installed, the Operating System will not boot.
- Setup is now complete. Select Continue and hit [ENTER].
- Now start the Virtual machine “Kali Linux”, and Press [ENTER] to continue boot.
- Press ENTER on Other and Enter the credentials
Password: pass (Entered previously, Step 9), and click on login
Now, we have successfully installed Kali Linux in VMWare Workstation and logged in to the Desktop.
We will now setup Alfa card in Kali Linux
Setting up Wireless Adapter
Setting an Alfa card on Kali Linux is pretty easy as Kali Linux comes with all the drivers required by any Alfa card to enable packet injection and packet sniffing. Being a purpose specific card, Alfa card does not need any configuration in Kali Linux.It is a Plug-and-play device in Kali Linux. However if you try to use Alfa card in windows you’ll have to install drivers from the CD(In the Box).
For Driver compatibility issues: Go here
Please follow the instructions step-by-step to set up your card:
- Plug in your Alfa card into the laptop and go to VMWare. Click on VM Tab on VMWare’s Windows and navigate to Connect (Disconnect from host)Here Host in our Windows in which we are running our Virtual Machine. To connect and access Alfa card inside of Virtual Machine we have to disconnect it from the host system(Windows).
- Now Click on the Terminal icon on the top panel. and type: iwconfig. You will see something like this:
eth0 no wireless extensions. lo no wireless extensions. wlan0 IEEE 802.11bgn ESSID:off/any Mode:Managed Access Point: Not-Associated Tx-Power=27 dBm Retry short limit:7 RTS thr:off Fragment thr:off Encryption key:off Power Management:off
As you can see wlan0 is the wireless interface created for the Alfa card.
- Now type in: ifconfig, to check the current state of interface
eth0 Link encap:Ethernet HWaddr 18:03:73:9b:fe:0f UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
When you run ifconfig, it by default shows only those interfaces those are Up and running.Here Wlan0 is not up, so we need to put it up using this syntax: ifconfig “Interface_name” up
- Type ifconfig wlan0 up and press [ENTER] then just type ifconfig wlan0 and hit [ENTER]
wlan0 Link encap:Ethernet HWaddr 00:c0:ca:3b:34:b6 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:269 errors:0 dropped:0 overruns:0 frame:0 TX packets:29 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:17324 (16.9 KiB) TX bytes:3792 (3.7 KiB)
- The MAC address 00:c0:ca:3b:34:b6 should match the MAC address printed under your Alfa card. This is a quick check to ensure you have enabled the correct interface.In case you are using alfa card on Kali Linux installed directly on PC.
Configuring Alfa card
We will now check whether your Alfa card is working properly, scanning and detecting access points to ensure that in future we do not face any issues related to scanning.
Follow these step to connect your wireless adapter to access point:
- Let us first check what APs our alfa card is currently detecting. Type in the terminal: iwlist wlan0 scan
wlan0 Scan completed : Cell 01 - Address: FC:DD:55:08:4F:C2 Channel:6 Frequency:2.437 GHz (Channel 6) Quality=70/70 Signal level=-31 dBm Encryption key:on ESSID:"rootsh3ll" Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s 24 Mb/s; 36 Mb/s; 54 Mb/s Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s Mode:Master Extra:tsf=00000003dee43bf3 Extra: Last beacon: 36ms ago IE: Unknown: 0009726F6F747368336C6C IE: Unknown: 010882848B962430486C IE: Unknown: 030106 IE: Unknown: 2A0100 IE: Unknown: 2F0100 IE: IEEE 802.11i/WPA2 Version 1 Group Cipher : TKIP Pairwise Ciphers (2) : CCMP TKIP Authentication Suites (1) : PSK IE: Unknown: 32040C121860 IE: Unknown: 2D1A001119FF00000000000000000000000000000000000000000000 IE: Unknown: 3D1606080400000000000000000000000000000000000000 IE: Unknown: DD09001018020200040000 IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F00 Cell 02 - Address: D8:FE:E3:7B:40:A0 Channel:9 Frequency:2.452 GHz (Channel 9) Quality=47/70 Signal level=-63 dBm Encryption key:on ESSID:"ravi@wifi" Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s 9 Mb/s; 12 Mb/s; 18 Mb/s Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s Mode:Master Extra:tsf=0000000436eb8c36 Extra: Last beacon: 36ms ago IE: Unknown: 0009726176694077696669 IE: Unknown: 010882848B960C121824 IE: Unknown: 030109 IE: Unknown: 2A0100 IE: Unknown: 32043048606C IE: Unknown: 2D1A2C181EFF00000000000000000000000000000000000000000000 IE: Unknown: 3D1609000000000000000000000000000000000000000000 IE: WPA Version 1 Group Cipher : TKIP Pairwise Ciphers (2) : TKIP CCMP Authentication Suites (1) : PSK IE: IEEE 802.11i/WPA2 Version 1 Group Cipher : TKIP Pairwise Ciphers (2) : TKIP CCMP Authentication Suites (1) : PSK IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F00 IE: Unknown: DD1E00904C332C181EFF00000000000000000000000000000000000000000000 IE: Unknown: DD1A00904C3409000000000000000000000000000000000000000000 IE: Unknown: DD0600E04C020160 IE: Unknown: DD930050F204104A0001101044000102103B0001031047001063041253101920061228D8FEE37B40A010210012442D4C696E6B20436F72706F726174696F6E1023000D442D4C696E6B20526F75746572102400084449522D3630304C1042000D32303037303431332D303030311054000800060050F2040001101100084449522D3630304C1008000226881049000600372A000120
You will see a similar output.
- To filter ESSIDs from the cluttered output, Type: iwlist wlan0 scan | grep ESSID
root@rs:~# iwlist wlan3 scan | grep ESSID ESSID:"rootsh3ll" ESSID:"ravi@wifi"
You might be thinking what does this command means ? What we did is, we told the Alfa card (wlan0) to scan the air for the available access points using iwlist command and in response we got a Big cluttered output. So we used passed the complete output to grep command using Pipeline operator( ‘|’ ) to filter the output for the word ESSID. grep command checks the output line by line and echo back the line which contains the string ESSID on the screen.
ESSID: Extended basic Service Set IDentifier, also called as Access point name.
- Now, we have successfully scanned for 2 Access points
Hence our Alfa card is working properly and now we are ready to move on to next chapter i.e
Understanding Basics of Wi-Fi networks
This chapter provided with detailed instruction on How to install Kali Linux in VMWare workstation. Also, in the process, you have learned the basic steps towards:
- Installing Kali Linux in VMWare and exploring other options like disconnecting wireless adapter from host
- Configuring Alfa card using command line
- Scanning the air and detecting the available access points, using Terminal
It is important to understand each and every command used in the tutorial, if you didn’t gain confidence in installing the system and configuring the Alfa card, I would rather recommend you to repeat this chapter a couple of times. In later chapters we will be covering more complicated scenarios.
Before moving on to the next chapter i.e CH-2 (Understanding Basics of Wi-Fi networks) I will be posting Part 2 of this chapter, so that you will also learn to install Kali Linux directly on Hard Drive, and removing previously installed Kali Linux.
meanwhile you can update your Kali Linux:
Type in Terminal:
apt-get update && apt-get upgrade
Do you like the post ? Tell me in the comments section and help me improve quality of next post!
Don’t forget to subscribe and get the updates of latest post.
Keep learning and sharing.
High Gain Antenna:
USB Drive (32 GB):
SanDisk Ultra Fit USB 3.0 32GB Pen Drive (International)
SanDisk Ultra USB 3.0 32 GB Pen Drive (India Only)
Follow rootsh3ll on