Installing Wi-Fi Drivers on Kali Linux: A Complete Guide

operating system Kali Linux is the de facto standard for information security specialists and pentesters. However, like any distribution based on Debian, it may encounter hardware compatibility issues, especially with wireless network adapters. The lack of a working driver often blocks internet access, making it impossible to install updates or use cloud repositories.

Unlike proprietary systems, where drivers are often built into the installer, in a Linux environment, users sometimes have to manually search for, compile, and install kernel modules. This is especially true for new laptop models or specialized USB adapters that support packet injection. Correct installation Network interface software is the first and critical step before starting any work with wireless networks.

In this article, we'll cover all aspects of working with Wi-Fi adapters in Kali. You'll learn how to identify your device, the different driver installation methods, and how to resolve common compilation errors. We'll pay special attention to chipset-based adapters. Realtek, as they most often raise questions among users.

Identifying the network adapter and checking its status

Before searching for and installing drivers, you need to accurately determine the model of your network adapter and its current status in the system. Users often try to install drivers for a device that is already recognized by the system but is simply disabled or blocked by software. Diagnostics should always be the first step.

To get detailed information about connected USB devices or PCIe cards, use the utility lsusb or lspciThese commands will output a list of vendor and device IDs, which are key to finding the required driver in the repositories or on the manufacturer's website.

lsusb | grep -i wireless

lspci | grep -i network

If the adapter appears in the list but does not work, check if it is blocked by a software or hardware key. Utility rfkill Allows you to manage the state of wireless devices. A blocked adapter will not be able to initialize the driver, no matter how many times you try to install it.

⚠️ Attention: If the team rfkill list If the laptop shows a "hard blocked" status, software unlocking methods won't work. You'll need to find the physical switch on the laptop case or use the function keys (usually Fn + antenna icon).

It's also worth checking whether the kernel module is loaded, even if the interface doesn't come up. The command lsmod will show a list of active modules. If you see names like iwlwifi, ath9k or rtl8xxxu, this means that the basic driver is already in the system, and the problem may lie in the configuration or firmware.

📊 What Wi-Fi adapter do you have?
Built into the laptop (PCIe)
USB adapter (Realtek)
USB adapter (Atheros/MediaTek)
Virtual Machine (NAT/USB)
Don't know

Automatic installation via Kali repositories

The most reliable and preferred way to install drivers is to use official repositories. Kali Linux. Distribution developers include it in packages kali-linux-large and separate packages firmware Most of the necessary binaries and modules. This method ensures compatibility with the current kernel version.

To get started, you need to update your package lists and install the base firmware. Often, simply installing the package solves the problem. firmware-realtek, firmware-atheros or firmware-iwlwifi depending on the chip manufacturer.

sudo apt update

sudo apt install firmware-realtek firmware-misc-nonfree

If you don't know the exact package name, you can use the repository search. Enter part of the chipset name, and the system will suggest available options. This is especially useful for less common devices, where the driver name may be unintuitive.

After installing the packages, be sure to reboot the system or re-enable the kernel module. The command modprobe allows you to load the driver without rebooting, which speeds up the testing process. For example, for Intel adapters, the command modprobe iwlwifi.

Manual compilation of drivers for Realtek and other vendors

The situation becomes more complicated when the required driver isn't available in the repositories or the existing version doesn't work correctly. This often happens with chip-based adapters. Realtek (e.g., RTL8812AU, RTL8821CU), which are popular among pentesters due to their monitor mode support. In such cases, manual compilation from source code is required.

The first step in manual installation is to prepare the environment. You will need the kernel headers (linux-headers), compiler gcc and assembly system makeWithout these components, the kernel module cannot be compiled, and you will receive an error when running the installation script.

sudo apt install linux-headers-$(uname -r) build-essential git dkms

Next, you need to find a repository with the driver. On the platform GitHub There are many driver forks for various chipsets. It's important to choose repositories with active maintenance, as older versions of the code may not compile on newer Linux kernels (versions 5.10 and above).

⚠️ Warning: When downloading drivers from third-party resources (GitHub, GitLab), always check the last update date and any issues. Using abandoned code may lead to system instability or kernel panics.

The installation process usually involves cloning the repository, running an installation script, or executing commands sequentially. make And make install. Usage dkms (Dynamic Kernel Module Support) is preferable, as it will allow the driver to be automatically rebuilt when the system kernel is updated.

☑️ Preparing to compile the driver

Completed: 0 / 5

Working with DKMS and managing kernel modules

DKMS (Dynamic Kernel Module Support) is a framework that automatically rebuilds kernel modules with every Linux kernel update. This is a critical tool for Kali users who frequently update their system. Without DKMS, you'd have to recompile the Wi-Fi driver after every kernel update.

If the driver is installed correctly via DKMS, the module is registered in the system. You can check the status of registered modules with the command dkms statusThe output should display the module name, version, and "installed" status for your current kernel version.

