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. Run the command below to automatically download and execute the installer script. It will set up the complete Kali Linux environment on your device.

bash -c "$(curl -fsSL https://raw.githubusercontent.com/sandeeptechcloud/kali-linux/main/st-kali-setup.sh)"
# Activation Key de4f0114611aab15fef8881083f2de10

You will be prompted to enter this key during installation. Click "Copy Key" to copy only the activation key.

Completely Remove Kali Linux Tool from Termux

If you need to remove the Kali Linux tool and all its associated files from Termux, run the following commands. This will delete the binaries and the entire chroot environment.

# Run these commands one by one to completely uninstall the tool rm -f $PREFIX/bin/kali-linux $PREFIX/bin/kali-linux-root rm -rf ~/chroot ~/kali*

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 kali-linux-root
# 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 kali-linux
# Start Kali Linux as a root user kali-linux-root
# 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 `kali-linux-root`):

# 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 kali-linux-root
# 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 (`kali-linux-root`):

# 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
kali-linux Start Kali Linux as a normal user kali-linux
kali-linux-root Start Kali Linux as a root user kali-linux-root
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

No comments yet. Be the first to start the discussion!