Ethical Hacking using Android Devices

Overview

My previous article A Guide to Setting up a Development Environment on Android Devices talked about setting up a development environment on Android devices. In this article let’s continue the fun by setting up an ethical hacking environment on Android devices.

Prerequisites

For the walk-through I am going to use ssh to login to my Android phone. If you have not read the previous article, refer to the link below.

Kali Linux

Kali Linux is a Debian-derived Linux distribution designed for digital forensics and penetration testing. There are several ways of getting it installed on Android to leverage the hacking tools in Termux.

Tool-X

From Termux terminal, let’s use Tool-X to install Kali Linux tools.

I log in to my Android phone using SSH. The user name and IP address are specific to my setup.

# ssh -p 8022 u0_a196@192.168.0.116

From the Termux shell, follow these instructions to install Tool-X

# apt-update
# apt-install git
# git clone https://github.com/rajkumardusad/Tool-X.git
# cd Tool-X
# chmod +x install
# ./install
Tool-X Installation Screen

Once Tool-X is installed, to start it just enter Tool-X

# Tool-X
Tool-X Menu

And now you can install all the tools for ethical hacking.

Tool-X Hacking Tools

AnLinux

AnLinux provides various Linux distros including Kali Linux. I am going to use it to install Kali Linux with XFCE4 desktop environment.

From the Termux terminal, let’s install Kali Linux using the provided distro.

# pkg install wget openssl-tool proot -y && hash -r && wget https://raw.githubusercontent.com/EXALAB/AnLinux-Resources/master/Scripts/Installer/Kali/kali.sh && bash kali.sh

Once installed there will be a file called start-kali.sh in the HOME folder. Run this file to start Kali Linux.

# $HOME/start-kali.sh

Once I am in the Kali Linux console, let’s proceed to install XFCE4 desktop environment. (Note: This way take awhile to install)

# wget https://raw.githubusercontent.com/EXALAB/AnLinux-Resources/master/Scripts/DesktopEnvironment/Apt/Xfce4/de-apt-xfce4.sh && bash de-apt-xfce4.sh

As part of the installation, I need to configure keyboard layout and password for VNC server.

The default VNC server script uses display no 1. You need to change it if necessary. The scripts are located at /usr/local/bin.

Start VNC server and check the log file under /root/.vnc to make sure there is no error.

# vncserver-start

Using TigerVNC viewer, I can then connect remotely to my Android device running Kali Linux.

TigerVNC Viewer
Kali Linux running on Android

To stop VNC server.

# vncserver-stop

Bonus

BusyBox

BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides replacements for most of the utilities you usually find in GNU fileutils, shellutils, etc

# pkg install busybox

See the man page on what BusyBox can do.

BusyBox on Termux

CMatrix

CMatrix is based on the screensaver from The Matrix website. It shows text flying in and out in a terminal like as seen in “The Matrix” movie.

# pkg install cmatrix
CMatrix on Termux

sl

See a steam locomotive running across your screen.

# pkg install sl
Running Steam Locomotive on Termux

Fancy Text Tools

Utilities to generate fancy text.

# pkg install toilet cowsay figlet
cowsay on Termux
toilet on Termux

termux-setup-storage

Set up termux-setup-storage to access Android storage from within Termux.

w3m

Install a text based browser.

# pkg install w3m
w3m Text Based Browser

ArchLinux

If you need Arch Linux, you can follow the instructions at the link below to setup TermuxArch.

Programmer and occasional blogger.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store