├── LICENSE ├── MSF-ArchInstaller.sh └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 teravice 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MSF-ArchInstaller.sh: -------------------------------------------------------------------------------- 1 | echo 'Initializing installation of Metasploit Framework from Github.' 2> ~/LOGFILE.txt 2 | echo "Installation started from $USER at $HOSTNAME at " 2>> ~/LOGFILE.txt 3 | date 2>> ~/LOGFILE.txt 4 | 5 | 6 | echo '***********************************************************' 7 | echo '* Metasploit Framework Git Installer for Arch Linux *' 8 | echo '* brought to you by qucrypt. Distributed under GPLv3 *****' 9 | echo '* qucrypt[at]0x3f.dev**************************************' 10 | echo '***********************************************************' 11 | echo '' 12 | 13 | echo '***********************************************************' 14 | echo '* Checking if system is up to date, updating(if necessary)*' 15 | echo '* and installing dependancies... **************************' 16 | echo '***********************************************************' 17 | echo '' 18 | sudo pacman -Syyu --noconfirm 2>> ~/LOGFILE.txt 19 | 20 | 21 | sudo pacman -S --needed --noconfirm wget git gcc patch curl zlib readline autoconf automake diffutils make libtool bison subversion gnupg postgresql python python2-pysqlite-legacy gtk2 pygtk libpcap jdk7-openjdk 2>> ~/LOGFILE.txt 22 | 23 | 24 | echo '***********************************************************' 25 | echo '* Creating installation directory ~/dev *******************' 26 | echo '* and proceeding with the svn download and installation ***' 27 | echo '* of nmap. ************************************************' 28 | echo '***********************************************************' 29 | echo '' 30 | 31 | mkdir ~/dev 32 | 33 | cd ~/dev 34 | 35 | svn co https://svn.nmap.org/nmap 2>> ~/LOGFILE.txt 36 | 37 | cd nmap 38 | 39 | ./configure 2>> ~/LOGFILE.txt 40 | 41 | make 2>> ~/LOGFILE.txt 42 | 43 | sudo make install 2>> ~/LOGFILE.txt 44 | 45 | make clean 2>> ~/LOGFILE.txt 46 | 47 | 48 | echo '***********************************************************' 49 | echo '* We are now goint to check whether en_US.UTF8 locale *' 50 | echo '* is set. We are going to use nano again. If needed *' 51 | echo '* the file /etc/locale.gen will be opened. You have to *' 52 | echo '* remove the # that are in front of en_US.UTF-8 UTF-8 *' 53 | echo '* and en_US ISO-8859-1. Then hit Ctrl+O and Ctrl+X *' 54 | echo '***********************************************************' 55 | echo '' 56 | 57 | read -p "* Press [Enter] key to continue...*************************" 58 | 59 | if ! ( locale -a | grep "en_US.utf8" ) ; then 60 | echo "* Locales not found. 61 | Generating...*************************" 62 | sudo nano /etc/locale.gen 63 | sudo locale-gen 2>> ~/LOGFILE.txt 64 | else 65 | echo "* Locales found. Nothing to do here. 66 | **********************" 67 | fi 68 | 69 | 70 | echo '***********************************************************' 71 | echo '* Setting up postgresql. Starting, enabling and creating **' 72 | echo '* the user msf and the database msf.***********************' 73 | echo '***********************************************************' 74 | echo '' 75 | 76 | sudo -s 77 | 78 | chown -R postgres:postgres /var/lib/postgres/ 2>> ~/LOGFILE.txt 79 | 80 | su postgres 81 | 82 | initdb --locale en_US.UTF-8 -D '/var/lib/postgres/data' 2>> ~/LOGFILE.txt 83 | 84 | exit 85 | 86 | systemctl start postgresql 2>> ~/LOGFILE.txt 87 | 88 | systemctl enable postgresql 2>> ~/LOGFILE.txt 89 | 90 | su postgres 91 | 92 | createuser msf -P -S -R -D 2>> ~/LOGFILE.txt 93 | 94 | createdb -O msf msf 2>> ~/LOGFILE.txt 95 | 96 | exit 97 | 98 | exit 99 | 100 | cd ~/dev 101 | 102 | echo '***********************************************************' 103 | echo '* Cloning Metasploit Framework from Github. ***************' 104 | echo '* After cloning is complete,bundle install will be run so *' 105 | echo '* all the required gems will be installed directly. *******' 106 | echo '***********************************************************' 107 | echo '' 108 | git clone https://github.com/rapid7/metasploit-framework.git 2>> ~/LOGFILE.txt 109 | 110 | cd metasploit-framework 111 | 112 | 113 | echo '***********************************************************' 114 | echo '* Downloading,compiling & installing RVM. *****************' 115 | echo '***********************************************************' 116 | echo '' 117 | 118 | curl -sSL https://rvm.io/mpapis.asc | gpg --import - 2>> ~/LOGFILE.txt 119 | 120 | curl -L https://get.rvm.io | bash -s stable 121 | 122 | echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc 123 | 124 | source ~/.rvm/scripts/rvm 125 | 126 | rvm install 2.3.3 127 | 128 | rvm use 2.3.3 --default 129 | 130 | 131 | echo '***********************************************************' 132 | echo '* Installing basic gems that we will need. ****************' 133 | echo '* wirble **************************************************' 134 | echo '* sqlite3 *************************************************' 135 | echo '* bundler *************************************************' 136 | echo '***********************************************************' 137 | echo '' 138 | 139 | gem install wirble sqlite3 bundler 2>> ~/LOGFILE.txt 140 | 141 | bundle install 2>> ~/LOGFILE.txt 142 | 143 | sudo chmod a+r ~/.rvm/gems/ruby-2.3.3/gems/robots-0.10.1/lib/robots.rb 144 | 145 | 146 | echo '***********************************************************' 147 | echo '* Creating simlinks for msf executables at /usr/local/bin *' 148 | echo '* Creating database.yml file with all the settings so that*' 149 | echo '* msfconsole can connect to postgres automatically. *******' 150 | echo '***********************************************************' 151 | echo '' 152 | 153 | sudo bash -c 'for MSF in $(ls msf*); do ln -s $PWD/$MSF /usr/local/bin/$MSF;done' 2>> ~/LOGFILE.txt 154 | 155 | sudo echo -e 'production:\n adapter: postgresql\n database: msf\n username: msf\n password: \n host: 127.0.0.1\n port: 5432\n pool: 75\n timeout: 5\n' > ~/dev/metasploit-framework/config/database.yml 2>> ~/LOGFILE.txt 156 | 157 | sudo sh -c "echo export MSF_DATABASE_CONFIG=~/dev/metasploit-framework/config/database.yml >> /etc/profile" 2>> ~/LOGFILE.txt 158 | 159 | source /etc/profile 160 | 161 | echo '***********************************************************' 162 | echo '* Downloading the latest version of Armitage. *************' 163 | echo '* After the download is complete armitage will be *' 164 | echo '* installed and linked properly.*' 165 | echo '***********************************************************' 166 | echo '' 167 | 168 | 169 | curl -# -o ~/dev/armitage.tgz http://www.fastandeasyhacking.com/download/armitage150813.tgz 2>> ~/LOGFILE.txt 170 | 171 | tar -xvzf ~/dev/armitage.tgz -C ~/dev 2>> ~/LOGFILE.txt 172 | 173 | sudo ln -s ~/dev/armitage/armitage /usr/local/bin/armitage 2>> ~/LOGFILE.txt 174 | 175 | sudo ln -s ~/dev/armitage/teamserver /usr/local/bin/teamserver 2>> ~/LOGFILE.txt 176 | 177 | sh -c "echo java -jar ~/dev/armitage/armitage.jar \$\* > ~/dev/armitage/armitage" 2>> ~/LOGFILE.txt 178 | 179 | sudo perl -pi -e 's/armitage.jar/~\/dev\/armitage\/armitage.jar/g' ~/dev/armitage/teamserver 2>> ~/LOGFILE.txt 180 | 181 | 182 | echo '***********************************************************' 183 | echo '* Congratulations! Setup is complete. If something is not *' 184 | echo '* working properly check ~/LOGFILE.txt for errors and post*' 185 | echo '* them to https://github.com/teravice/MSF-ArchInstaller *' 186 | echo '* This is a new project so every help provided is much *' 187 | echo '* appreciated. *' 188 | echo '***********************************************************' 189 | echo '' 190 | echo '' 191 | 192 | echo '***********************************************************' 193 | echo ' # # ### ##### ##### ' 194 | echo ' # # # # # # # ' 195 | echo ' # # # # # ' 196 | echo ' ### # ##### ##### ' 197 | echo ' # # # # # ' 198 | echo ' # # # # # # # ' 199 | echo ' # # ### ##### ##### ' 200 | echo '***********************************************************' 201 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### MSF-ArchInstaller 2 | 3 | ###### The purpose of this script is simplifying the process of installing Metasploit Framework on Arch Linux, directly from git. 4 | 5 | The script will : 6 | 7 | * check is the system is up to date and install dependencies 8 | 9 | and then download, configure and install: 10 | 11 | * ruby using RVM 12 | 13 | * nmap from SVN 14 | 15 | * Metasploit Framework from Git 16 | 17 | * Postgresql 18 | 19 | * Armitage 20 | 21 | 22 | #####This project is distributed under MIT. 23 | --------------------------------------------------------------------------------