|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# runs set of setup commands to customize the system |
| 4 | +# default directory for custom tools is $HOME/pentest/tools |
| 5 | +# which you can override by passing the directory you want as 2nd argument |
| 6 | + |
| 7 | +TOOLS_ROOT_DIR=${1:$HOME/pentest/tools} |
| 8 | + |
| 9 | +is_debian() { |
| 10 | + [[ -f "/usr/bin/apt-get" ]] |
| 11 | +} |
| 12 | + |
| 13 | +is_rhel() { |
| 14 | + [[ -f "/usr/bin/yum" ]] |
| 15 | +} |
| 16 | + |
| 17 | +is_root() { |
| 18 | + [[ "$(id -u)" == "0" ]] |
| 19 | +} |
| 20 | + |
| 21 | +error() { |
| 22 | + msg="${1:-$default_err}" |
| 23 | + echo -e "${red}${msg}${nc}" |
| 24 | + exit 1 |
| 25 | +} |
| 26 | + |
| 27 | +msg() { |
| 28 | + msg="${1:-nothing}" |
| 29 | + echo -e "${green}${msg}${nc}" |
| 30 | +} |
| 31 | + |
| 32 | +is_root || error "Please run this script as a root user" |
| 33 | + |
| 34 | +if is_debian; then |
| 35 | + sudo add-apt-repository -y ppa:nathan-renniewaldock/flux |
| 36 | + sudo add-apt-repository -y ppa:neovim-ppa/stable |
| 37 | + sudo add-apt-repository -y ppa:hadret/fswatch |
| 38 | + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - |
| 39 | + curl https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add - |
| 40 | + echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list |
| 41 | + echo "deb http://www.apache.org/dist/cassandra/debian 311x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list |
| 42 | + apt update |
| 43 | + # forensics-all metapackage installs most of the forensic tools ranging from extundelete to yara |
| 44 | + # you can see all details by typing: apt-cache show forensics-all |
| 45 | + apt install -y build-essential git vim silversearcher-ag axel aircrack-ng pyrit reaver wifite zenmap thc-ipv6 \ |
| 46 | + nbtscan wireshark-qt tshark tcpdump vlan yersinia ettercap-text-only dsniff arp-scan ghex shutter whois \ |
| 47 | + lft gnupg medusa hydra hydra-gtk libstrongswan p7zip-full forensics-all steghide dmitry ophcrack nginx-full \ |
| 48 | + socat swftools ruby-dev libpcap-dev php7.0-cli php7.0-fpm mutt git-email esmtp sysdig inotify-tools \ |
| 49 | + exif exifprobe fluxgui neovim yarn fortune cowsay mpd mpc dstat htop libevent-dev clang-4.0 global \ |
| 50 | + python-pygments cassandra bison aspell aspell-en tig msr-tools gphoto2 gtkam \ |
| 51 | + avr-libc avrdude binutils-avr gcc-avr srecord gdb-avr simulavr \ |
| 52 | + pv ncdu moreutils pgbadger csvtool fswatch xmonad devilspie |
| 53 | + |
| 54 | + wget 'https://github.com/sharkdp/bat/releases/download/v0.7.1/bat_0.7.1_amd64.deb' -O /tmp/bat.deb && dpkg -i \ |
| 55 | + /tmp/bat.deb && rm -f /tmp/bat.deb |
| 56 | +elif is_rhel; then |
| 57 | + yum update |
| 58 | + yum groupinstall -y "Development Tools" |
| 59 | + # todo: add packages just like debian versions |
| 60 | + # help-wanted |
| 61 | + yum install -y the_silver_searcher git vim |
| 62 | +else |
| 63 | + echo "Unsupported distro but will continue installing other packages" |
| 64 | +fi |
| 65 | + |
| 66 | +gem install bettercap |
| 67 | +gem install hacker-gems |
| 68 | +gem install tmuxinator |
| 69 | +gem install neovim |
| 70 | + |
| 71 | +pip install percol # https://github.com/mooz/percol |
| 72 | +pip install thefuck # https://github.com/nvbn/thefuck |
| 73 | +pip install httpie |
| 74 | +pip install s3cmd |
| 75 | +pip install asciinema |
| 76 | +pip3 install yapf |
| 77 | +pip3 install clang |
| 78 | +pip install glances |
| 79 | +pip install ansible |
| 80 | +pip3 install powerline-status |
| 81 | +powerline-config tmux setup |
| 82 | + |
| 83 | +echo 'eval "$(thefuck --alias)"' >> ~/.bashrc |
| 84 | + |
| 85 | +echo "Installing custom " |
| 86 | +if [[ ! -e "${TOOLS_ROOT_DIR}" ]]; then |
| 87 | + mkdir -p "${TOOLS_ROOT_DIR}" |
| 88 | +fi |
| 89 | + |
| 90 | +git clone https://github.com/nepalihackers/apk2gold-reloaded.git "${TOOLS_ROOT_DIR}/apk2gold" |
| 91 | +echo "export PATH=$PATH:${TOOLS_ROOT_DIR}/apk2gold" >> ~/.bashrc |
| 92 | + |
| 93 | +git clone https://github.com/xmendez/wfuzz.git "${TOOLS_ROOT_DIR}/wfuzz" |
| 94 | + |
| 95 | +git clone https://github.com/1N3/Sn1per.git "${TOOLS_ROOT_DIR}/sniper" |
| 96 | +(cd "${TOOLS_ROOT_DIR}/sniper" && bash install.sh) |
| 97 | + |
| 98 | +git clone https://github.com/techgaun/github-dorks.git "${TOOLS_ROOT_DIR}/github-dorks" |
| 99 | +(cd "${TOOLS_ROOT_DIR}/github-dorks" && pip install -r requirements.txt) |
| 100 | + |
| 101 | +curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash |
| 102 | + |
| 103 | +wget -q -O - https://raw.githubusercontent.com/techgaun/extract/master/extract >> ~/.bashrc |
| 104 | + |
| 105 | +wget -O ~/.bash_aliases https://raw.githubusercontent.com/techgaun/bash-aliases/master/.bash_aliases |
| 106 | + |
| 107 | +npm i -g diff-so-fancy apidoc flow-bin git+https://github.com/ramitos/jsctags.git castnow \ |
| 108 | + serverless ask-cli npx neovim yaspeller |
| 109 | + |
| 110 | +cd /tmp |
| 111 | +git clone https://github.com/facebook/watchman.git |
| 112 | +cd watchman |
| 113 | +git checkout v4.7.0 |
| 114 | +./autogen.sh |
| 115 | +./configure |
| 116 | +make && make install |
| 117 | + |
| 118 | + |
| 119 | +cd /tmp |
| 120 | +git clone https://github.com/tmux/tmux.git |
| 121 | +cd tmux |
| 122 | +git checkout 2.5 |
| 123 | +./configure |
| 124 | +make && make install |
| 125 | + |
| 126 | +cd /tmp |
| 127 | +hg clone https://bitbucket.org/eradman/entr |
| 128 | +cd entr |
| 129 | +./configure |
| 130 | +make test |
| 131 | +make install |
| 132 | + |
| 133 | +cd /tmp |
| 134 | +git clone https://github.com/universal-ctags/ctags.git |
| 135 | +cd ctags |
| 136 | +./autogen.sh |
| 137 | +./configure |
| 138 | +make && make install |
| 139 | + |
| 140 | +apt -y autoremove |
| 141 | + |
| 142 | +bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer) |
| 143 | + |
| 144 | +go get -u github.com/golang/dep/cmd/dep |
| 145 | +curl -sL cli.openfaas.com | sudo sh |
| 146 | + |
| 147 | +cd /tmp |
| 148 | +wget 'https://github.com/BurntSushi/ripgrep/releases/download/0.7.1/ripgrep-0.7.1-x86_64-unknown-linux-musl.tar.gz' |
| 149 | +tar xfz ripgrep-0.7.1-x86_64-unknown-linux-musl.tar.gz |
| 150 | +cd ripgrep-0.7.1-x86_64-unknown-linux-musl/ |
| 151 | +sudo cp rg /usr/bin/rg |
| 152 | +sudo cp complete/rg.bash-completion /etc/bash_completion.d/ |
| 153 | +sudo cp rg.1.gz /usr/share/man/man1/ |
| 154 | + |
| 155 | +curl https://beyondgrep.com/ack-2.18-single-file > ~/.bin/ack && chmod 0755 ~/.bin/ack |
| 156 | + |
| 157 | +GENYMOTION_VERSION="2.11.0" |
| 158 | +wget "https://dl.genymotion.com/releases/genymotion-${GENYMOTION_VERSION}/genymotion-${GENYMOTION_VERSION}-linux_x64.bin" -O /tmp/genymotion.bin |
| 159 | +chmod +x /tmp/genymotion.bin |
| 160 | +/tmp/genymotion.bin -d "${HOME}/" |
| 161 | + |
| 162 | +curl -sSL https://get.haskellstack.org/ | sh |
| 163 | +stack update |
| 164 | +stack install unused |
| 165 | + |
| 166 | +modprobe msr |
0 commit comments