HACK ANDROID PHONES

5
Hack Any Android device With Metasploit-Framework On Termux Without Having Root...

If you wish to install the metasploit-framework all by itself (damn you lazy people 😂) , You can use a shell script to install it.
cd $HOME
pkg install wget
wget https://Auxilus.github.io/metasploit.sh
bash metasploit.sh
This script will install the latest version of metasploit-framework.script also include some extras to make updating metasploit faster. If all goes well, i.e. No red colored warnings, you can start metasploit using ./msfconsole.

Manual Installation

Prequisities

Make sure you have these packages installed
pkg install autoconf bison clang coreutils curl findutils git apr apr-util libffi-dev libgmp-dev libpcap-dev \
    postgresql-dev readline-dev libsqlite-dev openssl-dev libtool libxml2-dev libxslt-dev ncurses-dev pkg-config \
    wget make ruby-dev libgrpc-dev termux-tools ncurses ncurses-utils libsodium-dev termux-exec
Clone the metasploit-framework repository
git clone https://github.com/rapid7/metasploit-framework
cd metasploit-framework
NOTE
Cloning repository is not recommended as it may have some bugs!
Or you can download and extract the latest source package
curl -L https://github.com/rapid7/metasploit-framework/archive/4.17.9.tar.gz | tar xz
cd metasploit-framework-4.17.9
sed 's|git ls-files|find -type f|' -i metasploit-framework.gemspec
Install bundler gem
gem install bundler

Install gems

Not all dependencies can be installed with bundler. Manual workarounds are needed to get them going.

nokogiri

nokogiri gem will try to compile its own libxml and libxslt, which does not work in Termux because the configure script has incorrect shebang. Instruct gem to use local libraries
gem install nokogiri -- --use-system-libraries
Read #69 and #79 to learn more.

All other dependencies can be easily installed with
bundle install -j5

Fix shebangs

Termux is a prefixed system, so, all executables are not available at /usr/bin. To fix this run $PREFIX/bin/find -type f -executable -exec termux-fix-shebang \{\} \;

Now you can run ./msfconsole

Meta2.png

Connect to Database

Metasploit-framework uses postgresql as database adapter. First we have to setup postgresql
cd $HOME/metasploit-framework/config
curl -LO https://Auxilus.github.io/database.yml
mkdir -p $PREFIX/var/lib/postgresql
initdb $PREFIX/var/lib/postgresql
pg_ctl -D $PREFIX/var/lib/postgresql start
createuser msf
createdb msf_database
(database is already done setting up if you are using automatic installation)