diff --git a/install.sh b/install.sh index 99a85bab..57140182 100755 --- a/install.sh +++ b/install.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -# +# # RITA is brought to you by Offensive CounterMeasures. -# offensivecountermeasures.com +# offensivecountermeasures.com set -o errexit set -o pipefail @@ -15,23 +15,38 @@ __help() { Welcome to the RITA installer. -Usage: +Usage: ${_NAME} [] ${_NAME} -h | --help Options: -h --help Show this help message. -i --install-dir Directory to install to. - + +HEREDOC +} + +__prep() { + cat <> ~/.bashrc + + echo -e " +[+] Done! Now just need to configure Go dev environment... + + \e[0m" + + sleep 3s + + if [[ -z "${GOPATH}" ]]; + then + mkdir -p $HOME/go/{src,pkg,bin} + echo 'export GOPATH=$HOME/go' >> $HOME/.bashrc + export GOPATH=$HOME/go + echo 'export PATH=$PATH:$GOPATH/bin' >> $HOME/.bashrc + export PATH=$PATH:$GOPATH/bin + else + echo -e "[+] GOPATH seems to be set, we'll skip this part then for now + " + fi + + echo -e "[+] Now we need to get package key and MongoDB package... +" + + sleep 3s + + sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6 + + echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list + + sudo apt update + sudo apt install -y mongodb-org + + sudo mkdir -p /data/db + sudo chown -R $USER /data + + printf "[+] Running 'go get github.com/ocmdev/rita'\n\n" + + /usr/local/go/bin/go get github.com/ocmdev/rita + cd $GOPATH/src/github.com/ocmdev/rita + + printf "[+] Done! Now we just have to build and install RITA.\n" + /usr/local/go/bin/go build + /usr/local/go/bin/go install + + echo "[+] Make sure you also configure Bro and run with 'sudo broctl deploy' and make sure MongoDB is running with the command 'mongo' or 'sudo mongo'. +" + + + + echo -e " +[+] If you need to stop Mongo at any time, run 'sudo service mongod stop' +[+] In order to finish the installation, reload bash config with 'source ~/.bashrc'. +[+] Also make sure to start the mongoDB service with 'sudo service mongod start before running RITA. +[+] You can access the mongo shell with 'sudo mongo' +" + printf "[+] Transferring files\n" mkdir $_RITADIR - + cp -r etc $_RITADIR/etc cp LICENSE $_RITADIR/LICENSE @@ -78,6 +161,18 @@ __install() { fi fi + printf "[+] Installing gnu-netcat to /usr/local/rita\n" + # gnu-netcat + wget https://sourceforge.net/projects/netcat/files/netcat/0.7.1/netcat-0.7.1.tar.gz + tar -zxf netcat-0.7.1.tar.gz + rm netcat-0.7.1.tar.gz + cd netcat-0.7.1 + ./configure --prefix=/usr/local/rita + sudo make + sudo make install + cd .. + rm -rf netcat-0.7.1 + printf "Thank you for installing RITA!\n" printf "OCMDev Group projects IRC #ocmdev on OFTC\n" printf "Happy hunting\n" @@ -97,9 +192,9 @@ __entry() { fi # Check to see if the user has permission to install to this directory - if [ -w $_INSDIR ] + if [ -w $_INSDIR ] then - __install + __install else printf "You do NOT have permission to write to $_INSDIR\n\n" __help