Install Libpcap On Kali Linux

5/25/2019
    43 - Comments
Install Libpcap On Kali Linux 3,8/5 2095 votes

[2015-07-04] libpcap 1.7.3-1 migrated to Kali Rolling [2014-10-22] libpcap 1.6.2-2 has been added to Kali Devel [2014-10-22. Kali Linux Package Tracker.

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

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.

GROUP CHAT: Enjoy group conversations with your contacts. Nokia asha 210 flash file. Send a million messages a day to your friends for free! WhatsApp Messenger - NO HIDDEN COST: Once you and your friends download the application, you can use it to chat as much as you want. MULTIMEDIA: Send Video, Images, and Voice notes to your friends and contacts. WhatsApp uses your Internet connection: 3G/EDGE or Wi-Fi when available.

[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

  1. Start VMWare Workstation, Go to file menu and click on “New Virtual Machine“.
  2. Click next. with selected option “Typical(recommended)“.
  3. Click on Browse… and located your downloaded Kali Linux ISO file on the Hard Drive.then click Next
  4. 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.
  5. 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.
  6. Click Finish and then Power on this Virtual Machine. Now the virtual machine will boot.
  7. Select/Highlight the option Install and press [ENTER]
  8. Enter you Hostname (rs in this case)
  9. Enter password (pass in this case)
  10. 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.
  11. Select Finish partitioning and write changes to disk.
  12. Select Yes to confirm Write changes to disks and press [ENTER].
  13. Wait for setup to Install the System
  14. 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.
  15. 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.
  16. Setup is now complete. Select Continue and hit [ENTER].
  17. Now start the Virtual machine “Kali Linux”, and Press [ENTER] to continue boot.
  18. 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

Libpcap

Please follow the instructions step-by-step to set up your card:

  1. 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).
  2. 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.

  3. 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

  4. Type ifconfig wlan0 up and press [ENTER] then just type ifconfig wlan0 and hit [ENTER]
  5. 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:

  1. 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.

  2. 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.

  3. 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.

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

  • Minimum 8 GB of HDD space to install Kali Linux
  • For i386 or amd64 architecture, a minimum of 512 MB RAM (1024 MB RAM recommended)
  • An ISO or VMWare image can be downloaded from Kali Linux site
Here, I am going to guide you step by step to install Kali Linux (ver. 1.0.2) in a virtual machine. Procedure of installation is very much similar to Backtrack.
Click on the above link to download Kali Linux. When you goto this link it will ask you to register, however registration is not mandatory to download Kali Linux. Either, you can register by giving your name or email address to receive information updates or simply you can skip this step and click on 'No thanks, just want to download!'. Depending on the type, you can customize your download in ISO or VMWare format. Click on 'Download Kali'. Once Kali Linux is downloaded you are ready to install it in a virtual machine. I am using VMWare Player version: 5.0.2 build-1031769 here.

1. Open VMWare Player and click on Click a New Virtual Machine. It will open New Virtual Machine Wizard.

2. On this screen select I will install the operating system later and the click on Next.

3. Select Guest operating system as Linux (kernel of Kali Linux is based on Linux) and then select Version as Ubuntu. Click on Next to goto next screen

4. Type Virtual machine name and specify the Location where you want install Kali Linux, however you can leave the default Virtual machine name and Location. Click on Next to proceed to the next screen

5. Specify Disk Capacity. Default is 20 GB. Select Split virtual disk into multiple files where file transfer is a major issue. Click on Next

6. On this screen, either you can click on Customize Hardware to customize settings and then to goto step no. 8 or click on Finish to complete the process of creating virtual machine

7. Click on Edit virtual machine settings

8. This is the screen where you can customize or edit your Hardware Settings. As mentioned above, the minimum system requirement is uni-processor of i386 or amd64 architecture processor, so click on
(a) Memory, to select minimum 1024 MB of RAM;
(b) Processors, as 1 or 2 (depending upon the processing speed) and Preferred mode as Automatic;
(c) Click on CD/DVD IDE. Now, on right hand panel you will Connection. It has two options:
Use physical drive- select this option if you have Kali Linux is in your CD or DVD drive; or
Use ISO image file- select this option if you have downloaded Kali Linux on your hard drive. Click on Browse to locate the ISO file
(d) Floppy drive is optional, as now a days most of the computers do not floppy drive
(e) Select NAT if you have network adapter for Internet
Install Libpcap On Kali Linux
Other Hardware settings can be modified once installation process is completed. Now click on OK.

How To Install Libpcap


9. Select kali linux on left side panel screen and then click on Play virtual machine
10 VMWare setup will startup

11. You will be greeted with Kali Linux boot screen. Choose either Graphical or Text-Mode install and press Enter to boot

12. Select your preferred language and click on Continue


14. Select option to configure your keyboard and click on Continue

15. Once disc is detected by operating system, it will copy the image to your hard disk and probe your network interfaces

16. Enter hostname to configure your network and click on Continue

17. If you have a domain name, then enter here in the box. Make sure that you have a correct domain name. You can enter the domain name later and leave this box blank. Click on Continue


19. It will auto-detect time from network time server

20. Installer will probe hard disk and offer you four choices of partitioning of disk. Beginner can select Guided- use entire disk however experienced user can setup partition as Manual

21. Below are the screenshots of manual partition. I have created three partitions
a. /boot (a partition from where your operating system will boot)
c. swap (a portion where buffering is done)


22. This is the screen where you’ll have last chance to review your disk configuration before the installer makes irreversible changes. After you click Continue, the installer will go to work and you’ll have an almost finished installation.



23. Configure network mirror to give additional software that is included on the CD-ROM

24. Install GRUB boot loader


25. Finally, click on Finish to reboot Kali Linux installation



26. Login screen of Kali Linux