Termux Hacking Setup Guide[2021 and beyond]

THIS POST IS AN UPDATE TO AN OLDER POST BY ME. See here

Post Creating Date: 9th December 2021

Prerequisites to the Guide:

  1. A Fast and stable Internet connection(10mbps minimum)
  2. An Android device running Android 8.1 or above.
  3. A Hackersploit forum account(Make one! this place is awesome)
  4. A loving Girlfriend/Boyfriend(OPTIONAL) :upside_down_face:
  5. Hot Steaming Pizza(required and recommended) :yum:

If you think Ethical Hacking is only restricted to the use of Desktops or Laptops, for that matter, think again because if you have observed the way I did, third-party developers have been playing a huge role in filling gaps during each stage of Technological Evolution. This guide will combine various Termux hacks, termux tutorials, termux wifi hack commands list, termux guide, termux tools, apk & packages & termux uses.

A Third Party developer called “Fredrik Fornwall” has developed a Linux-self contained App called Termux used to install Linux-based apps in Android and helps in running pure Linux apps in Android.

Now you will be wondering why do I need LINUX apps?

LINUX has a history of being programmer-centric, so the TERMUX app aims to help Cyber Security professionals monitor systems and Cyber Security practices like Penetration Testing through Mobile Networks.

Compared to the millions of apps in Google Play Store, which in Mr. Peters’s words are considered “ports” of Linux applications made in an Android way, TERMUX is a pure LINUX app having a platform-independent architecture making it portable and compatible with even Windows.

Before we continue, a simple line explanation on its UI: its UI is command-line interface based.

Think MS-DOS and all those computers of yesteryears that came before Windows and macOS, and you will know what I am talking about. No shiny icons or instructions. Just you and your skills.

PS. I have combined the info available on various websites/pages/repositories in one place in the proper sequence to make the process less time-consuming.

ALL THE CREDIT OF THE COMMANDS/SOFTWARE/TOOLS/TECHNIQUES GO TO THE ORIGINAL OWNER(S)/DEVELOPER(S)

Lets Begin:

The first step is to install Termux, times have changed since my last post, now the only sane way to install Termux is by using F-droid, DO NOT TRY TO FOLLOW ON Google Play Store Version of the Application as it will break the application and will not under any circumstance work with this guide.

After the install and opening run:

apt update && apt upgrade type y for ‘yes’ whenever asked to.

then just for safety run: pkg update && pkg upgrade

then run: pkg install unstable-repo root-repo && pkg update

then:

(this might take a min or so based on the speed of your internet connection)
pkg upgrade && touch .hushlogin && pkg install python cmake nodejs ruby golang nmap tsu

then:

pkg update && pkg upgrade -y && pkg install wget curl openssh git -y

after that
mkdir bb ctf re tools test notes gh homework temp

Next is configuring the dotfiles
cd gh && git clone https://github.com/konradit/dotfiles.git && cp dotfiles/bashrc ~/.bashrc

Then

pkg install coreutils termux-api termux-exec termux-tools grep tree termux-auth play-audio libandroid-support vim ncurses-utils openssh w3m && pkg upgrade

Then
termux-setup-storage – please grant the permission when it pops up

then:

pip3 install wheel thefuck

then:

nano ~/.bashrc

go towards the bottom and delete the last line which says something like “thefuck --alias” if you cannot find this line restart your termux ignore the errors and then remove the line.

CTRL+O ENTER CTRL+X

THAT IS IT! now restart the app and things should look something like this:

if you have root type:
tsu and allow access [DO NOT USE THE su COMMAND IT CAUSES A LOT OF PROBLEMS AND NEVER INSTALL OR UPDATE ANYTHING WHILE BEING ROOT!!]

