Syk0

Kali Setup


Initial setup script for a new kali VM

#!/bin/bash
 
checkCodium=$(which codium)
 
if [ -z $checkCodium ]; then
	echo "[+] install VS codium"
	wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | gpg --dearmor | sudo dd of=/etc/apt/trusted.gpg.d/vscodium.gpg 
	echo 'deb https://paulcarroty.gitlab.io/vscodium-deb-rpm-repo/debs/ vscodium main' | sudo tee --append /etc/apt/sources.list.d/vscodium.list 
	sudo apt update && sudo apt install -y codium
else
	echo "[-] VS Codium found, skipping"
fi
 
checkNcat=$(which ncat)
 
if [ -z "$checkNcat" ]; then
	echo "[+] install ncat"
	sudo apt update && sudo apt install -y ncat
else
	echo "[-] ncat found, skipping"
fi
 
 
checkGo=$(which go)
 
if [ -z "$checkGo" ]; then
	echo "[+] install go lang"
	sudo apt update && sudo apt install -y golang
else
	echo "[-] go lang found, skipping"
fi
 
if [[ ! "$PATH" == *"$HOME/go/bin"* ]]; then
	echo "[+] setup go path"
	echo "" >> ~/.zshrc
	echo '# set PATH so it includes the go bin if it exists' >> ~/.zshrc
	echo 'if [ -d "$HOME/go/bin" ] ; then' >> ~/.zshrc
	echo '    export PATH="$HOME/go/bin:$PATH"' >> ~/.zshrc
	echo 'fi' >> ~/.zshrc
	sleep 1
	. ~/.zshrc
else
	echo "[+] go path already setup"
fi
 
checkGo=$(which go)
 
if [[ ! -z "$checkGo" ]]; then
	echo "[+] installing common go lang tools"
 
	checkFfuf=$(which ffuf)
	if [ -z "$checkFfuf" ]; then
		echo "[+] installing ffuf"
		go get -u github.com/ffuf/ffuf
	else
		echo "[-] ffuf found, skipping"
	fi 
 
	checkGobuster=$(which gobuster)
	if [ -z "$checkGobuster" ]; then
		echo "[+] installing Gobuster"
		go get -u github.com/OJ/gobuster
	else
		echo "[-] Gobuster found, skipping"
	fi 
	
else
	echo "[-] go lang not found, skipping"
fi
 
checkRust=$(which cargo)
 
if [[ -z "$checkRust" ]]; then
	echo "[+] installing rust"
	sudo apt install -y libssl-dev
	curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
	sleep 1
	source "$HOME/.cargo/env"
else
	echo "[-] rust already found"
fi
 
sudo git clone https://github.com/rbsec/dnscan.git /opt/dnscan
sudo git clone https://github.com/chinarulezzz/spoofcheck /opt/spoofcheck; cd /opt/spoofcheck; sudo pip3 install -r requirements.txt
sudo git clone https://gist.github.com/superkojiman/11076951 /opt/namemash; sudo chmod +x /opt/namemash/namemash.py
sudo git clone https://github.com/byt3bl33d3r/SprayingToolkit.git /opt/SprayingToolkit; cd /opt/SprayingToolkit; sudo pip3 install -r requirements.txt
sudo git clone https://github.com/FortyNorthSecurity/Egress-Assess.git /opt/Egress-Assess
sudo gem install evil-winrm
sudo apt install evil-winrm-py