Install Libpcap On Kali Linux
Hello everyone!
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
Same problem here: kali-linux amd64 1.0 seems to have a bug with wash. First of all you need to install libpcap-dev and libsqlite3-dev packages from repository.
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 andSecurity 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]
Lets start.
Hardware requirements
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 2000mWin 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 routerfor 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.
Software requirements
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
Username: root
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:
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
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]
- 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
You will see a similar output.
- To filter ESSIDs from the cluttered output, Type: iwlist wlan0 scan grep ESSID
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
1. rootsh3ll
2. ravi@wifi
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
Summary
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.
How To Install Libpcap On Linux
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:
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.
Useful Links:
Router:
Network Adapters:
Alfa AWUSO36NH High Gain B/G/N USB / Alfa AWUS036NHA B/G/N USB
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)
UPDATE :Part 2 : Installing/Removing Kali Linux on PC
Follow rootsh3ll on
Facebook: FB/rootsh3ll
Twitter: @rootsh3ll
Regards,
rootsh3ll