(this might take a min or so based on the speed of your internet connection)
if you want to install Metasploit just type: source <(curl -fsSL https://kutt.it/msf)

after installation:

Inside the metasploit-framework folder run ./msfdb init DONE!!!

DO NOT USE VARIOUS METASPLOIT INSTALLATION SCRIPTS AVAILABLE ONLINE UNLESS YOU OPENED THEM AND UNDERSTOOD WHAT THEY DO!!

OPTIONAL: SWITCH TO ZSH:

Here we follow official sources:

first:

pkg install zsh

run: (ONLY RUN ONE OF THEM)

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
OR
sh -c "$(wget -O- https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Add the following in the zshrc file(if you want): HIGHLY OPTIONAL

plugins=(git adb aliases archlinux colored-man-pages command-not-found encode64 last-working-dir)

source $ZSH/oh-my-zsh.sh

# User configuration

export MANPATH="/usr/local/man:$MANPATH"

# Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then
   export EDITOR='vim'
else
   export EDITOR='nvim'
fi

LS_COLORS='no=00;37:fi=00:di=00;33:ln=04;36:pi=40;33:so=01;35:bd=40;33;01:'
export LS_COLORS
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
alias ll="ls -llah"
alias l="ls"
alias rm="rm -rf"
alias cp="cp -r"
alias lll="exa -abghHliS"
alias lr='ls -tRFh'   #sorted by date,recursive,show type,human readable
alias lt='ls -ltFh'   #long list,sorted by date,show type,human readable
alias ldot='ls -ld .*'
alias lS='ls -1FSsh'
alias lart='ls -1Fcart'
alias lrt='ls -1Fcrt'
alias zshrc='${=EDITOR} ${ZDOTDIR:-$HOME}/.zshrc' # Quick access to the .zshrc file
alias grep='grep --color'
alias sgrep='grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} '
alias t='tail -f'
(( $+commands[fd] )) || alias fd='find . -type d -name'
alias ff='find . -type f -name'
alias h='history'
alias hgrep="fc -El 0 | grep"
alias help='man'
alias p='ps -f'
alias sortnr='sort -n -r'
alias unexport='unset'
alias mv='mv -i'
# Make zsh know about hosts already accessed by SSH
zstyle -e ':completion:*:(ssh|scp|sftp|rsh|rsync):hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) /dev/null)"}%%[# ]*}//,/ })'

# zsh is able to auto-do some kungfoo
# depends on the SUFFIX :)
autoload -Uz is-at-least
if is-at-least 4.2.0; then
  # open browser on urls
  if [[ -n "$BROWSER" ]]; then
    _browser_fts=(htm html de org net com at cx nl se dk)
    for ft in $_browser_fts; do alias -s $ft='$BROWSER'; done
  fi

  _editor_fts=(cpp cxx cc c hh h inl asc txt TXT tex)
  for ft in $_editor_fts; do alias -s $ft='$EDITOR'; done

  if [[ -n "$XIVIEWER" ]]; then
    _image_fts=(jpg jpeg png gif mng tiff tif xpm)
    for ft in $_image_fts; do alias -s $ft='$XIVIEWER'; done
  fi

  _media_fts=(ape avi flv m4a mkv mov mp3 mpeg mpg ogg ogm rm wav webm)
  for ft in $_media_fts; do alias -s $ft=mplayer; done

  #read documents
  alias -s pdf=acroread
  alias -s ps=gv
  alias -s dvi=xdvi
  alias -s chm=xchm
  alias -s djvu=djview

  #list whats inside packed file
  alias -s zip="unzip -l"
  alias -s rar="unrar l"
  alias -s tar="tar tf"
  alias -s tar.gz="echo "
  alias -s ace="unace l"
fi
alias myip='curl http://ipecho.net/plain; echo'
alias distro='cat /etc/*-release'
alias reload='source ~/.zshrc'
export LC_ALL=en_US.utf8
export PATH="~/.local/share/gem/ruby/3.0.0/bin/:$PATH"
export PATH="~/.local/share/gem/ruby/3.0.0/bin:$PATH"
export PATH="/usr/lib/john:$PATH"
export PATH="~/.cargo/bin:$PATH"

The root repos will let you install the following :

  1. aircrack-ng
  2. arp-scan
  3. tcpdump
    …ETC

A great person had once said: “With great power comes great responsibility” . Maintaining peace in Society is our responsibility. That’s why when you use apps like TERMUX do it for educational purposes and not for causing harm to anyone. Even before you think about committing such acts, spare a thought for your parents.

Happy Hacking!

Points to note:
1. YES, I am aware that there is little to no point in running so many updates and upgrades, but in my experience doing it like this seems to provide better results on older hardware.
2. I am not taking responsibility for any actions done using the knowledge provided in this guide or otherwise.
3. There are no guarantees.
4. Feel free to ask below this post if you get stuck or encounter an issue(use proper formatting and language when doing so)
5. Always use your own discretion when downloading/installing scripts and binaries on your android system especially when it is rooted.

Excellent guide, thank you very much for posting this.

1 Like