DEV Community

Cover image for Kali Linux on Android Devices
Iano Njuguna
Iano Njuguna

Posted on • Edited on

Kali Linux on Android Devices

How To Set Up Kali Linux on any Android Device.

Introduction

With Kali Linux installed on your smartphone, its utility becomes supercharged. This guide will help you set up the Kali Linux CLI on any Android device.

pros

  • I use it for programming on good old Vim when not around my PC but even that's barely scratching the tip of the iceberg.

  • With Kali, you have a dynamic tool for penetrating networks, testing vulnerabilities, and safeguarding against potential threats.

Whether you're an IT professional, curious about Kali OS, an ethical hacker, or simply concerned about personal data security, this integration empowers you with tools and knowledge to stay up to date in today's digital landscape.

Download Termux

First and foremost, you will download Termux.

Termux is a terminal emulator that works directly on Android devices that have not been jailbroken/rooted.

To download the app, you will either use the F-Droid store or the official GitHub repository.

Downloading Termux via the Google Play Store is discouraged. This is because the Termux version found on the Google Play Store is deprecated, and thus it's bound to have dependency issues of one form or another.

Set-up Termux

You'll update and upgrade your system using the following command:

apt update && apt upgrade -y
Enter fullscreen mode Exit fullscreen mode

You also need to permit Termux to access your device's storage. To do this, run:

termux-setup-storage
Enter fullscreen mode Exit fullscreen mode

Set up Kali Linux

This is the final part of this guide.

To accomplish your goal, you will be setting up the Kali NetHunter Rootless Edition.

Kali NetHunter is a custom OS for Android devices. The Rootless Edition is for devices that have not been jailbroken/rooted.

Since Kali NetHunter is an open-source project, you don't need to worry about copyright infringement when utilizing it.

The system requirements will vary but, on the low end, you can set it up as a basic Secure Shell (SSH) server with no desktop, using as little as 128 MB of RAM (512 MB recommended) and 2 GB of disk space.

To begin with, you'll have to install wget. It is a computer program that retrieves content from web servers. To install it, we'll use the Termux package manager (pkg):

pkg install wget
Enter fullscreen mode Exit fullscreen mode

After wget is installed, you'll fetch the NetHunter installation file:

wget -O install-nethunter-termux https://offs.ec/2MceZWr
Enter fullscreen mode Exit fullscreen mode

Once the file is downloaded, you'll change its mode to make it executable so that you can install NetHunter by running it:

chmod +x install-nethunter-termux
Enter fullscreen mode Exit fullscreen mode

Run the executable:

./install-nethunter-termux
Enter fullscreen mode Exit fullscreen mode

Using Kali Linux on Android

To start the Kali NetHunter command line interface, run:

nh
Enter fullscreen mode Exit fullscreen mode

It is recommended to update Kali first thing after installation by running:

sudo apt update && sudo apt full-upgrade -y
Enter fullscreen mode Exit fullscreen mode

The default root password is: kali.

To exit the Kali CLI or Termux CLI, run:

exit
Enter fullscreen mode Exit fullscreen mode

Perform regular backups of your rootfs by stopping all NetHunter sessions and typing the following in a Termux session:

tar -cJf kali-arm64.tar.xz kali-arm64 && mv kali-arm64.tar.xz storage/downloads
Enter fullscreen mode Exit fullscreen mode

That will put the backup in your Android download folder.

Note: on older devices, change “arm64” to “armhf”.

References

  1. The Termux website.

  2. F-Droid store.

  3. Official GitHub repository.

  4. The Google Play Store version is deprecated.

  5. What is Kali NetHunter?

  6. Kali NetHunter History.

  7. Kali NetHunter System Requirements.

  8. Kali NetHunter documentation.

  9. Kali NetHunter Rootless Documentation.

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.