Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #pretty stuff I want but don't need atm
- #ui tweaks
- #set desktop wallpaper
- #turn off desktop icons
- #gsettings set org.gnome.desktop.background show-desktop-icons false
- #tweak plymouth
- #enable transparent top bar
- #set xterm to transparent and green
- #shit I need that should already be done...
- #install backtrack/kali tools in mainline
- #TODO
- #add REINSTALL variable to bypass "already tried to install checks"
- #checksum verification for all http fetches
- function enable_pi_rho(){
- if [ -e "/etc/apt/sources.list.d/pi-rho-security-precise.list" ]
- then
- echo "Already enabled pi-rho"
- else
- sudo apt-add-repository ppa:pi-rho/security
- fi
- }
- function enable_qt5(){
- if [ -e "/etc/apt/sources.list.d/ubuntu-sdk-team-ppa-precise.list" ]
- then
- echo "Already enabled qt5"
- else
- sudo apt-add-repository ppa:ubuntu-sdk-team/ppa
- fi
- }
- function enable_webupd8(){
- if [ -e "/etc/apt/sources.list.d/webupd8team-sublime-text-2-precise.list" ]
- then
- echo "Already enabled sublime-text-2"
- else
- sudo apt-add-repository ppa:webupd8team/sublime-text-2
- fi
- }
- function enable_schadenfreude(){
- #I'm forking some repos and using source tracking a automated builds to make things work better
- #as it should be done. When I get all the builds migrated to automated, everything will be running
- #from head.
- #For now, it's just a couple of binary tools. Python tools don't need this because of virtualenv
- #Ruby tools don't need this because of rvm
- if [ -e "/etc/apt/sources.list.d/d-schadenfreude-007-sectools-precise.list" ]
- then
- echo "Already enabled schadenfreude"
- else
- sudo apt-add-repository ppa:d-schadenfreude-007/sectools
- fi
- }
- function enable_per_user(){
- if [ ! -d $HOME"/bin" ]
- then
- mkdir ~/bin
- fi
- }
- function apt_update(){
- sudo apt-get update > /dev/null
- sudo apt-get upgrade -y > /dev/null
- sudo apt-get dist-upgrade -y > /dev/null
- }
- function install_dev_tools(){
- sudo apt-get install -y git mercurial subversion sublime-text build-essential iw bzr-builder pbuilder debhelper > /dev/null
- }
- function install_baseline(){
- enable_per_user
- enable_pi_rho
- enable_qt5
- enable_webupd8
- enable_schadenfreude
- apt_update
- install_dev_tools
- #this is only here for the time being. it will be moved to the relevant function or functions eventually
- sudo apt-get install -y nmap > /dev/null
- sudo apt-get install -y -f nmap-data > /dev/null
- sudo apt-get install -y aircrack-ng kismet amap python-distorm3 hydra nmap > /dev/null
- apt_update
- }
- function install_thc_tools(){
- sudo apt-get install -y thc-ipv6 > /dev/null
- }
- function dns_packaged(){
- sudo apt-get install -y dnstracer dnswalk > /dev/null
- }
- function install_dnsenum(){
- cd ~/
- mkdir recon
- cd recon
- wget https://dnsenum.googlecode.com/files/dnsenum-1.2.2.tar.gz
- tar xvf dnsenum-1.2.2.tar.gz
- }
- function install_w3af_deps(){
- sudo apt-get install -y graphviz python2.7-dev libsqlite3-dev \
- libxslt1-dev python-gtksourceview2 libxml2-dev libcairo2-dev \
- python-gtk2 > /dev/null
- }
- function install_w3af(){
- cd ~/
- if [ ! -d "virtual_env/w3af" ]
- then
- mkdir virtual_env
- cd virtual_env
- virtualenv w3af
- cd w3af
- source bin/activate
- git clone https://github.com/andresriancho/w3af.git
- pip install clamd PyGithub GitPython pybloomfiltermmap \
- esmre nltk chardet pdfminer futures pyOpenSSL lxml \
- scapy-real guess-language cluster msgpack-python \
- python-ntlm xdot
- pip install -e git+git://github.com/ramen/phply.git#egg=phply
- ln -sf /usr/lib/python2.7/dist-packages/{glib,gobject,cairo,gtk-2.0,pygtk.py,pygtk.pth,gtksourceview2.so} lib/python2.7/site-packages
- deactivate
- fi
- }
- function install_rvm(){
- if grep -q "source /usr/local/rvm/scripts/rvm" ~/.bashrc
- then
- echo 'Already tried to install RVM'
- else
- echo 'source /usr/local/rvm/scripts/rvm' >> ~/.bashrc
- curl -L https://get.rvm.io | sudo bash -s stable --autolibs=enabled --ruby=1.9.3
- source /usr/local/rvm/scripts/rvm
- sudo usermod -a -G rvm `whoami`
- sg rvm -c "source /usr/local/rvm/scripts/rvm && rvm install 1.9.3-p448 && rvm --default 1.9.3-p448"
- echo 'You need to logout and log back in...'
- exit
- fi
- }
- function install_metasploit_deps(){
- sudo apt-get -y install \
- build-essential zlib1g zlib1g-dev \
- libxml2 libxml2-dev libxslt-dev locate \
- libreadline6-dev libcurl4-openssl-dev git-core \
- libssl-dev libyaml-dev openssl autoconf libtool \
- ncurses-dev bison curl wget postgresql \
- postgresql-contrib libpq-dev \
- libapr1 libaprutil1 libsvn1 \
- libpcap-dev > /dev/null
- install_rvm
- }
- function configure_postgres(){
- if sudo grep -q 'host "msf_database" "msf_user" 127.0.0.1/32 md5' /etc/postgresql/9.1/main/pg_hba.conf
- then
- echo "Already tried to configure database"
- else
- sudo cp /etc/postgresql/9.1/main/pg_hba.conf /etc/postgresql/9.1/main/pg_hba.conf.old
- sudo sed -i 's/host all all 127.0.0.1\/32 md5/host "msf_database" "msf_user" 127.0.0.1\/32 md5\nhost all all 127.0.0.1\/32 ident/' /etc/postgresql/9.1/main/pg_hba.conf
- sudo -u postgres createuser -l -S -D -R msf_user
- sudo -u postgres psql -c "ALTER USER msf_user WITH PASSWORD 'no_password';"
- sudo -u postgres createdb --owner=msf_user msf_database
- sudo service postgresql restart
- cd ~/metasploit-framework
- cat > config/database.yml << EOF
- production:
- adapter: postgresql
- database: msf_database
- username: msf_user
- password: no_password
- host: 127.0.0.1
- port: 5432
- pool: 75
- timeout: 5
- EOF
- cat > ~/.msf4/msfconsole.rc << EOF
- db_connect -y `pwd`/config/database.yml
- workspace -a Workspace
- EOF
- fi
- }
- function install_metasploit(){
- install_metasploit_deps
- cd ~/
- if [ ! -d "metasploit-framework" ]; then
- git clone https://github.com/rapid7/metasploit-framework.git
- echo "rvm use 1.9.3-p448@msf --create" > metasploit-framework/.rvmrc
- cd metasploit-framework
- gem install bundler
- bundle install
- fi
- configure_postgres
- }
- function install_rapid7(){
- install_w3af
- install_metasploit
- }
- function install_armitage(){
- cd ~/
- if [ ! -d 'armitage' ]
- then
- #It's not available via https
- wget http://www.fastandeasyhacking.com/download/armitage20130605.tgz > /dev/null
- tar xvf armitage20130605.tgz
- echo "export MSF_DATABASE_CONFIG=`pwd`/config/database.yml" >> .bashrc
- else
- echo "Already tried to install armitage"
- fi
- }
- function install_burp(){
- cd ~/
- if [ ! -d 'webapp/burp' ]
- then
- mkdir -p webapp/burp/burp
- cd webapp/burp/burp
- wget http://portswigger.net/burp/burpsuite_free_v1.5.jar
- mkdir -p ../extender/burp
- cd ../extender/burp
- wget http://portswigger.net/burp/extender/api/burp_extender_api.zip
- unzip burp_extender
- mkdir ../jython
- cd ../jython
- wget http://search.maven.org/remotecontent?filepath=org/python/jython/2.7-b1/jython-2.7-b1.jar
- cd ~/bin
- cat > burp << EOF
- #!/bin/bash
- cd ~/webapp/burp/burp
- java -jar -Xmx1024m burpsuite_free_v1.5.jar
- EOF
- chmod +x burp
- else
- echo "Already tried to get Burp suite, extender, and jython"
- fi
- }
- function install_zap(){
- echo "Zap installation not implemented"
- #https://code.google.com/p/zaproxy/
- echo "Extension grabbing not yet implemented"
- #https://code.google.com/p/zap-extensions/downloads/list
- }
- function install_dns(){
- dns_packaged
- install_thc_tools
- }
- function install_ids_ips(){
- echo 'idsips is empty function atm'
- }
- function install_livehost_packaged(){
- sudo apt-get install -y arping > /dev/null
- }
- function install_livehost(){
- install_thc_tools
- }
- function install_webapp(){
- install_w3af_deps
- install_w3af
- install_burp
- install_zap
- }
- function install_stalkery_stuff(){
- sudo apt-get install creepy -y > /dev/null
- #Maltego - Need to hook up the download to a proxy and get a link...
- #http://www.paterva.com/web6/products/download4.php
- #Casefile - Need to hook up the download to a proxy and get a link...
- #http://www.paterva.com/web6/products/download4.php
- }
- function install_net_test(){
- install_metasploit
- install_armitage
- install_dns
- }
- function install_all(){
- install_baseline
- install_net_test
- install_webapp
- install_stalkery_stuff
- }
- install_all
Advertisement
Add Comment
Please, Sign In to add comment