Installing the operating system Kali Linux When installing a pentest on a laptop or desktop computer, the first major hurdle often arises: the lack of a working wireless connection. Unlike mainstream distributions like Ubuntu or Mint, this pentesting tool doesn't always include proprietary drivers for a wide range of Wi-Fi adapters by default. This leaves the user in a situation where the network is needed to install updates or download tools, but connecting to the router is impossible.
Solving this problem requires understanding how Linux Manages network interfaces and is ready to execute a series of commands in the terminal. The process can range from simply activating a service to manually compiling kernel modules for specific chipsets. It's important to immediately prepare yourself for careful work with the console, as the graphical interface in this environment is often secondary and can hide important system errors.
In this guide, we'll cover every step: from hardware diagnostics to complex cases involving external adapters. You'll learn how to identify your network controller model, find the appropriate driver, and configure it correctly. Even if you're new to the world of networking. Debian-based systems, step-by-step instructions will help you establish a stable connection.
Hardware diagnostics and chipset identification
The first and most critical step is accurately identifying the hardware installed in the system. Without knowing the exact chipset model, any attempt to install drivers is a guesswork. In the Linux world, and especially in security-focused distributions, hardware support depends on the chip manufacturer, not the brand name printed on the device's casing.
To obtain comprehensive information about connected PCIe and USB devices, use the utility lspci for internal cards and lsusb For external adapters, run the command lspci | grep -i net in the terminal. If you have an external USB dongle, the command lsusb will display its Vendor ID and Product ID. These hexadecimal codes are the key to finding the required driver in repositories or on the manufacturer's website.
⚠️ Attention: If the team
lspciorlsusbIf your Wi-Fi device isn't showing up at all, it might be blocked at the BIOS/UEFI level or physically disabled using the button on the laptop case. Check your firmware settings before loading the OS.
It's also worth checking whether the kernel sees the device even if the driver is not loaded. The command dmesg | grep firmware Often displays error messages about firmware loading, indicating the specific missing file. This allows you to immediately understand what exactly the system needs to start the interface.
Basic setup via Network Manager
In modern versions Kali Linux is used by default NetworkManager, which provides a user-friendly graphical interface and a command-line utility nmtuiIf the drivers are installed correctly but the connection fails, the problem may lie in the connection manager settings. Often, the interface is simply down or blocked by software.
For quick verification and activation, use the text interface nmtuiRun it as superuser by typing sudo nmtuiIn the menu that opens, select "Edit a connection" or "Activate a connection." Here you can visually select your network, enter the password, and check the connection status. This is the easiest method, requiring no manual configuration editing.
- 📡 Make sure the wireless interface is not blocked by the command
rfkill listIf you see "Soft blocked: yes", do the following:sudo rfkill unblock wifi. - ⚙️ Check the status of the NetworkManager service with the command
systemctl status NetworkManagerIf it is not active, start it throughsudo systemctl start NetworkManager. - 🔄 If you have problems with DHCP, try renewing your IP address lease or setting a static address in your connection settings.
If the graphical tray applet doesn't display networks, the NM plugin may not be installed or may be conflicting with other network services. In such cases, it may be helpful to temporarily disable the service. wicd, if it was installed previously, since two network managers cannot work at the same time.
Installing proprietary drivers and firmware
The most common reason for non-working Wi-Fi is missing firmware files for Broadcom, Realtek, or MediaTek chipsets. Unlike Windows, where drivers are often bundled with the OS, in Linux, and especially Kali, they are separated into packages. firmware-linux-nonfree and specific modules. Without internet access, installing them creates a vicious circle that can be broken by using a USB modem from your phone or a temporary wired connection.
To install the base firmware set, update the package lists and install the meta package:
sudo apt update
sudo apt install firmware-linux-nonfree firmware-realtek firmware-brcm80211
After installation, you will need to reboot the system or re-enable the kernel module. For some Realtek adapters, especially newer models with Wi-Fi 6 support, the standard repositories may not be sufficient. In this case, you will need to clone the repository from GitHub and compile the driver manually. This requires installing packages. build-essential, linux-headers And dkms.
What should I do if driver compilation fails?
If you see errors related to kernel versions during compilation, make sure the headers and kernel versions match. This can often be resolved by running sudo apt install --reinstall linux-headers-$(uname -r) . Also, check if the dkms package is installed, which automatically rebuilds modules when updating the kernel.
Manual configuration via wpa_supplicant
In scenarios where graphical interfaces do not work or the system operates in headless mode, the utility comes to the rescue wpa_supplicantThis is a fundamental component responsible for negotiating encryption keys and associating with the access point. Working directly with it gives complete control over the connection process, bypassing unnecessary abstractions.
First, you need to create a configuration file with your network data. You can use the utility wpa_passphrase To generate a hashed password so it doesn't have to be stored in plaintext, the command looks like this: wpa_passphrase "SSID_network" "password" > /etc/wpa_supplicant/wpa_supplicant.confAfter this, we start the connection process by specifying the interface (usually wlan0 or wlp2s0).
| Parameter | Description | Example of meaning |
|---|---|---|
ctrl_interface |
Path to the control socket | DIR=/var/run/wpa_supplicant |
driver |
Driver type (usually auto) | nl80211 |
ssid |
Wireless network name | "Home_WiFi" |
proto |
Security protocol | RSN |
The process is launched by the command sudo wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf. Flag -B runs the process in the background. After successful association, you need to obtain an IP address by running a DHCP client, for example, dhclient wlan0If this step is successful, you should be able to access the network.
Working with external adapters and monitoring mode
For information security professionals, monitoring and packet injection are critical. Integrated laptop cards often don't support these features or perform them reliably. Therefore, using external USB adapters with Atheros, Ralink, or specific Realtek chips is the industry standard. However, connecting them in Kali Linux may require additional steps.
When connecting a powerful adapter, the system may assign it an interface name different from the usual one wlan0, For example, wlan1 or wlx00c0ca..To switch the card to monitoring mode, use the following combination: ip link set dev wlan0 down, then iw dev wlan0 set type monitor and again ip link set dev wlan0 upAn alternative is the utility airmon-ng, which automatically handles processes that may interfere with the card's operation.
- 🔌 Use a USB hub with external power if the adapter requires a lot of current, otherwise the laptop ports may not be able to handle the load.
- 📡 Check mode support with the command
iw listIn the "Supported interface modes" section, look for the "monitor" line. - 🛡️ When working in a virtual machine (VirtualBox/VMware), be sure to forward the USB device directly to the guest OS, disconnecting it from the host.
You can't simultaneously share internet via the integrated card and scan the airwaves with an external card unless complex routing is configured. To ensure stable operation in monitoring mode, ensure that there are no NetworkManager processes running on the card, which would attempt to return it to management mode.
⚠️ Attention: Virtual machine interfaces and network settings may change after kernel or Kali distribution updates. Always check the instructions for your kernel version, as the module structure mac80211 may change.
Troubleshooting and common errors
Even if you follow all the instructions, specific errors may still occur. Often, the problem stems from a conflict between kernel and driver module versions. If Wi-Fi is lost after a system update, first check whether the driver module is loading. The command lsmod | grep driver_name (For example, rtl8812au) will show whether it's active. If the module is loaded but not working, try deleting it and reloading it: sudo modprobe -r rtl8812au And sudo modprobe rtl8812au.
Another common issue is power saving. Linux can automatically disable the Wi-Fi adapter to save power, resulting in dropped connections or an inability to connect. To disable this feature, you need to edit the configuration file. /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf, changing the value wifi.powersave on 2 (which means disconnection).
☑️ Diagnosing Wi-Fi problems
If nothing helps, use the logs for deep diagnostics. File /var/log/syslog or conclusion dmesg Contain detailed information about hardware initialization attempts. Look for keywords like "firmware," "failed," "error," or the name of your chipset. These often contain direct instructions about which file is missing or which driver version is required.
FAQ: Frequently Asked Questions
Why doesn't Kali Linux detect my Wi-Fi adapter even though it works in Windows?
Most likely, Kali is missing proprietary drivers or firmware files that are built into the Windows system. You need to identify the chipset (using lsusb/lspci) and install the appropriate package from the Kali repositories or compile the driver manually.
How do I enable monitoring mode if the airmon-ng command returns an error?
The error often occurs due to blocking processes (NetworkManager, wpa_supplicant). Use the command airmon-ng check kill to stop them. Also, make sure the interface is set to DOWN before changing the type.
Can I use my laptop's built-in Wi-Fi for pentesting?
Theoretically, yes, if the chipset supports injection and monitoring mode (for example, some Atheros chips). However, in practice, integrated cards are often unstable, have weak antennas, and can block system operation during failures. An external adapter is recommended.
What should I do if Wi-Fi disappears after updating the kernel?
When updating the kernel, DKMS modules should be rebuilt automatically. If this doesn't happen, check if the packages are installed. linux-headers for the new kernel version. Run sudo apt install --reinstall linux-headers-$(uname -r) and regenerate the modules.