1
1
#! /data/data/com.termux/files/usr/bin/bash
2
- echo " ##############################################"
3
- echo " "
4
- echo " Original source: https://github.com/Hax4us/Metasploit_termux"
5
- echo " ##############################################"
2
+ # Forked from: https://github.com/Hax4us/Metasploit_termux
3
+ clear
4
+ echo "
5
+ +-+-+-+-+-+-+-+-+-+-+ +-+-+ +-+-+-+-+-+-+
6
+ |M|e|t|a|s|p|l|o|i|t| |i|n| |T|e|r|m|u|x|
7
+ +-+-+-+-+-+-+-+-+-+-+ +-+-+ +-+-+-+-+-+-+
8
+ +-+-+ +-+-+-+-+-+-+-+-+-+-+
9
+ |b|y| |G|u|s|h|m|a|z|u|k|o|
10
+ +-+-+ +-+-+-+-+-+-+-+-+-+-+
11
+ "
6
12
7
- # Metasploit version
8
- msf_ver=5.0.40
13
+ center () {
14
+ termwidth=$( stty size | cut -d" " -f2)
15
+ padding=" $( printf ' %0.1s' ={1..500}) "
16
+ printf ' %*.*s %s %*.*s\n' 0 " $(( (termwidth- 2 - ${# 1} )/ 2 )) " " $padding " " $1 " 0 " $(( (termwidth- 1 - ${# 1} )/ 2 )) " " $padding "
17
+ }
9
18
10
- echo " WAIT UNTIL INSTALLING............"
19
+ # Loading spinner
20
+ center " Loading..."
21
+ source <( echo " c3Bpbm5lcj0oICd8JyAnLycgJy0nICdcJyApOwoKY291bnQoKXsKICBzcGluICYKICBwaWQ9JCEKICBmb3IgaSBpbiBgc2VxIDEgMTBgCiAgZG8KICAgIHNsZWVwIDE7CiAgZG9uZQoKICBraWxsICRwaWQgIAp9CgpzcGluKCl7CiAgd2hpbGUgWyAxIF0KICBkbyAKICAgIGZvciBpIGluICR7c3Bpbm5lcltAXX07IAogICAgZG8gCiAgICAgIGVjaG8gLW5lICJcciRpIjsKICAgICAgc2xlZXAgMC4yOwogICAgZG9uZTsKICBkb25lCn0KCmNvdW50" | base64 -d)
11
22
12
- echo " #################################### "
13
- pkg install -y autoconf bison clang coreutils curl findutils apr apr-util postgresql openssl readline libffi libgmp libpcap libsqlite libgrpc libtool libxml2 libxslt ncurses make ruby ncurses-utils ncurses git wget unzip zip tar termux-tools termux-elf-cleaner pkg-config
14
- pkg upgrade
15
- echo " #################################### "
23
+ echo
24
+ center " *** Dependencies installation... "
25
+ pkg upgrade -y -o Dpkg::Options::= " --force-confnew "
26
+ pkg install -y autoconf bison clang coreutils curl findutils apr apr-util postgresql openssl readline libffi libgmp libpcap libsqlite libgrpc libtool libxml2 libxslt ncurses make ruby ncurses-utils ncurses git wget unzip zip tar termux-tools termux-elf-cleaner pkg-config git -o Dpkg::Options::= " --force-confnew "
16
27
17
- echo " Fix ruby BigDecimal....."
18
- source <( curl -L https://github.com/termux/termux-packages/files/2912002/fix-ruby-bigdecimal.sh.txt)
28
+ echo
29
+ center " *** Fix ruby BigDecimal"
30
+ source <( curl -sL https://github.com/termux/termux-packages/files/2912002/fix-ruby-bigdecimal.sh.txt)
19
31
20
- echo -e " \nDownloading & Extracting....."
32
+ echo
33
+ center " *** Erasing old metasploit folder..."
34
+ rm -rf $HOME /metasploit-framework
21
35
36
+ echo
37
+ center " *** Downloading..."
22
38
cd $HOME
23
- curl -LO https://github.com/rapid7/metasploit-framework/archive/$msf_ver .tar.gz
24
- tar -xf $HOME /$msf_ver .tar.gz
39
+ git clone https://github.com/rapid7/metasploit-framework.git
25
40
26
- echo " Erasing old metasploit folder....."
27
- rm -rf $HOME /metasploit-framework
28
- mv $HOME /metasploit-framework-$msf_ver $HOME /metasploit-framework
29
- rm $HOME /$msf_ver .tar.gz
41
+ echo
42
+ center " *** Installation..."
30
43
cd $HOME /metasploit-framework
31
44
sed ' /rbnacl/d' -i Gemfile.lock
32
45
sed ' /rbnacl/d' -i metasploit-framework.gemspec
33
46
gem install bundler
34
47
sed ' s|nokogiri (1.*)|nokogiri (1.8.0)|g' -i Gemfile.lock
35
48
36
49
gem install nokogiri -v 1.8.0 -- --use-system-libraries
37
-
38
- # sed 's|grpc (.*|grpc (1.4.1)|g' -i $HOME/metasploit-framework/Gemfile.lock
39
- # gem unpack grpc -v 1.4.1
40
- # cd grpc-1.4.1
41
- # curl -LO https://raw.githubusercontent.com/grpc/grpc/v1.4.1/grpc.gemspec
42
- # curl -L https://raw.githubusercontent.com/Hax4us/Hax4us.github.io/master/extconf.patch
43
- # patch -p1 < extconf.patch
44
- # gem build grpc.gemspec
45
- # gem install grpc-1.4.1.gem
46
- # cd ..
47
- # rm -r grpc-1.4.1
48
50
49
-
50
- cd $HOME /metasploit-framework
51
51
gem install actionpack
52
52
bundle update activesupport
53
+ bundle update --bundler
53
54
bundle install -j5
54
55
$PREFIX /bin/find -type f -executable -exec termux-fix-shebang \{\} \;
55
56
rm ./modules/auxiliary/gather/http_pdf_authors.rb
62
63
ln -s $HOME /metasploit-framework/msfconsole /data/data/com.termux/files/usr/bin/
63
64
ln -s $HOME /metasploit-framework/msfvenom /data/data/com.termux/files/usr/bin/
64
65
termux-elf-cleaner /data/data/com.termux/files/usr/lib/ruby/gems/2.4.0/gems/pg-0.20.0/lib/pg_ext.so
65
- echo " Creating database"
66
66
67
+ echo
68
+ center " *** Database configuration..."
67
69
cd $HOME /metasploit-framework/config
68
- curl -LO https://raw.githubusercontent.com/gushmazuko/metasploit_in_termux/master/database.yml
70
+ curl -sLO https://raw.githubusercontent.com/gushmazuko/metasploit_in_termux/master/database.yml
69
71
70
72
mkdir -p $PREFIX /var/lib/postgresql
71
73
initdb $PREFIX /var/lib/postgresql
@@ -75,11 +77,10 @@ createuser msf
75
77
createdb msf_database
76
78
77
79
cd $HOME
78
- curl -LO https://raw.githubusercontent.com/gushmazuko/metasploit_in_termux/master/postgresql_ctl.sh
80
+ curl -sLO https://raw.githubusercontent.com/gushmazuko/metasploit_in_termux/master/postgresql_ctl.sh
79
81
chmod +x postgresql_ctl.sh
80
82
81
- echo " ####################################"
82
- echo " Thanx To Hax4us"
83
- echo " ####################################"
84
- echo " NOW YOU CAN LAUNCH METASPLOIT BY JUST EXECUTE THE COMMAND :=> msfconsole"
85
- echo " ####################################"
83
+ echo
84
+ center " *"
85
+ echo -e " \033[32m Installation complete. \n To start msf database use: ./postgresql_ctl.sh start \n Launch metasploit by executing: msfconsole\033[0m"
86
+ center " *"
0 commit comments