diff --git a/bin/install_tool b/bin/install_tool new file mode 100755 index 0000000..e9cf302 --- /dev/null +++ b/bin/install_tool @@ -0,0 +1,101 @@ +#!/bin/bash + +set -ue + +REINSTALL=0 +PACKAGES=1 + +while getopts -- "-:" a ; do + case "${a}" in + -) + case "${OPTARG}" in + reinstall) + REINSTALL=1 + ;; + no-packages) + PACKAGES=0 + ;; + *) + echo "Unknown long option ${OPTARG}" >/dev/stderr + exit 1 + ;; + esac + esac +done + +shift $(($OPTIND-1)) + +if [ $# -ne 1 ] ; then + echo "Usage: ${0} " >/dev/stderr + exit 1 +fi +TOOL=${1} + +function install_pkgs { + if [ ${PACKAGES} -eq 0 ] ; then + return 0 + fi + if [ `id -u` -ne "0" ] ; then + sudo apt-get -y install $* || ( + echo -n "Unable to install packages, please ensure these " >/dev/stderr + echo "are installed, then run with --no-packages." >/dev/stderr + echo $* + false ) + return 0 + fi + apt-get -y install $* +} + +DESTDIR="${HOME}/tools/${TOOL}" + +if [ -d ${DESTDIR} ] ; then + if [ ${REINSTALL} -eq 1 ] ; then + rm -ri ${DESTDIR} + else + echo "${DESTDIR} exists but not reinstalling." >/dev/stderr + exit 1 + fi +fi + +case ${TOOL} in + john) + install_pkgs libssl-dev git build-essential yasm libgmp-dev libpcap-dev \ + pkg-config libbz2-dev libopenmpi-dev openmpi-bin libnss3-dev \ + libkrb5-dev libgmp-dev + jtemp=`mktemp -d` + git clone https://github.com/magnumripper/JohnTheRipper.git ${jtemp}/john + cd ${jtemp}/john/src + ./configure && make -sj2 + mkdir -p ${DESTDIR} + cp -r ${jtemp}/john/run/* ${DESTDIR} + rm -rf ${jtemp} + # Persistent files + mkdir -p ${HOME}/.john + touch ${HOME}/.john/john.pot + ln -sf ${HOME}/.john/* ${DESTDIR} + ;; + wordlists) + mkdir -p ${DESTDIR} + wget -q -O ${DESTDIR}/rockyou.txt.bz2 \ + http://downloads.skullsecurity.org/passwords/rockyou.txt.bz2 + bunzip2 ${DESTDIR}/rockyou.txt.bz2 + wget -q -O ${DESTDIR}/phpbb.txt.bz2 \ + http://downloads.skullsecurity.org/passwords/phpbb.txt.bz2 + bunzip2 ${DESTDIR}/phpbb.txt.bz2 + wget -q -O ${DESTDIR}/hak5.txt.bz2 \ + http://downloads.skullsecurity.org/passwords/hak5.txt.bz2 + bunzip2 ${DESTDIR}/hak5.txt.bz2 + ;; + gcloud) + gtemp=`mktemp -d` + gbase="https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/" + gsdk="google-cloud-sdk-142.0.0-linux-x86_64.tar.gz" + wget -q -O /tmp/gcloud.tar.gz \ + "${gbase}${gsdk}" + tar zxf /tmp/gcloud.tar.gz --strip-components=1 -C ${DESTDIR} + ;; + *) + echo "Unknown tool: ${TOOL}" >/dev/stderr + exit 1 + ;; +esac diff --git a/dotfiles/env b/dotfiles/env index 0b62791..c1b83c7 100644 --- a/dotfiles/env +++ b/dotfiles/env @@ -4,18 +4,15 @@ umask 027 ulimit -c unlimited # Paths and preferences -export PATH="$HOME/bin:/sbin:/usr/sbin:$PATH" export PYTHONPATH="$HOME/.python:$PYTHONPATH" export GOPATH="$HOME/Projects/Go" +export PATH="$HOME/bin:/sbin:/usr/sbin:$PATH:$GOPATH/bin" export VISUAL=vim export EDITOR=vim export DEBEMAIL="david@systemoverlord.com" export DEBFULLNAME="David Tomaschik" export LESS="-MR" -# Unconditional because /bin/sh sucks -export PATH="$PATH:$HOME/.gce/google-cloud-sdk/bin:$HOME/bin/genymotion:$HOME/bin/genymotion/tools:$HOME/bin/google_appengine:$HOME/bin/go_appengine:$HOME/bin/google-cloud-sdk/bin:$GOPATH/bin" - # Fix gnome-terminal if [[ $TERM == "xterm" && $COLORTERM == "gnome-terminal" ]] ; then export TERM="xterm-256color" diff --git a/dotfiles/ssh/config b/dotfiles/ssh/config index b45b76e..d738db0 100644 --- a/dotfiles/ssh/config +++ b/dotfiles/ssh/config @@ -12,3 +12,8 @@ Host * ForwardX11Trusted no ServerAliveInterval 120 CheckHostIP no + +Host warzone + Hostname warzone.shadowcats.club + Port 22 + User matir diff --git a/dotfiles/vimrc b/dotfiles/vimrc index 59a7123..7610e9d 100644 --- a/dotfiles/vimrc +++ b/dotfiles/vimrc @@ -148,4 +148,4 @@ autocmd Syntax * syn match ExtraWhitespace /\s\+$\| \+\ze\t/ containedin=ALL " Color column at end of lines set colorcolumn=+1 -highlight ColorColumn ctermbg=lightgrey guibg=lightgrey +highlight ColorColumn ctermbg=black guibg=lightgrey diff --git a/dotfiles/zsh_custom/plugins/gcloud/gcloud.plugin.zsh b/dotfiles/zsh_custom/plugins/gcloud/gcloud.plugin.zsh new file mode 100755 index 0000000..8a58b12 --- /dev/null +++ b/dotfiles/zsh_custom/plugins/gcloud/gcloud.plugin.zsh @@ -0,0 +1,17 @@ +#!/bin/zsh + +GCL=${HOME}/tools/gcloud + +if [ ! -d ${GCL} ] ; then + return +fi + +# Add bin to path +export PATH="${PATH}:${GCL}/bin" + +# Load completion +source ${GCL}/completion.zsh.inc + +which kubectl 2>/dev/null >&2 && \ + source <(kubectl completion zsh) || \ + true diff --git a/dotfiles/zsh_custom/plugins/metasploit/metasploit.plugin.zsh b/dotfiles/zsh_custom/plugins/metasploit/metasploit.plugin.zsh new file mode 100644 index 0000000..e69de29 diff --git a/dotfiles/zshrc b/dotfiles/zshrc index 5df662e..901faa7 100644 --- a/dotfiles/zshrc +++ b/dotfiles/zshrc @@ -29,7 +29,7 @@ if [ -d $HOME/.oh-my-zsh ] ; then ZSH=$HOME/.oh-my-zsh ZSH_THEME="matir" ZSH_CUSTOM="$HOME/.zsh_custom" - plugins=(encode64 gpg-agent pep8 pip python tmux urltools extract sudo virsh virtualenv jekyll) + plugins=(encode64 gpg-agent pep8 pip python tmux urltools extract sudo virsh virtualenv jekyll metasploit gcloud) test -f /usr/share/virtualenvwrapper/virtualenvwrapper.sh && plugins+=(virtualenvwrapper) source $ZSH/oh-my-zsh.sh unset ZSH_THEME