Pratham AI Systems
Hacking Mobile

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.

Fig.1 Termux download and install

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.

Fig. 2 Termux-setup-storage command at Termux command prompt screen

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

Fig 3

apt upgrade && apt install

Fig 4. apt upgrade command screen

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.

Fig. 5 wget command screen

Step 4: Download Nethunter

To download Nethunter give the following command at Termux command prompt.

wget -O install-nethunter-termux https://offs.ec/2MceZWr

Fig 6. Installing nethunter

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

Fig. 7 chmod command screen at 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.

Fig 8 Nethunter Installation

To start nethunter in CLI (Command Line Interface i.e. without GUI) give the command

nethunter or nh

nethunter

Fig 9. nethunter command to start nethunter CLI

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.

Fig. 10 Download nethunter store app screen

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.

Fig. 11 Kex server

After successfully installation and configuration the mobile will display Kali Linux Desktop as shown in fig. 12 below.

Fig 12 Kali Linux Desktop

Testing nethunter commands

CommandMeaning
nethunterstart Kali NetHunter command line interface
nethunter kex passwdconfigure the KeX password (only needed before 1st use)
nethunter kex &start Kali NetHunter Desktop Experience user sessions
nethunter kex stopstop 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.

References

https://offs.ec

http://kali.org

Amar Nayak

22 years of experience in Training, Programming, and Research.
Certifications: IBM DB2, IBM WebSphere, IBM Tivoli, OCA, OCP, SCJP (OCJP), CCNA, RHCE,

https://prathamai.com

Leave a Reply

Your email address will not be published. Required fields are marked *