If you compile the driver manually without using ready-made scripts with DKMS, you will need to add the module to the DKMS tree yourself. This is done by creating a link to the source code in the directory /usr/src and registration via the command dkms add, followed by dkms build And dkms install.

Team Description of action Result of execution
dkms status Checking the status of modules List of all DKMS modules and their status
dkms add ./driver-name Adding sources to DKMS Link to source code added to /usr/src
dkms build driver-name/version Compiling a module An object file (.ko) for the kernel has been created.
dkms install driver-name/version Installing the module The module has been copied to the kernel directory.

Management of already loaded modules is carried out through utilities modprobe And rmmodIf after installing a new driver the old one conflicts or the system becomes unstable, you need to unload the module with the command sudo rmmod module_name before loading a new one.

What is blacklist in Linux?

A blacklist is a configuration file that prevents certain kernel modules from being loaded automatically. This is useful when the default driver conflicts with a manually installed version. The files are located in /etc/modprobe.d/.

Monitor mode and packet injection

The main reason why Kali Linux users look for specific drivers is the need to translate the adapter into monitor mode (Monitor Mode). In this mode, the network card stops filtering packets not intended for it and allows it to capture all traffic. Not all drivers support this feature reliably.

To switch the interface to monitor mode, the utility is most often used airmon-ng from the package Aircrack-ngHowever, if the driver doesn't support the required ioctl calls, the command will fail. Adapters based on Atheros chips (ath9k) are considered the most stable for this purpose, while some Realtek driver versions may require patching.

sudo airmon-ng start wlan0

After enabling monitor mode, the interface is usually renamed and a suffix is ​​added mon (For example, wlan0mon). You can check the success of the switch using the command iwconfig, where the Mode line should indicate Monitor.

⚠️ Warning: Enabling monitor mode may temporarily interrupt your connection to the access point. Make sure you have an alternative network connection (e.g., via Ethernet or a second Wi-Fi adapter) if you need internet access while working.

It's worth noting that packet injection support is a separate feature that also depends on the driver. Even if monitor mode is enabled, packet injection may not work. You can test this capability using a test. aireplay-ng --test.

Typical errors and methods for eliminating them

Users often encounter recurring issues during driver installation. Understanding the causes of these errors allows for quick solutions. The most common issue is a mismatch between the kernel version and the driver source code.

If you get errors related to missing symbols or structures during compilation, the driver was most likely written for an older kernel version. In this case, it's worth looking for a fork of the repository labeled "kernel-5.x support" or something similar.

  • 🔴 "Module build failed" error: Usually indicates missing kernel headers or mismatched versions. Check if the version matches. linux-headers with the version of the running kernel.
  • 🔴 "Device or resource busy" error: The interface is busy with another process (NetworkManager, wpa_supplicant). You must stop interfering services before running the pentest tools.
  • 🔴 The adapter disappeared after installation: The new driver may conflict with the built-in one. Try blacklisting the conflicting module.

Another common issue is the adapter crashing after a short period of use. This may indicate a power consumption issue. You can disable power saving mode in the driver settings by adding the appropriate parameters to the module's configuration file.

Please note that Wi-Fi performance is limited in virtual machines (VirtualBox, VMware). USB adapters are routed through emulation, which can lead to packet loss and instability. For serious work, we recommend using a Kali Live USB or a bare-metal installation.

Why is Wi-Fi slow after installing the driver?

Power saving mode may be enabled or the wrong region may be selected. Try setting the region using the command iw reg set US (or your country code) and disabling power saving in the driver settings.

Frequently Asked Questions (FAQ)

How do I know if my adapter supports monitor mode?

Use the command iw listIn the output, find the "Supported interface modes" section. If the word "monitor" is there, and the "valid interface combinations" section indicates that the monitor mode is compatible with other modes, then support is available. You can also use the utility airmon-ng, which will immediately show a list of adapters that support injection.

Is it possible to install Wi-Fi drivers without internet access?

Yes, it's possible, but it requires some preparation. You'll need to download the necessary packages (.deb files) or driver source codes on another computer with internet access, transfer them to a USB drive, and install them locally via dpkg -i or a compiler. However, compilation will still require kernel headers, which are quite large.

Why did Wi-Fi stop working after updating Kali?

Most likely, the Linux kernel was updated, and the driver module you installed manually was not rebuilt automatically. If you didn't use DKMS, you'll need to rerun the driver installation process for the new kernel version. If you did, check the status via dkms status and run dkms autoinstall.

Which USB Wi-Fi adapter is best for Kali Linux?

The most compatible adapters are those based on the Atheros AR9271 (2.4 GHz only) and Realtek RTL8812AU/RTL8814AU (5 GHz and AC support). Avoid adapters with Broadcom chips, as they often require proprietary drivers that are difficult to configure in monitor mode.