Kali Linux in Termux

July 5, 2023 15 min read Sandeep Tech Team

Kali Linux in Action

Watch this demonstration of Kali Linux running in Termux. The video shows the complete process from installation to executing penetration testing tools. This visual guide will help you understand how to transform your Android device into a powerful security testing platform.

Kali Linux is a popular open-source Debian-based Linux distribution aimed at advanced Penetration Testing and Security Auditing. With Termux, you can install and run a full Kali Linux environment on any Android device without root access, giving you access to a wide range of security tools and utilities.

600+
Security Tools
100%
Open Source
No
Root Required
CLI & GUI
Modes Available

What is Kali Linux?

Kali Linux is a free and open-source platform for penetration testing and security auditing. Developed by Offensive Security, it brings together a massive collection of security tools. By running it in Termux, you can harness the power of Kali Linux directly on your Android device, creating a portable hacking environment.

Educational Purpose Only

Kali Linux should only be used for educational purposes and authorized security testing. Unauthorized use of penetration testing tools is illegal and unethical. Always obtain proper permission before conducting any security tests.

Installation

Installing Kali Linux in Termux is straightforward. Follow these steps carefully, copying and running each command one by one.

# 1. Update Termux packages pkg update -y
# 2. Upgrade Termux packages pkg upgrade -y
# 3. Install wget apt install wget -y
# 4. Download the installer script wget https://link.sandeeptech.com/kali-termux-installer
# 5. Give executable permissions chmod +x kali-termux-installer
# 6. Run the installer bash kali-termux-installer

How to Use Kali Linux

After the installation is complete, you need to update the Kali Linux environment. This is a crucial step.

Important First Step: Update Kali

Before using any tools, you must update and upgrade the Kali terminal. This process can take 30-45 minutes to complete, depending on your internet connection and device performance.

# Start Kali Linux as a root user startkali -r
# Update and upgrade all packages sudo apt update && sudo apt upgrade -y

Once updated, you can use the following commands in your Termux terminal to manage your Kali Linux instance:

# Start Kali Linux as a normal user startkali
# Start Kali Linux as a root user startkali -r
# Display the help menu for more options help-kali

Using GUI Desktop Mode

You can use Kali Linux with a full graphical user interface (GUI) by using a VNC (Virtual Network Computing) server. To do this, you'll need the NetHunter KeX application.

After installing the KeX app, run these commands inside your Kali Linux terminal (e.g., after running `startkali`):

# Set your VNC password (run this first time only) vnc passwd
# Start the VNC server vnc start
# Stop the VNC server vnc stop
# Kill all running VNC processes vnc kill

Customizing the Terminal

To give your Kali Linux terminal a more attractive and functional look, you can replace the default configuration file. You can also disable the initial developer message.

Custom Bash Configuration

These commands will download a custom `bash.bashrc` file, replace the default one, and install `figlet` for awesome ASCII art text.

# Go to your Termux home directory cd $HOME
# Download the custom bashrc file wget https://link.sandeeptech.com/linux-bashrc -O bash.bashrc
# Remove the default Kali bashrc file rm /data/data/com.termux/files/home/kali-arm64/etc/bash.bashrc
# Move the new bashrc file into place mv bash.bashrc /data/data/com.termux/files/home/kali-arm64/etc
# Start Kali as root to apply changes startkali -r
# Update and install figlet apt update -y && apt install figlet -y

Disable Developer Message

To disable the message that appears when you start Kali Linux, run the following command inside the Kali root session (`startkali -r`):

# Create a hidden file to suppress the login message touch ~/.hushlogin

Available Tools

Popular Security Tools

Kali Linux includes a wide variety of security tools for different purposes. Here are some of the most commonly used ones:

Nmap

Nmap

Network discovery and security scanning tool

Metasploit

Metasploit

Powerful penetration testing framework

Wireshark

Wireshark

Network protocol analyzer

Burp Suite

Burp Suite

Web vulnerability scanner

Ethical Considerations

When using tools like Kali Linux, it's crucial to follow ethical guidelines:

  • Obtain Permission - Always get written permission before conducting any security tests
  • Educational Purpose - Use these tools only for learning and authorized security testing
  • Respect Privacy - Do not access or collect personal information without consent
  • Report Vulnerabilities - If you find security issues, report them responsibly
  • Stay Legal - Familiarize yourself with the laws in your jurisdiction regarding security testing

Legal Warning

Using penetration testing tools without proper authorization is illegal in most jurisdictions. This tutorial is for educational purposes only. Always obtain explicit permission before conducting any security tests.

Command Reference

Kali Linux Commands

Command Description Example
startkali Start Kali Linux as a normal user startkali
startkali -r Start Kali Linux as a root user startkali -r
vnc passwd Set the password for VNC GUI access vnc passwd
vnc start Start the VNC server for GUI mode vnc start
vnc stop Stop the VNC server vnc stop
vnc kill Kill all running VNC server processes vnc kill
help-kali Display the help menu for Kali in Termux help-kali
nmap Network scanning tool nmap -sV target_ip
msfconsole Metasploit framework console msfconsole

Kali Linux is a powerful platform for understanding how security testing works. By studying and using this tool responsibly, security professionals can better protect themselves and others from cyber threats. Remember to always use these tools ethically and with proper authorization.

Back to Blogs

Leave a Comment

Mike Johnson
July 6, 2023
Amazing guide! I've been looking for a comprehensive tutorial on installing Kali Linux in Termux. The step-by-step instructions made the process so much easier. Thanks for sharing this!
Sarah Chen
July 7, 2023
This is exactly what I needed! I've been wanting to try out Kali Linux but didn't want to root my device. The fact that it works in Termux without root is fantastic. Great job on the tutorial!