Using professional cybersecurity tools on a mobile device has ceased to be the prerogative of exclusively enthusiasts with updated gadgets. Modern capabilities of the operating system Android allow you to run a full-fledged distribution environment Kali Linux even on devices on which the bootloader is locked or there are no superuser rights. This opens up broad horizons for pentesters, students and security researchers, allowing you to conduct network audits and vulnerability analysis directly from your pocket smartphone.
You do not need to disassemble the phone, solder contacts or look for complex exploits to gain root access. The entire process is based on the use of a terminal emulator and containerization technology, which makes the procedure safe for the main system of the device. However, it is worth understanding the difference between a native installation and emulation: in this case, we are running a Linux environment on top of the Android kernel, using a compatibility layer.
Despite the absence of the need for deep intervention in the system, the process requires care and adherence to the sequence of actions. Errors at the command input stage can lead to the emulator not working or data corruption in the isolated space. Next, we will analyze in detail each stage of setup, from preparing the environment to launching the graphical interface.
Preparing the device and selecting tools
The first step for a successful installation is installing basic software, which will serve as the foundation for all further work. You will need an application Termux, which is a powerful terminal emulator with its own package base. It is important to note that the version from the Google Play Store is often outdated, so it is recommended to download the latest APK file from the official F-Droid repository or GitHub of the project.
In addition to the terminal, you will need a VNC client to work with the Kali GUI. There are many applications in the Play Market, but the most stable work is demonstrated by bVNC or VNC Viewer from RealVNC. These apps will allow you to see the Linux desktop on the screen of your smartphone, controlling it through touch input or a connected mouse.
A critical aspect is the amount of free memory on your device. A full installation of a distribution kit with a graphical shell and a set of standard utilities can take up from 2 to 5 gigabytes of space. Also make sure that the battery is at least 50% charged, as the process of unpacking archives and compiling dependencies creates a high load on the processor.
Before starting any manipulations, it is strongly recommended to make a backup copy of your important data. Although the method does not require root access and is theoretically safe, unexpected failures in the Android file system can lead to information loss. Make sure that USB debugging is enabled in the developer settings if you plan to connect external Wi-Fi adapters via OTG.
Installation and initial configuration of Termux
After installing the application Termux run it and provide all requested permissions to access the storage. This is necessary so that the emulator can correctly write system image files and create working directories. The first step is to update the package lists and install the basic utilities that will be required for work.
Enter the following command in the terminal and confirm the action by pressing the key Y:
pkg update && pkg upgrade
This process may take some time depending on the speed of your Internet connection. Next, you need to install packages responsible for working with the file system and network interfaces. For the subsystem to work correctly, we need proot, wget and curl. Proot allows you to emulate superuser rights in user space, which is the key point of this instruction.
If the pkg update command produces connection errors, try changing the DNS servers in the Wi-Fi settings to public ones from Google (8.8.8.8).
The next step is to give the application access to external storage. Without this step, you will not be able to save scan results or downloaded files to the phone's shared memory. Execute the command:
termux-setup-storage
After execution, a system window will appear asking for permission, which must be confirmed. Now a symbolic link storagewill appear in the Termux home directory, through which you can interact with the device files. This will simplify the transfer of scripts and reports between the Linux environment and the main Android system.
Deploying the Kali Linux image
Now we move on to the most important stage - downloading and installing the distribution itself. We will use a special installer script that will automatically download the required image, check its integrity and configure the environment. Do not try to download images manually through a browser, as this will complicate the mounting process.
Enter the command to download the Kali NetHunter installer or an alternative script for Termux:
wget -O install-nethunter-termux https://offs.ec/2MceZWrchmod +x install-nethunter-termux
./install-nethunter-termux
The script will prompt you to select an installation option. For devices without root access, the Rootlessmode will be available to you. Select this item from the menu. The system will automatically download the archive with the Kali file system, which can weigh several gigabytes. Make sure that you are using a stable Wi-Fi connection to avoid damage to the archive if the connection is lost.
โ ๏ธ Attention: During the installation process, the script may require you to create a user and password. Write this information down in a safe place. Losing the password will require a complete reinstallation of the environment, since resetting it in an isolated proot environment is quite difficult for a beginner.
After the download is complete, the unpacking process will begin. At this stage, the device's processor will work at its limit, which may cause the case to heat up. This is normal, but if the phone starts to overheat critically, it is better to pause the process and let it cool down. Upon completion, you will see a message about successful installation.
โ๏ธ Check before starting
Configuring the GUI and launching
The command line itself is powerful, but many Kali tools, such as Wireshark or Burp Suite, require a graphical environment for convenient work. To run the GUI we will need to install a VNC server inside a Kali container. After entering the Kali environment (command start-kali or a similar one specified during installation), install the server:
apt updateapt install kali-linux-headless
vncserver -geometry 1280x720
When you first start vncserver the system will ask you to create a password to connect. Enter a combination of numbers (usually up to 8 characters) and confirm it. The system will also ask whether you need to create a password for viewing only - here you can answer in the negative if you plan to fully manage the system.
Now open the previously installed VNC Viewer app on Android. Create a new connection by specifying the address localhost:5901. The connection name can be anything, for example, "Kali Mobile". When you try to connect, the application will ask for the password you set in the previous step. After successful authentication, you will see the Linux desktop.
How to change the screen resolution?
If the standard resolution of 1280x720 does not suit you, stop the server with the command 'vncserver -kill :1' and start it again with the -geometry parameter, specifying the desired values, for example 1920x1080. However, remember that on small smartphone screens, a high resolution will make the interface too small.
It is worth noting that the performance of the GUI directly depends on the power of your processor. On budget devices, there may be delays when redrawing windows. To improve responsiveness, it is recommended to disable visual effects in the settings of the XFCE window manager, which is used by default in Kali.
Working with network interfaces and adapters
One โโof the main limitations of working without root access is direct access to the device's Wi-Fi chip. Using standard Android tools, the application cannot put the wireless module into monitoring mode (monitor mode), which is necessary for intercepting packets and attacks on WPA/WPA2 networks. The Android kernel does not provide such privileges to regular applications.
However, there are workarounds. You can use an external Wi-Fi adapter that supports monitoring mode, connected via the USB port using an OTG cable. However, even in this case, drivers often require kernel rights to operate, which are not available in rootless mode. In such a situation, the functionality comes down to passive traffic analysis or working with already connected interfaces.
| Task type | Accessibility without Root | Required equipment | Complexity |
|---|---|---|---|
| Port scanning (Nmap) | Full | Smartphone only | Low |
| Web pentest (Burp, SQLmap) | Full | Only smartphone | Medium |
| Wi-Fi monitoring mode | Limited | External adapter + OTG | High |
| Handshake attacks | Not available | Requires Root/Kernel | Impossible |
For most tasks of web auditing and application vulnerability analysis, the lack of direct access to the airwaves is not critical. You can route traffic through a proxy, run local servers for testing, and use the entire arsenal of utilities for analyzing code and databases.
โ ๏ธ Attention: The menu interfaces and available commands in Termux can be updated by developers. If any command from the instructions does not work, check the official project documentation on GitHub, since the syntax of the package manager
pkgoccasionally changes.
Optimizing performance and troubleshooting problems
Running a Linux emulator on a mobile platform places high demands on resources. To avoid application crashes or freezes, it is recommended to close all background apps before starting a heavy session. RAM is a bottleneck: if your device has less than 4 GB of RAM, try not to run heavy tools like Metasploit and a browser with many tabs at the same time.
Losing the connection to the VNC server is a common problem. This may be due to Android's aggressive power saving policies, which kill background processes. To prevent this, go to your smartphone's battery settings, find the Termux app and select the "No restrictions" or "Do not optimize" mode. This will allow the session to work stably even when the screen is off.
The stability of Kali in Termux depends 90% on the Android energy saving settings and the amount of free RAM, and not on the version of the distribution itself.
It is also worth considering the features of the file system. Working with a large number of small files within an emulated environment may be slower than on a native system. Try to store large amounts of data (for example, brute force dictionaries) in external storage, mounting it inside the Kali environment, and not inside the Termux home directory.
Frequently asked questions (FAQ)
Can I hack my neighbor's Wi-Fi using these instructions?
No, In non-root mode, direct access to the Wi-Fi chip to switch it to monitoring mode is prohibited. You will be able to scan networks and check them for configuration vulnerabilities, but you will not be able to intercept handshakes or infiltrate the airwaves without special external hardware and a modified kernel.
What to do if you get a connection error when starting VNC?
Make sure that the VNC server is running inside a Kali session. Check the port number (usually 5901 for the first display). Also make sure that the Android firewall or antivirus is not blocking the local connections of the Termux application.
Is it safe for my phone?
Yes, the method is completely safe for the main system. Kali Linux runs in an isolated container (chroot/root). Uninstalling the Termux app will completely clear all traces of Linux on your device without affecting your personal photos or contacts.
Is it possible to update packages inside Kali?
Yes, you can use the standard command apt update && apt upgrade within the Kali environment. However, be careful when updating the kernel or critical system libraries, as they must remain compatible with the emulated Termux environment. Why does the ifconfig command not work? Try using the command
Why doesn't the ifconfig command work?
In modern versions of Linux, the utility ifconfig often replaced by ip. Try using the command ip addr to view network interfaces. In addition, some interfaces may be hidden due to emulation limitations.