Many places you can’t carry your Laptop, but mobile is always there with you. Mobile is as powerful as Personal Computer or Laptop and we can do almost every task using mobile phone which can be performed by PC or Laptop.
In this article, I will discuss how, a phone can be used as a hacking, programming and learning system without logging as a root using Kali Linux. It provides step by step procedure to install and setup Kali Linux on your phone. It will be useful for students and professionals to explore Kali Linux as a Hacking, teaching, and research tool in Android Mobile.
Programming Improves=>Logical thinking, creativity, and problem solving
Contents
- Introduction
- Requirements
- Installation and configuration
- Testing
- Conclusions
Introduction
Hackers may use Kali Linux, Parrot OS, BackBox, Digital Evidence and Forensics Toolkit (DEFT), BlackArch, Cyborg Hawk Linux, GnackTrack, NodeZero, etc. as a Hacking and Penetration testing OS. Kali Linux is the most widely used Open-source, Debian-based Linux OS distribution used to perform various information security tasks, such as Penetration Testing, Security Research, Computer Forensics and Reverse Engineering.
To make your mobile a learning and hacking machine we will require Kali Linux, Termux, Nethunter and some additional utilities and packages for execution of programs written in C, C++, Java, Python etc. and RDBMS (Relational Database Management System) MySQL (MariaDB) without rooting.
Termux is an Android terminal emulator and Linux environment app that works directly with no rooting or setup required. A minimal base system is installed automatically- additional packages are available using the APT package manager.
NetHunter is a free & Open-source Mobile Penetration Testing Platform for Android devices, based on Kali Linux.
store.nethunter.com website is a repository of free security related software on the Android platform, along with an Android client to perform installations and updates, and news, reviews and other features covering all Android and security related things .
Requirements:
To make an Android phone a hacking and learning machine the minimum phone requirement is
- Android 7 or higher
- 4 GB RAM
- 8 GB Storage
- Termux
- Nethunter
- Kali Linux for mobile
- Additional packages depending upon your requirement (C,C++, Java, Python etc.)
Installation and Configuration
Steps to make Android phone as Kali Linux Machine
Step 1: Download and Install Termux
To download Termux:
Open Google Play Store, Search for Termux, and download Termux.
After download, Install Termux and open the Termux.
Step 2: Provide storage access permission
In order to have access to shared storage (/sdcard or /storage/emulated/0), Termux needs a storage access permission to your sdcard.
Termux uses utility termux-setup-storage to configure access to the shared storage and setup these symlinks for quick access to various kinds of storages.
Open the Termux app and give the following command at Termux command prompt and press Enter.
termux-setup-storage
This command will provide access to your sdcard data.
Step 3: Installing packages
Before installing packages update and upgrade the installed packages in Termux. Use the following command to update and upgrade the packages in Termux.
apt update
apt upgrade && apt install
If you do not want to install Kali Linux as hacking OS on your mobile skip below sections from here and directly move to Configuring Mobile as Programming Machine Section.
pkg command provides an interface for manipulating packages: registering, adding, removing and upgrading packages.
wget is a free software package for retrieving files from Internet using HTTP, HTTPS, FTP and FTPS.
Give the following command at Termux command prompt.
pkg install wget
It will install wget package in your Mobile.
Step 4: Download Nethunter
To download Nethunter give the following command at Termux command prompt.
wget -O install-nethunter-termux https://offs.ec/2MceZWr
After the execution of above command the file named install-nethunter-termux is downloaded in your device. By default install-nethunter-termux file doesn’t have execute permission.
Note: wget -O option log all messages to logfile by default on screen.
Step 5: Provide executable permission to install-nethunter-termux after download.
To provide execute permission to install-nethunter-termux file chmod command can be used.
chmod: change mode
chmod command is used to change the access permission of the files and directories.
+r for adding read permission to file
+w for adding write permission to file
+x for adding execute permission to file
chmod +x install-nethunter-termux command change the file permission to executable.
chmod +x install-nethunter-termux
Step 6: Install nethunter
In Kali Linux to execute file ./filename command is used.
./install-nethunter-termux
It will install and setup Kali Linux on your Mobile without GUI.
To start nethunter in CLI (Command Line Interface i.e. without GUI) give the command
nethunter or nh
nethunter
Step 7: Install nethunter-kex from store.nethunter.com
nethunter-kex: is the full kali desktop on Android phone.
Download nethunter-kex from store.nethunter.com.
Open Web browser in your mobile and visit store.nethunter.com website to download nethunter-kex.
Search for nethunter-kex app from nethunter app, download it and install it.
Give the following command to start nethunter-kex
nethunter kex
To run nethunter-kex in background.
nethunter kex &
To set password for nethunter-kex
nethunter-kex passwd
The nethunter-kex server will be installed on port 5901.
Click Connect to start Kali Linux Desktop.
After successfully installation and configuration the mobile will display Kali Linux Desktop as shown in fig. 12 below.
Testing nethunter commands
Command | Meaning |
nethunter | start Kali NetHunter command line interface |
nethunter kex passwd | configure the KeX password (only needed before 1st use) |
nethunter kex & | start Kali NetHunter Desktop Experience user sessions |
nethunter kex stop | stop Kali NetHunter Desktop Experience |
Configuring Mobile as Programming Machine
For installation of C/C++ language compiler give command
pkg install clang
For installation of Java language compiler give command
pkg install ecj dx
For installation of Python language compiler give command
pkg install python
For installation of MySQL (MariaDB)
pkg install mariadb
Now your mobile is ready to access full features of Kali Linux.
Conclusions
As we know Kali Linux is the most widely used OS for information security tasks, such as Penetration Testing, Security Research, Computer Forensics and Reverse Engineering and we can install Kali Linux on Mobile phone using Termux, Nethunter and some additional packages. This article provides steps to make Android phone as a Hacking and learning machine.
Note: Never use any command without knowing the details and actual purpose.
In the next article I discussed how to create, compile, and execute C/C++, Java programs, and how to create and execute Python programs in Kali Linux on Android Mobile.