Path: blob/master/Postinstall/2018/postinstall.sh
1306 views
#!/bin/bash1#-Metadata----------------------------------------------------#2# Filename: kali-rolling.sh (Update: 2016-09-21) #3#-Info--------------------------------------------------------#4# Personal post-install script for Kali Linux Rolling #5#-Author(s)---------------------------------------------------#6# g0tmilk ~ https://blog.g0tmi1k.com/ #7#-Operating System--------------------------------------------#8# Designed for: Kali Linux Rolling [x64] (VM - VMware) #9# Tested on: Kali Linux 2016.2 x64/x84/full/light/mini/vm #10# Kali v1.x: https://g0tmi1k/os-scripts/master/kali1.sh #11# Kali v2.x: https://g0tmi1k/os-scripts/master/kali2.sh #12#-Licence-----------------------------------------------------#13# MIT License ~ http://opensource.org/licenses/MIT #14#-Notes-------------------------------------------------------#15# Run as root straight after a clean install of Kali Rolling #16# --- #17# You will need 25GB+ free HDD space before running. #18# --- #19# Command line arguments: #20# -burp = Automates configuring Burp Suite (Community) #21# -dns = Use OpenDNS and locks permissions #22# -openvas = Installs & configures OpenVAS vuln scanner #23# -osx = Changes to Apple keyboard layout #24# #25# -keyboard <value> = Change the keyboard layout language #26# -timezone <value> = Change the timezone location #27# #28# e.g. # bash kali-rolling.sh -burp -keyboard gb -openvas #29# --- #30# Will cut it up (so modular based), at a later date... #31# --- #32# ** This script is meant for _ME_. ** #33# ** EDIT this to meet _YOUR_ requirements! ** #34#-------------------------------------------------------------#353637if [ 1 -eq 0 ]; then # This is never true, thus it acts as block comments ;)38################################################################################39### One liner - Grab the latest version and execute! ###########################40################################################################################41wget -qO kali-rolling.sh https://raw.github.com/g0tmi1k/os-scripts/master/kali-rolling.sh \42&& bash kali-rolling.sh -burp -keyboard gb -timezone "Europe/London"43################################################################################44fi454647#-Defaults-------------------------------------------------------------#484950##### Location information51keyboardApple=false # Using a Apple/Macintosh keyboard (non VM)? [ --osx ]52keyboardLayout="" # Set keyboard layout [ --keyboard gb]53timezone="" # Set timezone location [ --timezone Europe/London ]5455##### Optional steps56burpFree=false # Disable configuring Burp Suite (for Burp Pro users...) [ --burp ]57hardenDNS=false # Set static & lock DNS name server [ --dns ]58openVAS=false # Install & configure OpenVAS (not everyone wants it...) [ --openvas ]5960##### (Optional) Enable debug mode?61#set -x6263##### (Cosmetic) Colour output64RED="\033[01;31m" # Issues/Errors65GREEN="\033[01;32m" # Success66YELLOW="\033[01;33m" # Warnings/Information67BLUE="\033[01;34m" # Heading68BOLD="\033[01;01m" # Highlight69RESET="\033[00m" # Normal7071STAGE=0 # Where are we up to72TOTAL=$( grep '(${STAGE}/${TOTAL})' $0 | wc -l );(( TOTAL-- )) # How many things have we got todo737475#-Arguments------------------------------------------------------------#767778##### Read command line arguments79while [[ "${#}" -gt 0 && ."${1}" == .-* ]]; do80opt="${1}";81shift;82case "$(echo ${opt} | tr '[:upper:]' '[:lower:]')" in83-|-- ) break 2;;8485-osx|--osx )86keyboardApple=true;;87-apple|--apple )88keyboardApple=true;;8990-dns|--dns )91hardenDNS=true;;9293-openvas|--openvas )94openVAS=true;;9596-burp|--burp )97burpFree=true;;9899-keyboard|--keyboard )100keyboardLayout="${1}"; shift;;101-keyboard=*|--keyboard=* )102keyboardLayout="${opt#*=}";;103104-timezone|--timezone )105timezone="${1}"; shift;;106-timezone=*|--timezone=* )107timezone="${opt#*=}";;108109*) echo -e ' '${RED}'[!]'${RESET}" Unknown option: ${RED}${x}${RESET}" 1>&2 \110&& exit 1;;111esac112done113114115##### Check user inputs116if [[ -n "${timezone}" && ! -f "/usr/share/zoneinfo/${timezone}" ]]; then117echo -e ' '${RED}'[!]'${RESET}" Looks like the ${RED}timezone '${timezone}'${RESET} is incorrect/not supported (Example: ${BOLD}Europe/London${RESET})" 1>&2118echo -e ' '${RED}'[!]'${RESET}" Quitting..." 1>&2119exit 1120elif [[ -n "${keyboardLayout}" && -e /usr/share/X11/xkb/rules/xorg.lst ]]; then121if ! $(grep -q " ${keyboardLayout} " /usr/share/X11/xkb/rules/xorg.lst); then122echo -e ' '${RED}'[!]'${RESET}" Looks like the ${RED}keyboard layout '${keyboardLayout}'${RESET} is incorrect/not supported (Example: ${BOLD}gb${RESET})" 1>&2123echo -e ' '${RED}'[!]'${RESET}" Quitting..." 1>&2124exit 1125fi126fi127128129#-Start----------------------------------------------------------------#130131132##### Check if we are running as root - else this script will fail (hard!)133if [[ "${EUID}" -ne 0 ]]; then134echo -e ' '${RED}'[!]'${RESET}" This script must be ${RED}run as root${RESET}" 1>&2135echo -e ' '${RED}'[!]'${RESET}" Quitting..." 1>&2136exit 1137else138echo -e " ${BLUE}[*]${RESET} ${BOLD}Kali Linux rolling post-install script${RESET}"139sleep 3s140fi141142if [ "${burpFree}" != "true" ]; then143echo -e "\n\n ${YELLOW}[i]${RESET} ${YELLOW}Skipping Burp Suite${RESET} (missing: '$0 ${BOLD}--burp${RESET}')..." 1>&2144sleep 2s145fi146147148##### Fix display output for GUI programs (when connecting via SSH)149export DISPLAY=:0.0150export TERM=xterm151152153##### Are we using GNOME?154if [[ $(which gnome-shell) ]]; then155##### RAM check156if [[ "$(free -m | grep -i Mem | awk '{print $2}')" < 2048 ]]; then157echo -e '\n '${RED}'[!]'${RESET}" ${RED}You have <= 2GB of RAM and using GNOME${RESET}" 1>&2158echo -e " ${YELLOW}[i]${RESET} ${YELLOW}Might want to use XFCE instead${RESET}..."159sleep 15s160fi161162163##### Disable its auto notification package updater164(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Disabling GNOME's ${GREEN}notification package updater${RESET} service ~ in case it runs during this script"165export DISPLAY=:0.0166timeout 5 killall -w /usr/lib/apt/methods/http >/dev/null 2>&1167168169##### Disable screensaver170(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Disabling ${GREEN}screensaver${RESET}"171xset s 0 0172xset s off173gsettings set org.gnome.desktop.session idle-delay 0174else175echo -e "\n\n ${YELLOW}[i]${RESET} ${YELLOW}Skipping disabling package updater${RESET}..."176fi177178179##### Check Internet access180(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Checking ${GREEN}Internet access${RESET}"181#--- Can we ping google?182for i in {1..10}; do ping -c 1 -W ${i} www.google.com &>/dev/null && break; done183#--- Run this, if we can't184if [[ "$?" -ne 0 ]]; then185echo -e ' '${RED}'[!]'${RESET}" ${RED}Possible DNS issues${RESET}(?)" 1>&2186echo -e ' '${RED}'[!]'${RESET}" Will try and use ${YELLOW}DHCP${RESET} to 'fix' the issue" 1>&2187chattr -i /etc/resolv.conf 2>/dev/null188dhclient -r189#--- Second interface causing issues?190ip addr show eth1 &>/dev/null191[[ "$?" == 0 ]] \192&& route delete default gw 192.168.155.1 2>/dev/null193#--- Request a new IP194dhclient195dhclient eth0 2>/dev/null196dhclient wlan0 2>/dev/null197#--- Wait and see what happens198sleep 15s199_TMP="true"200_CMD="$(ping -c 1 8.8.8.8 &>/dev/null)"201if [[ "$?" -ne 0 && "$_TMP" == "true" ]]; then202_TMP="false"203echo -e ' '${RED}'[!]'${RESET}" ${RED}No Internet access${RESET}" 1>&2204echo -e ' '${RED}'[!]'${RESET}" You will need to manually fix the issue, before re-running this script" 1>&2205fi206_CMD="$(ping -c 1 www.google.com &>/dev/null)"207if [[ "$?" -ne 0 && "$_TMP" == "true" ]]; then208_TMP="false"209echo -e ' '${RED}'[!]'${RESET}" ${RED}Possible DNS issues${RESET}(?)" 1>&2210echo -e ' '${RED}'[!]'${RESET}" You will need to manually fix the issue, before re-running this script" 1>&2211fi212if [[ "$_TMP" == "false" ]]; then213(dmidecode | grep -iq virtual) && echo -e " ${YELLOW}[i]${RESET} VM Detected"214(dmidecode | grep -iq virtual) && echo -e " ${YELLOW}[i]${RESET} ${YELLOW}Try switching network adapter mode${RESET} (e.g. NAT/Bridged)"215echo -e ' '${RED}'[!]'${RESET}" Quitting..." 1>&2216exit 1217fi218else219echo -e " ${YELLOW}[i]${RESET} ${YELLOW}Detected Internet access${RESET}" 1>&2220fi221#--- GitHub under DDoS?222(( STAGE++ )); echo -e " ${GREEN}[i]${RESET} (${STAGE}/${TOTAL}) Checking ${GREEN}GitHub status${RESET}"223timeout 300 curl --progress -k -L -f "https://status.github.com/api/status.json" | grep -q "good" \224|| (echo -e ' '${RED}'[!]'${RESET}" ${RED}GitHub is currently having issues${RESET}. ${BOLD}Lots may fail${RESET}. See: https://status.github.com/" 1>&2 \225&& exit 1)226227228##### Enable default network repositories ~ http://docs.kali.org/general-use/kali-linux-sources-list-repositories229(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Enabling default OS ${GREEN}network repositories${RESET}"230#--- Add network repositories231file=/etc/apt/sources.list; [ -e "${file}" ] && cp -n $file{,.bkup}232([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"233#--- Main234grep -q '^deb .* kali-rolling' "${file}" 2>/dev/null \235|| echo -e "\n\n# Kali Rolling\ndeb http://http.kali.org/kali kali-rolling main contrib non-free" >> "${file}"236#--- Source237grep -q '^deb-src .* kali-rolling' "${file}" 2>/dev/null \238|| echo -e "deb-src http://http.kali.org/kali kali-rolling main contrib non-free" >> "${file}"239#--- Disable CD repositories240sed -i '/kali/ s/^\( \|\t\|\)deb cdrom/#deb cdrom/g' "${file}"241#--- incase we were interrupted242dpkg --configure -a243#--- Update244apt -qq update245if [[ "$?" -ne 0 ]]; then246echo -e ' '${RED}'[!]'${RESET}" There was an ${RED}issue accessing network repositories${RESET}" 1>&2247echo -e " ${YELLOW}[i]${RESET} Are the remote network repositories ${YELLOW}currently being sync'd${RESET}?"248echo -e " ${YELLOW}[i]${RESET} Here is ${BOLD}YOUR${RESET} local network ${BOLD}repository${RESET} information (Geo-IP based):\n"249curl -sI http://http.kali.org/README250exit 1251fi252253254##### Check to see if Kali is in a VM. If so, install "Virtual Machine Addons/Tools" for a "better" virtual experiment255if (dmidecode | grep -iq vmware); then256##### Install virtual machines tools ~ http://docs.kali.org/general-use/install-vmware-tools-kali-guest257(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}VMware's (open) virtual machine tools${RESET}"258apt -y -qq install open-vm-tools-desktop fuse \259|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2260apt -y -qq install make \261|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2 # There's a nags afterwards262## Shared folders support for Open-VM-Tools (some odd bug)263file=/usr/local/sbin/mount-shared-folders; [ -e "${file}" ] && cp -n $file{,.bkup}264cat <<EOF > "${file}" \265|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2266#!/bin/bash267268vmware-hgfsclient | while read folder; do269echo "[i] Mounting \${folder} (/mnt/hgfs/\${folder})"270mkdir -p "/mnt/hgfs/\${folder}"271umount -f "/mnt/hgfs/\${folder}" 2>/dev/null272vmhgfs-fuse -o allow_other -o auto_unmount ".host:/\${folder}" "/mnt/hgfs/\${folder}"273done274275sleep 2s276EOF277chmod +x "${file}"278ln -sf "${file}" /root/Desktop/mount-shared-folders.sh279elif (dmidecode | grep -iq virtualbox); then280##### Installing VirtualBox Guest Additions. Note: Need VirtualBox 4.2.xx+ for the host (http://docs.kali.org/general-use/kali-linux-virtual-box-guest)281(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}VirtualBox's guest additions${RESET}"282apt -y -qq install virtualbox-guest-x11 \283|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2284fi285286287##### Check to see if there is a second Ethernet card (if so, set an static IP address)288ip addr show eth1 &>/dev/null289if [[ "$?" == 0 ]]; then290##### Set a static IP address (192.168.155.175/24) on eth1291(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Setting a ${GREEN}static IP address${RESET} (${BOLD}192.168.155.175/24${RESET}) on ${BOLD}eth1${RESET}"292ip addr add 192.168.155.175/24 dev eth1 2>/dev/null293route delete default gw 192.168.155.1 2>/dev/null294file=/etc/network/interfaces.d/eth1.cfg; [ -e "${file}" ] && cp -n $file{,.bkup}295grep -q '^iface eth1 inet static' "${file}" 2>/dev/null \296|| cat <<EOF > "${file}"297auto eth1298iface eth1 inet static299address 192.168.155.175300netmask 255.255.255.0301gateway 192.168.155.1302post-up route delete default gw 192.168.155.1303EOF304else305echo -e "\n\n ${YELLOW}[i]${RESET} ${YELLOW}Skipping eth1${RESET} (missing nic)..." 1>&2306fi307308309##### Set static & protecting DNS name servers. Note: May cause issues with forced values (e.g. captive portals etc)310if [[ "${hardenDNS}" != "false" ]]; then311(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Setting static & protecting ${GREEN}DNS name servers${RESET}"312file=/etc/resolv.conf; [ -e "${file}" ] && cp -n $file{,.bkup}313chattr -i "${file}" 2>/dev/null314#--- Use OpenDNS DNS315echo -e 'nameserver 208.67.222.222\nnameserver 208.67.220.220' > "${file}"316#--- Use Google DNS317#echo -e 'nameserver 8.8.8.8\nnameserver 8.8.4.4' > "${file}"318#--- Protect it319chattr +i "${file}" 2>/dev/null320else321echo -e "\n\n ${YELLOW}[i]${RESET} ${YELLOW}Skipping DNS${RESET} (missing: '$0 ${BOLD}--dns${RESET}')..." 1>&2322fi323324325##### Update location information - set either value to "" to skip.326(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Updating ${GREEN}location information${RESET}"327#--- Configure keyboard layout (Apple)328if [ "${keyboardApple}" != "false" ]; then329( (( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Applying ${GREEN}Apple hardware${RESET} profile" )330file=/etc/default/keyboard; #[ -e "${file}" ] && cp -n $file{,.bkup}331sed -i 's/XKBVARIANT=".*"/XKBVARIANT="mac"/' "${file}"332fi333#--- Configure keyboard layout (location)334if [[ -n "${keyboardLayout}" ]]; then335(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Updating ${GREEN}location information${RESET} ~ keyboard layout (${BOLD}${keyboardLayout}${RESET})"336geoip_keyboard=$(curl -s http://ifconfig.io/country_code | tr '[:upper:]' '[:lower:]')337[ "${geoip_keyboard}" != "${keyboardLayout}" ] \338&& echo -e " ${YELLOW}[i]${RESET} Keyboard layout (${BOLD}${keyboardLayout}${RESET}) doesn't match what's been detected via GeoIP (${BOLD}${geoip_keyboard}${RESET})"339file=/etc/default/keyboard; #[ -e "${file}" ] && cp -n $file{,.bkup}340sed -i 's/XKBLAYOUT=".*"/XKBLAYOUT="'${keyboardLayout}'"/' "${file}"341else342echo -e "\n\n ${YELLOW}[i]${RESET} ${YELLOW}Skipping keyboard layout${RESET} (missing: '$0 ${BOLD}--keyboard <value>${RESET}')..." 1>&2343fi344#--- Changing time zone345if [[ -n "${timezone}" ]]; then346(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Updating ${GREEN}location information${RESET} ~ time zone (${BOLD}${timezone}${RESET})"347echo "${timezone}" > /etc/timezone348ln -sf "/usr/share/zoneinfo/$(cat /etc/timezone)" /etc/localtime349dpkg-reconfigure -f noninteractive tzdata350else351echo -e "\n\n ${YELLOW}[i]${RESET} ${YELLOW}Skipping time zone${RESET} (missing: '$0 ${BOLD}--timezone <value>${RESET}')..." 1>&2352fi353#--- Installing ntp tools354(( STAGE++ )); echo -e " ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}ntpdate${RESET} ~ keeping the time in sync"355apt -y -qq install ntp ntpdate \356|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2357#--- Update time358ntpdate -b -s -u pool.ntp.org359#--- Start service360systemctl restart ntp361#--- Remove from start up362systemctl disable ntp 2>/dev/null363#--- Only used for stats at the end364start_time=$(date +%s)365366367##### Update OS from network repositories368(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) ${GREEN}Updating OS${RESET} from network repositories"369echo -e " ${YELLOW}[i]${RESET} ...this ${BOLD}may take a while${RESET} depending on your Internet connection & Kali version/age"370for FILE in clean autoremove; do apt -y -qq "${FILE}"; done # Clean up clean remove autoremove autoclean371export DEBIAN_FRONTEND=noninteractive372apt -qq update && APT_LISTCHANGES_FRONTEND=none apt -o Dpkg::Options::="--force-confnew" -y dist-upgrade --fix-missing 2>&1 \373|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2374#--- Cleaning up temp stuff375for FILE in clean autoremove; do apt -y -qq "${FILE}"; done # Clean up - clean remove autoremove autoclean376#--- Check kernel stuff377_TMP=$(dpkg -l | grep linux-image- | grep -vc meta)378if [[ "${_TMP}" -gt 1 ]]; then379echo -e "\n ${YELLOW}[i]${RESET} Detected ${YELLOW}multiple kernels${RESET}"380TMP=$(dpkg -l | grep linux-image | grep -v meta | sort -t '.' -k 2 -g | tail -n 1 | grep "$(uname -r)")381if [[ -z "${TMP}" ]]; then382echo -e '\n '${RED}'[!]'${RESET}' You are '${RED}'not using the latest kernel'${RESET} 1>&2383echo -e " ${YELLOW}[i]${RESET} You have it ${YELLOW}downloaded${RESET} & installed, just ${YELLOW}not USING IT${RESET}"384#echo -e "\n ${YELLOW}[i]${RESET} You ${YELLOW}NEED to REBOOT${RESET}, before re-running this script"385#exit 1386sleep 30s387else388echo -e " ${YELLOW}[i]${RESET} ${YELLOW}You're using the latest kernel${RESET} (Good to continue)"389fi390fi391392393##### Install kernel headers394(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}kernel headers${RESET}"395apt -y -qq install make gcc "linux-headers-$(uname -r)" \396|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2397if [[ $? -ne 0 ]]; then398echo -e ' '${RED}'[!]'${RESET}" There was an ${RED}issue installing kernel headers${RESET}" 1>&2399echo -e " ${YELLOW}[i]${RESET} Are you ${YELLOW}USING${RESET} the ${YELLOW}latest kernel${RESET}?"400echo -e " ${YELLOW}[i]${RESET} ${YELLOW}Reboot${RESET} your machine"401#exit 1402sleep 30s403fi404405406##### Install "kali full" meta packages (default tool selection)407(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}kali-linux-full${RESET} meta-package"408echo -e " ${YELLOW}[i]${RESET} ...this ${BOLD}may take a while${RESET} depending on your Kali version (e.g. ARM, light, mini or docker...)"409#--- Kali's default tools ~ https://www.kali.org/news/kali-linux-metapackages/410apt -y -qq install kali-linux-full \411|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2412413414##### Set audio level415(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Setting ${GREEN}audio${RESET} levels"416systemctl --user enable pulseaudio417systemctl --user start pulseaudio418pactl set-sink-mute 0 0419pactl set-sink-volume 0 25%420421422##### Configure GRUB423(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Configuring ${GREEN}GRUB${RESET} ~ boot manager"424grubTimeout=5425(dmidecode | grep -iq virtual) && grubTimeout=1 # Much less if we are in a VM426file=/etc/default/grub; [ -e "${file}" ] && cp -n $file{,.bkup}427sed -i 's/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT='${grubTimeout}'/' "${file}" # Time out (lower if in a virtual machine, else possible dual booting)428sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT="vga=0x0318"/' "${file}" # TTY resolution429update-grub430431432if [[ $(dmidecode | grep -i virtual) ]]; then433###### Configure login screen434(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Configuring ${GREEN}login screen${RESET}"435#--- Enable auto (gui) login436file=/etc/gdm3/daemon.conf; [ -e "${file}" ] && cp -n $file{,.bkup}437sed -i 's/^.*AutomaticLoginEnable = .*/AutomaticLoginEnable = true/' "${file}"438sed -i 's/^.*AutomaticLogin = .*/AutomaticLogin = root/' "${file}"439fi440441442if [[ $(which gnome-shell) ]]; then443##### Configure GNOME 3444(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Configuring ${GREEN}GNOME 3${RESET} ~ desktop environment"445export DISPLAY=:0.0446#-- Gnome Extension - Dash Dock (the toolbar with all the icons)447gsettings set org.gnome.shell.extensions.dash-to-dock extend-height true # Set dock to use the full height448gsettings set org.gnome.shell.extensions.dash-to-dock dock-position 'RIGHT' # Set dock to the right449gsettings set org.gnome.shell.extensions.dash-to-dock dock-fixed true # Set dock to be always visible450gsettings set org.gnome.shell favorite-apps \451"['gnome-terminal.desktop', 'org.gnome.Nautilus.desktop', 'kali-wireshark.desktop', 'firefox-esr.desktop', 'kali-burpsuite.desktop', 'kali-msfconsole.desktop', 'gedit.desktop']"452#-- Gnome Extension - Alternate-tab (So it doesn't group the same windows up)453GNOME_EXTENSIONS=$(gsettings get org.gnome.shell enabled-extensions | sed 's_^.\(.*\).$_\1_')454echo "${GNOME_EXTENSIONS}" | grep -q "[email protected]" \455|| gsettings set org.gnome.shell enabled-extensions "[${GNOME_EXTENSIONS}, '[email protected]']"456#-- Gnome Extension - Drive Menu (Show USB devices in tray)457GNOME_EXTENSIONS=$(gsettings get org.gnome.shell enabled-extensions | sed 's_^.\(.*\).$_\1_')458echo "${GNOME_EXTENSIONS}" | grep -q "[email protected]" \459|| gsettings set org.gnome.shell enabled-extensions "[${GNOME_EXTENSIONS}, '[email protected]']"460#--- Workspaces461gsettings set org.gnome.shell.overrides dynamic-workspaces false # Static462gsettings set org.gnome.desktop.wm.preferences num-workspaces 3 # Increase workspaces count to 3463#--- Top bar464gsettings set org.gnome.desktop.interface clock-show-date true # Show date next to time in the top tool bar465#--- Keyboard short-cuts466(dmidecode | grep -iq virtual) && gsettings set org.gnome.mutter overlay-key "Super_R" # Change 'super' key to right side (rather than left key), if in a VM467#--- Hide desktop icon468dconf write /org/gnome/nautilus/desktop/computer-icon-visible false469else470echo -e "\n\n ${YELLOW}[i]${RESET} ${YELLOW}Skipping GNOME${RESET}..." 1>&2471fi472473474##### Install XFCE4475(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}XFCE4${RESET}${RESET} ~ desktop environment"476export DISPLAY=:0.0477apt -y -qq install curl \478|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2479apt -y -qq install xfce4 xfce4-mount-plugin xfce4-notifyd xfce4-places-plugin xfce4-power-manager \480|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2481(dmidecode | grep -iq virtual) \482|| (apt -y -qq install xfce4-battery-plugin \483|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2)484#--- Configuring XFCE485mkdir -p ~/.config/xfce4/panel/launcher-{2,4,5,6,7,8,9}/486mkdir -p ~/.config/xfce4/xfconf/xfce-perchannel-xml/487#--- Configuring XFCE (Keyboard shortcuts)488cat <<EOF > ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml \489|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2490<?xml version="1.0" encoding="UTF-8"?>491492<channel name="xfce4-keyboard-shortcuts" version="1.0">493<property name="commands" type="empty">494<property name="custom" type="empty">495<property name="XF86Display" type="string" value="xfce4-display-settings --minimal"/>496<property name="<Alt>F2" type="string" value="xfrun4"/>497<property name="<Primary>space" type="string" value="xfce4-appfinder"/>498<property name="<Primary><Alt>t" type="string" value="/usr/bin/exo-open --launch TerminalEmulator"/>499<property name="<Primary><Alt>Delete" type="string" value="xflock4"/>500<property name="<Primary>Escape" type="string" value="xfdesktop --menu"/>501<property name="<Super>p" type="string" value="xfce4-display-settings --minimal"/>502<property name="override" type="bool" value="true"/>503</property>504</property>505<property name="xfwm4" type="empty">506<property name="custom" type="empty">507<property name="<Alt><Control>End" type="string" value="move_window_next_workspace_key"/>508<property name="<Alt><Control>Home" type="string" value="move_window_prev_workspace_key"/>509<property name="<Alt><Control>KP_1" type="string" value="move_window_workspace_1_key"/>510<property name="<Alt><Control>KP_2" type="string" value="move_window_workspace_2_key"/>511<property name="<Alt><Control>KP_3" type="string" value="move_window_workspace_3_key"/>512<property name="<Alt><Control>KP_4" type="string" value="move_window_workspace_4_key"/>513<property name="<Alt><Control>KP_5" type="string" value="move_window_workspace_5_key"/>514<property name="<Alt><Control>KP_6" type="string" value="move_window_workspace_6_key"/>515<property name="<Alt><Control>KP_7" type="string" value="move_window_workspace_7_key"/>516<property name="<Alt><Control>KP_8" type="string" value="move_window_workspace_8_key"/>517<property name="<Alt><Control>KP_9" type="string" value="move_window_workspace_9_key"/>518<property name="<Alt><Shift>Tab" type="string" value="cycle_reverse_windows_key"/>519<property name="<Alt>Delete" type="string" value="del_workspace_key"/>520<property name="<Alt>F10" type="string" value="maximize_window_key"/>521<property name="<Alt>F11" type="string" value="fullscreen_key"/>522<property name="<Alt>F12" type="string" value="above_key"/>523<property name="<Alt>F4" type="string" value="close_window_key"/>524<property name="<Alt>F6" type="string" value="stick_window_key"/>525<property name="<Alt>F7" type="string" value="move_window_key"/>526<property name="<Alt>F8" type="string" value="resize_window_key"/>527<property name="<Alt>F9" type="string" value="hide_window_key"/>528<property name="<Alt>Insert" type="string" value="add_workspace_key"/>529<property name="<Alt>space" type="string" value="popup_menu_key"/>530<property name="<Alt>Tab" type="string" value="cycle_windows_key"/>531<property name="<Control><Alt>d" type="string" value="show_desktop_key"/>532<property name="<Control><Alt>Down" type="string" value="down_workspace_key"/>533<property name="<Control><Alt>Left" type="string" value="left_workspace_key"/>534<property name="<Control><Alt>Right" type="string" value="right_workspace_key"/>535<property name="<Control><Alt>Up" type="string" value="up_workspace_key"/>536<property name="<Control><Shift><Alt>Left" type="string" value="move_window_left_key"/>537<property name="<Control><Shift><Alt>Right" type="string" value="move_window_right_key"/>538<property name="<Control><Shift><Alt>Up" type="string" value="move_window_up_key"/>539<property name="<Control>F1" type="string" value="workspace_1_key"/>540<property name="<Control>F10" type="string" value="workspace_10_key"/>541<property name="<Control>F11" type="string" value="workspace_11_key"/>542<property name="<Control>F12" type="string" value="workspace_12_key"/>543<property name="<Control>F2" type="string" value="workspace_2_key"/>544<property name="<Control>F3" type="string" value="workspace_3_key"/>545<property name="<Control>F4" type="string" value="workspace_4_key"/>546<property name="<Control>F5" type="string" value="workspace_5_key"/>547<property name="<Control>F6" type="string" value="workspace_6_key"/>548<property name="<Control>F7" type="string" value="workspace_7_key"/>549<property name="<Control>F8" type="string" value="workspace_8_key"/>550<property name="<Control>F9" type="string" value="workspace_9_key"/>551<property name="<Shift><Alt>Page_Down" type="string" value="lower_window_key"/>552<property name="<Shift><Alt>Page_Up" type="string" value="raise_window_key"/>553<property name="<Super>Tab" type="string" value="switch_window_key"/>554<property name="Down" type="string" value="down_key"/>555<property name="Escape" type="string" value="cancel_key"/>556<property name="Left" type="string" value="left_key"/>557<property name="Right" type="string" value="right_key"/>558<property name="Up" type="string" value="up_key"/>559<property name="override" type="bool" value="true"/>560<property name="<Super>Left" type="string" value="tile_left_key"/>561<property name="<Super>Right" type="string" value="tile_right_key"/>562<property name="<Super>Up" type="string" value="maximize_window_key"/>563</property>564</property>565<property name="providers" type="array">566<value type="string" value="xfwm4"/>567<value type="string" value="commands"/>568</property>569</channel>570EOF571#--- Configuring XFCE (Power Options)572cat <<EOF > ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml \573|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2574<?xml version="1.0" encoding="UTF-8"?>575576<channel name="xfce4-power-manager" version="1.0">577<property name="xfce4-power-manager" type="empty">578<property name="power-button-action" type="empty"/>579<property name="dpms-enabled" type="bool" value="true"/>580<property name="blank-on-ac" type="int" value="0"/>581<property name="dpms-on-ac-sleep" type="uint" value="0"/>582<property name="dpms-on-ac-off" type="uint" value="0"/>583</property>584</channel>585EOF586#--- Desktop files587ln -sf /usr/share/applications/exo-terminal-emulator.desktop ~/.config/xfce4/panel/launcher-2/exo-terminal-emulator.desktop588ln -sf /usr/share/applications/kali-wireshark.desktop ~/.config/xfce4/panel/launcher-4/kali-wireshark.desktop589ln -sf /usr/share/applications/firefox-esr.desktop ~/.config/xfce4/panel/launcher-5/firefox-esr.desktop590ln -sf /usr/share/applications/kali-burpsuite.desktop ~/.config/xfce4/panel/launcher-6/kali-burpsuite.desktop591ln -sf /usr/share/applications/kali-msfconsole.desktop ~/.config/xfce4/panel/launcher-7/kali-msfconsole.desktop592ln -sf /usr/share/applications/org.gnome.gedit.desktop ~/.config/xfce4/panel/launcher-8/textedit.desktop593ln -sf /usr/share/applications/xfce4-appfinder.desktop ~/.config/xfce4/panel/launcher-9/xfce4-appfinder.desktop594#--- XFCE settings595_TMP=""596[ "${burpFree}" != "false" ] \597&& _TMP="-t int -s 6"598xfconf-query -n -a -c xfce4-panel -p /panels -t int -s 0599xfconf-query --create --channel xfce4-panel --property /panels/panel-0/plugin-ids \600-t int -s 1 -t int -s 2 -t int -s 3 -t int -s 4 -t int -s 5 ${_TMP} -t int -s 7 -t int -s 8 -t int -s 9 \601-t int -s 10 -t int -s 11 -t int -s 13 -t int -s 15 -t int -s 16 -t int -s 17 -t int -s 19 -t int -s 20602xfconf-query -n -c xfce4-panel -p /panels/panel-0/length -t int -s 100603xfconf-query -n -c xfce4-panel -p /panels/panel-0/size -t int -s 30604xfconf-query -n -c xfce4-panel -p /panels/panel-0/position -t string -s "p=6;x=0;y=0"605xfconf-query -n -c xfce4-panel -p /panels/panel-0/position-locked -t bool -s true606xfconf-query -n -c xfce4-panel -p /plugins/plugin-1 -t string -s applicationsmenu # application menu607xfconf-query -n -c xfce4-panel -p /plugins/plugin-2 -t string -s launcher # terminal ID: exo-terminal-emulator608xfconf-query -n -c xfce4-panel -p /plugins/plugin-3 -t string -s places # places609xfconf-query -n -c xfce4-panel -p /plugins/plugin-4 -t string -s launcher # wireshark ID: kali-wireshark610xfconf-query -n -c xfce4-panel -p /plugins/plugin-5 -t string -s launcher # firefox ID: firefox-esr611[ "${burpFree}" != "false" ] \612&& xfconf-query -n -c xfce4-panel -p /plugins/plugin-6 -t string -s launcher # burpsuite ID: kali-burpsuite613xfconf-query -n -c xfce4-panel -p /plugins/plugin-7 -t string -s launcher # msf ID: kali-msfconsole614xfconf-query -n -c xfce4-panel -p /plugins/plugin-8 -t string -s launcher # gedit ID: org.gnome.gedit.desktop615xfconf-query -n -c xfce4-panel -p /plugins/plugin-9 -t string -s launcher # search ID: xfce4-appfinder616xfconf-query -n -c xfce4-panel -p /plugins/plugin-10 -t string -s tasklist617xfconf-query -n -c xfce4-panel -p /plugins/plugin-11 -t string -s separator618xfconf-query -n -c xfce4-panel -p /plugins/plugin-13 -t string -s mixer # audio619xfconf-query -n -c xfce4-panel -p /plugins/plugin-15 -t string -s systray620xfconf-query -n -c xfce4-panel -p /plugins/plugin-16 -t string -s actions621xfconf-query -n -c xfce4-panel -p /plugins/plugin-17 -t string -s clock622xfconf-query -n -c xfce4-panel -p /plugins/plugin-19 -t string -s pager623xfconf-query -n -c xfce4-panel -p /plugins/plugin-20 -t string -s showdesktop624#--- application menu625xfconf-query -n -c xfce4-panel -p /plugins/plugin-1/show-tooltips -t bool -s true626xfconf-query -n -c xfce4-panel -p /plugins/plugin-1/show-button-title -t bool -s false627#--- terminal628xfconf-query -n -c xfce4-panel -p /plugins/plugin-2/items -t string -s "exo-terminal-emulator.desktop" -a629#--- places630xfconf-query -n -c xfce4-panel -p /plugins/plugin-3/mount-open-volumes -t bool -s true631#--- wireshark632xfconf-query -n -c xfce4-panel -p /plugins/plugin-4/items -t string -s "kali-wireshark.desktop" -a633#--- firefox634xfconf-query -n -c xfce4-panel -p /plugins/plugin-5/items -t string -s "firefox-esr.desktop" -a635#--- burp636[ "${burpFree}" != "false" ] \637&& xfconf-query -n -c xfce4-panel -p /plugins/plugin-6/items -t string -s "kali-burpsuite.desktop" -a638#--- metasploit639xfconf-query -n -c xfce4-panel -p /plugins/plugin-7/items -t string -s "kali-msfconsole.desktop" -a640#--- gedit641xfconf-query -n -c xfce4-panel -p /plugins/plugin-8/items -t string -s "textedit.desktop" -a642#--- search643xfconf-query -n -c xfce4-panel -p /plugins/plugin-9/items -t string -s "xfce4-appfinder.desktop" -a644#--- tasklist (& separator - required for padding)645xfconf-query -n -c xfce4-panel -p /plugins/plugin-10/show-labels -t bool -s true646xfconf-query -n -c xfce4-panel -p /plugins/plugin-10/show-handle -t bool -s false647xfconf-query -n -c xfce4-panel -p /plugins/plugin-11/style -t int -s 0648xfconf-query -n -c xfce4-panel -p /plugins/plugin-11/expand -t bool -s true649#--- systray650xfconf-query -n -c xfce4-panel -p /plugins/plugin-15/show-frame -t bool -s false651#--- actions652xfconf-query -n -c xfce4-panel -p /plugins/plugin-16/appearance -t int -s 1653xfconf-query -n -c xfce4-panel -p /plugins/plugin-16/items \654-t string -s "+logout-dialog" -t string -s "-switch-user" -t string -s "-separator" \655-t string -s "-logout" -t string -s "+lock-screen" -t string -s "+hibernate" -t string -s "+suspend" -t string -s "+restart" -t string -s "+shutdown" -a656#--- clock657xfconf-query -n -c xfce4-panel -p /plugins/plugin-17/show-frame -t bool -s false658xfconf-query -n -c xfce4-panel -p /plugins/plugin-17/mode -t int -s 2659xfconf-query -n -c xfce4-panel -p /plugins/plugin-17/digital-format -t string -s "%R, %Y-%m-%d"660#--- pager / workspace661xfconf-query -n -c xfce4-panel -p /plugins/plugin-19/miniature-view -t bool -s true662xfconf-query -n -c xfce4-panel -p /plugins/plugin-19/rows -t int -s 1663xfconf-query -n -c xfwm4 -p /general/workspace_count -t int -s 3664#--- Theme options665xfconf-query -n -c xsettings -p /Net/ThemeName -s "Kali-X"666xfconf-query -n -c xsettings -p /Net/IconThemeName -s "Vibrancy-Kali"667xfconf-query -n -c xsettings -p /Gtk/MenuImages -t bool -s true668xfconf-query -n -c xfce4-panel -p /plugins/plugin-1/button-icon -t string -s "kali-menu"669#--- Window management670xfconf-query -n -c xfwm4 -p /general/snap_to_border -t bool -s true671xfconf-query -n -c xfwm4 -p /general/snap_to_windows -t bool -s true672xfconf-query -n -c xfwm4 -p /general/wrap_windows -t bool -s false673xfconf-query -n -c xfwm4 -p /general/wrap_workspaces -t bool -s false674xfconf-query -n -c xfwm4 -p /general/click_to_focus -t bool -s false675xfconf-query -n -c xfwm4 -p /general/click_to_focus -t bool -s true676#--- Hide icons677xfconf-query -n -c xfce4-desktop -p /desktop-icons/file-icons/show-filesystem -t bool -s false678xfconf-query -n -c xfce4-desktop -p /desktop-icons/file-icons/show-home -t bool -s false679xfconf-query -n -c xfce4-desktop -p /desktop-icons/file-icons/show-trash -t bool -s false680xfconf-query -n -c xfce4-desktop -p /desktop-icons/file-icons/show-removable -t bool -s false681#--- Start and exit values682xfconf-query -n -c xfce4-session -p /splash/Engine -t string -s ""683xfconf-query -n -c xfce4-session -p /shutdown/LockScreen -t bool -s true684xfconf-query -n -c xfce4-session -p /general/SaveOnExit -t bool -s false685#--- App Finder686xfconf-query -n -c xfce4-appfinder -p /last/pane-position -t int -s 248687xfconf-query -n -c xfce4-appfinder -p /last/window-height -t int -s 742688xfconf-query -n -c xfce4-appfinder -p /last/window-width -t int -s 648689#--- Enable compositing690xfconf-query -n -c xfwm4 -p /general/use_compositing -t bool -s true691xfconf-query -n -c xfwm4 -p /general/frame_opacity -t int -s 85692#--- Remove "Mail Reader" from menu693file=/usr/share/applications/exo-mail-reader.desktop #; [ -e "${file}" ] && cp -n $file{,.bkup}694sed -i 's/^NotShowIn=*/NotShowIn=XFCE;/; s/^OnlyShowIn=XFCE;/OnlyShowIn=/' "${file}"695grep -q "NotShowIn=XFCE" "${file}" \696|| echo "NotShowIn=XFCE;" >> "${file}"697#--- XFCE for default applications698mkdir -p ~/.local/share/applications/699file=~/.local/share/applications/mimeapps.list; [ -e "${file}" ] && cp -n $file{,.bkup}700[ ! -e "${file}" ] \701&& echo '[Added Associations]' > "${file}"702([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"703#--- Firefox704for VALUE in http https; do705sed -i 's#^x-scheme-handler/'${VALUE}'=.*#x-scheme-handler/'${VALUE}'=exo-web-browser.desktop#' "${file}"706grep -q '^x-scheme-handler/'${VALUE}'=' "${file}" 2>/dev/null \707|| echo 'x-scheme-handler/'${VALUE}'=exo-web-browser.desktop' >> "${file}"708done709#--- Thunar710for VALUE in file trash; do711sed -i 's#x-scheme-handler/'${VALUE}'=.*#x-scheme-handler/'${VALUE}'=exo-file-manager.desktop#' "${file}"712grep -q '^x-scheme-handler/'${VALUE}'=' "${file}" 2>/dev/null \713|| echo 'x-scheme-handler/'${VALUE}'=exo-file-manager.desktop' >> "${file}"714done715file=~/.config/xfce4/helpers.rc; [ -e "${file}" ] && cp -n $file{,.bkup}716([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"717sed -i 's#^FileManager=.*#FileManager=Thunar#' "${file}" 2>/dev/null718grep -q '^FileManager=Thunar' "${file}" 2>/dev/null \719|| echo 'FileManager=Thunar' >> "${file}"720#--- Disable user folders in home folder721file=/etc/xdg/user-dirs.conf; [ -e "${file}" ] && cp -n $file{,.bkup}722sed -i 's/^XDG_/#XDG_/g; s/^#XDG_DESKTOP/XDG_DESKTOP/g;' "${file}"723sed -i 's/^enable=.*/enable=False/' "${file}"724find ~/ -maxdepth 1 -mindepth 1 -type d \725\( -name 'Documents' -o -name 'Music' -o -name 'Pictures' -o -name 'Public' -o -name 'Templates' -o -name 'Videos' \) -empty -delete726apt -y -qq install xdg-user-dirs \727|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2728xdg-user-dirs-update729#--- Remove any old sessions730rm -f ~/.cache/sessions/*731#--- Set XFCE as default desktop manager732update-alternatives --set x-session-manager /usr/bin/xfce4-session #update-alternatives --config x-window-manager #echo "xfce4-session" > ~/.xsession733734735##### Cosmetics (themes & wallpapers)736(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) ${GREEN}Cosmetics${RESET}${RESET} ~ Giving it a personal touch"737export DISPLAY=:0.0738#--- axiom / axiomd (May 18 2010) XFCE4 theme ~ http://xfce-look.org/content/show.php/axiom+xfwm?content=90145739mkdir -p ~/.themes/740timeout 300 curl --progress -k -L -f "https://dl.opendesktop.org/api/files/download/id/1461767736/90145-axiom.tar.gz" > /tmp/axiom.tar.gz \741|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading axiom.tar.gz" 1>&2 #***!!! hardcoded path!742tar -zxf /tmp/axiom.tar.gz -C ~/.themes/743xfconf-query -n -c xsettings -p /Net/ThemeName -s "axiomd"744xfconf-query -n -c xsettings -p /Net/IconThemeName -s "Vibrancy-Kali-Dark"745#--- Get new desktop wallpaper (All are #***!!! hardcoded paths!)746mkdir -p /usr/share/wallpapers/747echo -n '[1/10]'; timeout 300 curl --progress -k -L -f "https://www.kali.org/images/wallpapers-01/kali-wp-june-2014_1920x1080_A.png" > /usr/share/wallpapers/kali_blue_3d_a.png \748|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading kali_blue_3d_a.png" 1>&2749echo -n '[2/10]'; timeout 300 curl --progress -k -L -f "https://www.kali.org/images/wallpapers-01/kali-wp-june-2014_1920x1080_B.png" > /usr/share/wallpapers/kali_blue_3d_b.png \750|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading kali_blue_3d_b.png" 1>&2751echo -n '[3/10]'; timeout 300 curl --progress -k -L -f "https://www.kali.org/images/wallpapers-01/kali-wp-june-2014_1920x1080_G.png" > /usr/share/wallpapers/kali_black_honeycomb.png \752|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading kali_black_honeycomb.png" 1>&2753echo -n '[4/10]'; timeout 300 curl --progress -k -L -f "https://lh5.googleusercontent.com/-CW1-qRVBiqc/U7ARd2T9LCI/AAAAAAAAAGw/oantfR6owSg/w1920-h1080/vzex.png" > /usr/share/wallpapers/kali_blue_splat.png \754|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading kali_blue_splat.png" 1>&2755echo -n '[5/10]'; timeout 300 curl --progress -k -L -f "http://wallpaperstock.net/kali-linux_wallpapers_39530_1920x1080.jpg" > /usr/share/wallpapers/kali-linux_wallpapers_39530.png \756|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading kali-linux_wallpapers_39530.png" 1>&2757echo -n '[6/10]'; timeout 300 curl --progress -k -L -f "http://em3rgency.com/wp-content/uploads/2012/12/Kali-Linux-faded-no-Dragon-small-text.png" > /usr/share/wallpapers/kali_black_clean.png \758|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading kali_black_clean.png" 1>&2759#echo -n '[7/10]'; timeout 300 curl --progress -k -L -f "http://www.hdwallpapers.im/download/kali_linux-wallpaper.jpg" > /usr/share/wallpapers/kali_black_stripes.jpg \760# || echo -e ' '${RED}'[!]'${RESET}" Issue downloading kali_black_stripes.jpg" 1>&2761echo -n '[8/10]'; timeout 300 curl --progress -k -L -f "http://fc01.deviantart.net/fs71/f/2011/118/e/3/bt___edb_wallpaper_by_xxdigipxx-d3f4nxv.png" > /usr/share/wallpapers/kali_bt_edb.jpg \762|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading kali_bt_edb.jpg" 1>&2763echo -n '[9/10]'; timeout 300 curl --progress -k -L -f "http://pre07.deviantart.net/58d1/th/pre/i/2015/223/4/8/kali_2_0_alternate_wallpaper_by_xxdigipxx-d95800s.png" > /usr/share/wallpapers/kali_2_0_alternate_wallpaper.png \764|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading kali_2_0_alternate_wallpaper.png" 1>&2765echo -n '[10/10]'; timeout 300 curl --progress -k -L -f "http://pre01.deviantart.net/4210/th/pre/i/2015/195/3/d/kali_2_0__personal__wp_by_xxdigipxx-d91c8dq.png" > /usr/share/wallpapers/kali_2_0_personal.png \766|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading kali_2_0_personal.png" 1>&2767_TMP="$(find /usr/share/wallpapers/ -maxdepth 1 -type f -name 'kali_*' | xargs -n1 file | grep -i 'HTML\|empty' | cut -d ':' -f1)"768for FILE in $(echo ${_TMP}); do rm -f "${FILE}"; done769#--- Kali 1 (Wallpaper)770[ -e "/usr/share/wallpapers/kali_default-1440x900.jpg" ] \771&& ln -sf /usr/share/wallpapers/kali/contents/images/1440x900.png /usr/share/wallpapers/kali_default-1440x900.jpg772#--- Kali 2 (Login)773[ -e "/usr/share/gnome-shell/theme/KaliLogin.png" ] \774&& cp -f /usr/share/gnome-shell/theme/KaliLogin.png /usr/share/wallpapers/KaliLogin2.0-login.jpg775#--- Kali 2 & Rolling (Wallpaper)776[ -e "/usr/share/images/desktop-base/kali-wallpaper_1920x1080.png" ] \777&& ln -sf /usr/share/images/desktop-base/kali-wallpaper_1920x1080.png /usr/share/wallpapers/kali_default2.0-1920x1080.jpg778#--- New wallpaper & add to startup (so its random each login)779mkdir -p /usr/local/bin/780file=/usr/local/bin/rand-wallpaper; [ -e "${file}" ] && cp -n $file{,.bkup}781cat <<EOF > "${file}" \782|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2783#!/bin/bash784785wallpaper="\$(shuf -n1 -e \$(find /usr/share/wallpapers/ -maxdepth 1 -name 'kali_*'))"786787## XFCE - Desktop wallpaper788/usr/bin/xfconf-query -n -c xfce4-desktop -p /backdrop/screen0/monitor0/image-show -t bool -s true789/usr/bin/xfconf-query -n -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -t string -s "\${wallpaper}"790/usr/bin/xfconf-query -n -c xfce4-desktop -p /backdrop/screen0/monitor0/workspace0/last-image -t string -s "\${wallpaper}"791792## GNOME - Desktop wallpaper793#[[ $(which gnome-shell) ]] \794# && dconf write /org/gnome/desktop/background/picture-uri "'file://\${wallpaper}'"795796## Change lock wallpaper (before swipe) - kali 2 & rolling797/usr/bin/dconf write /org/gnome/desktop/screensaver/picture-uri "'file://\${wallpaper}'"798799## Change login wallpaper (after swipe) - kali 2800#cp -f "\${wallpaper}" /usr/share/gnome-shell/theme/KaliLogin.png801802/usr/bin/xfdesktop --reload 2>/dev/null &803EOF804chmod -f 0500 "${file}"805#--- Run now806bash "${file}"807#--- Add to startup808mkdir -p ~/.config/autostart/809file=~/.config/autostart/wallpaper.desktop; [ -e "${file}" ] && cp -n $file{,.bkup}810cat <<EOF > "${file}" \811|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&2812[Desktop Entry]813Type=Application814Exec=/usr/local/bin/rand-wallpaper815Hidden=false816NoDisplay=false817X-GNOME-Autostart-enabled=true818Name=wallpaper819EOF820821822##### Configure file Note: need to restart xserver for effect823(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Configuring ${GREEN}file${RESET} (Nautilus/Thunar) ~ GUI file system navigation"824#--- Settings825mkdir -p ~/.config/gtk-2.0/826file=~/.config/gtk-2.0/gtkfilechooser.ini; [ -e "${file}" ] && cp -n $file{,.bkup}827([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"828sed -i 's/^.*ShowHidden.*/ShowHidden=true/' "${file}" 2>/dev/null \829|| cat <<EOF > "${file}"830[Filechooser Settings]831LocationMode=path-bar832ShowHidden=true833ExpandFolders=false834ShowSizeColumn=true835GeometryX=66836GeometryY=39837GeometryWidth=780838GeometryHeight=618839SortColumn=name840SortOrder=ascending841EOF842dconf write /org/gnome/nautilus/preferences/show-hidden-files true843#--- Bookmarks844file=/root/.gtk-bookmarks; [ -e "${file}" ] && cp -n $file{,.bkup}845([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"846grep -q '^file:///root/Downloads ' "${file}" 2>/dev/null \847|| echo 'file:///root/Downloads Downloads' >> "${file}"848(dmidecode | grep -iq vmware) \849&& (mkdir -p /mnt/hgfs/ 2>/dev/null; grep -q '^file:///mnt/hgfs ' "${file}" 2>/dev/null \850|| echo 'file:///mnt/hgfs VMShare' >> "${file}")851grep -q '^file:///tmp ' "${file}" 2>/dev/null \852|| echo 'file:///tmp /TMP' >> "${file}"853grep -q '^file:///usr/share ' "${file}" 2>/dev/null \854|| echo 'file:///usr/share Kali Tools' >> "${file}"855grep -q '^file:///opt ' "${file}" 2>/dev/null \856|| echo 'file:///opt /opt' >> "${file}"857grep -q '^file:///usr/local/src ' "${file}" 2>/dev/null \858|| echo 'file:///usr/local/src SRC' >> "${file}"859grep -q '^file:///var/ftp ' "${file}" 2>/dev/null \860|| echo 'file:///var/ftp FTP' >> "${file}"861grep -q '^file:///var/samba ' "${file}" 2>/dev/null \862|| echo 'file:///var/samba Samba' >> "${file}"863grep -q '^file:///var/tftp ' "${file}" 2>/dev/null \864|| echo 'file:///var/tftp TFTP' >> "${file}"865grep -q '^file:///var/www/html ' "${file}" 2>/dev/null \866|| echo 'file:///var/www/html WWW' >> "${file}"867#--- Configure file browser - Thunar (need to re-login for effect)868mkdir -p ~/.config/Thunar/869file=~/.config/Thunar/thunarrc; [ -e "${file}" ] && cp -n $file{,.bkup}870([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"871sed -i 's/LastShowHidden=.*/LastShowHidden=TRUE/' "${file}" 2>/dev/null \872|| echo -e "[Configuration]\nLastShowHidden=TRUE" > "${file}"873874875##### Configure GNOME terminal Note: need to restart xserver for effect876(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Configuring GNOME ${GREEN}terminal${RESET} ~ CLI interface"877gconftool-2 -t bool -s /apps/gnome-terminal/profiles/Default/scrollback_unlimited true878gconftool-2 -t string -s /apps/gnome-terminal/profiles/Default/background_type transparent879gconftool-2 -t string -s /apps/gnome-terminal/profiles/Default/background_darkness 0.85611499999999996880881882##### Configure bash - all users883(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Configuring ${GREEN}bash${RESET} ~ CLI shell"884file=/etc/bash.bashrc; [ -e "${file}" ] && cp -n $file{,.bkup} #~/.bashrc885grep -q "cdspell" "${file}" \886|| echo "shopt -sq cdspell" >> "${file}" # Spell check 'cd' commands887grep -q "autocd" "${file}" \888|| echo "shopt -s autocd" >> "${file}" # So you don't have to 'cd' before a folder889#grep -q "CDPATH" "${file}" \890# || echo "CDPATH=/etc:/usr/share/:/opt" >> "${file}" # Always CD into these folders891grep -q "checkwinsize" "${file}" \892|| echo "shopt -sq checkwinsize" >> "${file}" # Wrap lines correctly after resizing893grep -q "nocaseglob" "${file}" \894|| echo "shopt -sq nocaseglob" >> "${file}" # Case insensitive pathname expansion895grep -q "HISTSIZE" "${file}" \896|| echo "HISTSIZE=10000" >> "${file}" # Bash history (memory scroll back)897grep -q "HISTFILESIZE" "${file}" \898|| echo "HISTFILESIZE=10000" >> "${file}" # Bash history (file .bash_history)899#--- Apply new configs900source "${file}" || source ~/.zshrc901902903##### Install bash colour - all users904(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}bash colour${RESET} ~ colours shell output"905file=/etc/bash.bashrc; [ -e "${file}" ] && cp -n $file{,.bkup} #~/.bashrc906([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"907sed -i 's/.*force_color_prompt=.*/force_color_prompt=yes/' "${file}"908grep -q '^force_color_prompt' "${file}" 2>/dev/null \909|| echo 'force_color_prompt=yes' >> "${file}"910sed -i 's#PS1='"'"'.*'"'"'#PS1='"'"'${debian_chroot:+($debian_chroot)}\\[\\033\[01;31m\\]\\u@\\h\\\[\\033\[00m\\]:\\[\\033\[01;34m\\]\\w\\[\\033\[00m\\]\\$ '"'"'#' "${file}"911grep -q "^export LS_OPTIONS='--color=auto'" "${file}" 2>/dev/null \912|| echo "export LS_OPTIONS='--color=auto'" >> "${file}"913grep -q '^eval "$(dircolors)"' "${file}" 2>/dev/null \914|| echo 'eval "$(dircolors)"' >> "${file}"915grep -q "^alias ls='ls $LS_OPTIONS'" "${file}" 2>/dev/null \916|| echo "alias ls='ls $LS_OPTIONS'" >> "${file}"917grep -q "^alias ll='ls $LS_OPTIONS -l'" "${file}" 2>/dev/null \918|| echo "alias ll='ls $LS_OPTIONS -l'" >> "${file}"919grep -q "^alias l='ls $LS_OPTIONS -lA'" "${file}" 2>/dev/null \920|| echo "alias l='ls $LS_OPTIONS -lA'" >> "${file}"921#--- All other users that are made afterwards922file=/etc/skel/.bashrc #; [ -e "${file}" ] && cp -n $file{,.bkup}923sed -i 's/.*force_color_prompt=.*/force_color_prompt=yes/' "${file}"924#--- Apply new configs925source "${file}" || source ~/.zshrc926927928##### Install grc929(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}grc${RESET} ~ colours shell output"930apt -y -qq install grc \931|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2932#--- Setup aliases933file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases934([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"935grep -q '^## grc diff alias' "${file}" 2>/dev/null \936|| echo -e "## grc diff alias\nalias diff='$(which grc) $(which diff)'\n" >> "${file}"937grep -q '^## grc dig alias' "${file}" 2>/dev/null \938|| echo -e "## grc dig alias\nalias dig='$(which grc) $(which dig)'\n" >> "${file}"939grep -q '^## grc gcc alias' "${file}" 2>/dev/null \940|| echo -e "## grc gcc alias\nalias gcc='$(which grc) $(which gcc)'\n" >> "${file}"941grep -q '^## grc ifconfig alias' "${file}" 2>/dev/null \942|| echo -e "## grc ifconfig alias\nalias ifconfig='$(which grc) $(which ifconfig)'\n" >> "${file}"943grep -q '^## grc mount alias' "${file}" 2>/dev/null \944|| echo -e "## grc mount alias\nalias mount='$(which grc) $(which mount)'\n" >> "${file}"945grep -q '^## grc netstat alias' "${file}" 2>/dev/null \946|| echo -e "## grc netstat alias\nalias netstat='$(which grc) $(which netstat)'\n" >> "${file}"947grep -q '^## grc ping alias' "${file}" 2>/dev/null \948|| echo -e "## grc ping alias\nalias ping='$(which grc) $(which ping)'\n" >> "${file}"949grep -q '^## grc ps alias' "${file}" 2>/dev/null \950|| echo -e "## grc ps alias\nalias ps='$(which grc) $(which ps)'\n" >> "${file}"951grep -q '^## grc tail alias' "${file}" 2>/dev/null \952|| echo -e "## grc tail alias\nalias tail='$(which grc) $(which tail)'\n" >> "${file}"953grep -q '^## grc traceroute alias' "${file}" 2>/dev/null \954|| echo -e "## grc traceroute alias\nalias traceroute='$(which grc) $(which traceroute)'\n" >> "${file}"955grep -q '^## grc wdiff alias' "${file}" 2>/dev/null \956|| echo -e "## grc wdiff alias\nalias wdiff='$(which grc) $(which wdiff)'\n" >> "${file}"957#configure #esperanto #ldap #e #cvs #log #mtr #ls #irclog #mount2 #mount958#--- Apply new aliases959source "${file}" || source ~/.zshrc960961962##### Install bash completion - all users963(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}bash completion${RESET} ~ tab complete CLI commands"964apt -y -qq install bash-completion \965|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2966file=/etc/bash.bashrc; [ -e "${file}" ] && cp -n $file{,.bkup} #~/.bashrc967sed -i '/# enable bash completion in/,+7{/enable bash completion/!s/^#//}' "${file}"968#--- Apply new configs969source "${file}" || source ~/.zshrc970971972##### Configure aliases - root user973(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Configuring ${GREEN}aliases${RESET} ~ CLI shortcuts"974#--- Enable defaults - root user975for FILE in /etc/bash.bashrc ~/.bashrc ~/.bash_aliases; do #/etc/profile /etc/bashrc /etc/bash_aliases /etc/bash.bash_aliases976[[ ! -f "${FILE}" ]] \977&& continue978cp -n $FILE{,.bkup}979sed -i 's/#alias/alias/g' "${FILE}"980done981#--- General system ones982file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases983([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"984grep -q '^## grep aliases' "${file}" 2>/dev/null \985|| echo -e '## grep aliases\nalias grep="grep --color=always"\nalias ngrep="grep -n"\n' >> "${file}"986grep -q '^alias egrep=' "${file}" 2>/dev/null \987|| echo -e 'alias egrep="egrep --color=auto"\n' >> "${file}"988grep -q '^alias fgrep=' "${file}" 2>/dev/null \989|| echo -e 'alias fgrep="fgrep --color=auto"\n' >> "${file}"990#--- Add in ours (OS programs)991grep -q '^alias tmux' "${file}" 2>/dev/null \992|| echo -e '## tmux\nalias tmux="tmux attach || tmux new"\n' >> "${file}" #alias tmux="tmux attach -t $HOST || tmux new -s $HOST"993grep -q '^alias axel' "${file}" 2>/dev/null \994|| echo -e '## axel\nalias axel="axel -a"\n' >> "${file}"995grep -q '^alias screen' "${file}" 2>/dev/null \996|| echo -e '## screen\nalias screen="screen -xRR"\n' >> "${file}"997#--- Add in ours (shortcuts)998grep -q '^## Checksums' "${file}" 2>/dev/null \999|| echo -e '## Checksums\nalias sha1="openssl sha1"\nalias md5="openssl md5"\n' >> "${file}"1000grep -q '^## Force create folders' "${file}" 2>/dev/null \1001|| echo -e '## Force create folders\nalias mkdir="/bin/mkdir -pv"\n' >> "${file}"1002#grep -q '^## Mount' "${file}" 2>/dev/null \1003# || echo -e '## Mount\nalias mount="mount | column -t"\n' >> "${file}"1004grep -q '^## List open ports' "${file}" 2>/dev/null \1005|| echo -e '## List open ports\nalias ports="netstat -tulanp"\n' >> "${file}"1006grep -q '^## Get header' "${file}" 2>/dev/null \1007|| echo -e '## Get header\nalias header="curl -I"\n' >> "${file}"1008grep -q '^## Get external IP address' "${file}" 2>/dev/null \1009|| echo -e '## Get external IP address\nalias ipx="curl -s http://ipinfo.io/ip"\n' >> "${file}"1010grep -q '^## DNS - External IP #1' "${file}" 2>/dev/null \1011|| echo -e '## DNS - External IP #1\nalias dns1="dig +short @resolver1.opendns.com myip.opendns.com"\n' >> "${file}"1012grep -q '^## DNS - External IP #2' "${file}" 2>/dev/null \1013|| echo -e '## DNS - External IP #2\nalias dns2="dig +short @208.67.222.222 myip.opendns.com"\n' >> "${file}"1014grep -q '^## DNS - Check' "${file}" 2>/dev/null \1015|| echo -e '### DNS - Check ("#.abc" is Okay)\nalias dns3="dig +short @208.67.220.220 which.opendns.com txt"\n' >> "${file}"1016grep -q '^## Directory navigation aliases' "${file}" 2>/dev/null \1017|| echo -e '## Directory navigation aliases\nalias ..="cd .."\nalias ...="cd ../.."\nalias ....="cd ../../.."\nalias .....="cd ../../../.."\n' >> "${file}"1018grep -q '^## Extract file' "${file}" 2>/dev/null \1019|| cat <<EOF >> "${file}" \1020|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&210211022## Extract file, example. "ex package.tar.bz2"1023ex() {1024if [[ -f \$1 ]]; then1025case \$1 in1026*.tar.bz2) tar xjf \$1 ;;1027*.tar.gz) tar xzf \$1 ;;1028*.bz2) bunzip2 \$1 ;;1029*.rar) rar x \$1 ;;1030*.gz) gunzip \$1 ;;1031*.tar) tar xf \$1 ;;1032*.tbz2) tar xjf \$1 ;;1033*.tgz) tar xzf \$1 ;;1034*.zip) unzip \$1 ;;1035*.Z) uncompress \$1 ;;1036*.7z) 7z x \$1 ;;1037*) echo \$1 cannot be extracted ;;1038esac1039else1040echo \$1 is not a valid file1041fi1042}1043EOF1044grep -q '^## strings' "${file}" 2>/dev/null \1045|| echo -e '## strings\nalias strings="strings -a"\n' >> "${file}"1046grep -q '^## history' "${file}" 2>/dev/null \1047|| echo -e '## history\nalias hg="history | grep"\n' >> "${file}"1048grep -q '^## Network Services' "${file}" 2>/dev/null \1049|| echo -e '### Network Services\nalias listen="netstat -antp | grep LISTEN"\n' >> "${file}"1050grep -q '^## HDD size' "${file}" 2>/dev/null \1051|| echo -e '### HDD size\nalias hogs="for i in G M K; do du -ah | grep [0-9]$i | sort -nr -k 1; done | head -n 11"\n' >> "${file}"1052grep -q '^## Listing' "${file}" 2>/dev/null \1053|| echo -e '### Listing\nalias ll="ls -l --block-size=1 --color=auto"\n' >> "${file}"1054#--- Add in tools1055grep -q '^## nmap' "${file}" 2>/dev/null \1056|| echo -e '## nmap\nalias nmap="nmap --reason --open --stats-every 3m --max-retries 1 --max-scan-delay 20 --defeat-rst-ratelimit"\n' >> "${file}"1057grep -q '^## aircrack-ng' "${file}" 2>/dev/null \1058|| echo -e '## aircrack-ng\nalias aircrack-ng="aircrack-ng -z"\n' >> "${file}"1059grep -q '^## airodump-ng' "${file}" 2>/dev/null \1060|| echo -e '## airodump-ng \nalias airodump-ng="airodump-ng --manufacturer --wps --uptime"\n' >> "${file}"1061grep -q '^## metasploit' "${file}" 2>/dev/null \1062|| (echo -e '## metasploit\nalias msfc="systemctl start postgresql; msfdb start; msfconsole -q \"\$@\""' >> "${file}" \1063&& echo -e 'alias msfconsole="systemctl start postgresql; msfdb start; msfconsole \"\$@\""\n' >> "${file}" )1064[ "${openVAS}" != "false" ] \1065&& (grep -q '^## openvas' "${file}" 2>/dev/null \1066|| echo -e '## openvas\nalias openvas="openvas-stop; openvas-start; sleep 3s; xdg-open https://127.0.0.1:9392/ >/dev/null 2>&1"\n' >> "${file}")1067grep -q '^## mana-toolkit' "${file}" 2>/dev/null \1068|| (echo -e '## mana-toolkit\nalias mana-toolkit-start="a2ensite 000-mana-toolkit;a2dissite 000-default; systemctl restart apache2"' >> "${file}" \1069&& echo -e 'alias mana-toolkit-stop="a2dissite 000-mana-toolkit; a2ensite 000-default; systemctl restart apache2"\n' >> "${file}" )1070grep -q '^## ssh' "${file}" 2>/dev/null \1071|| echo -e '## ssh\nalias ssh-start="systemctl restart ssh"\nalias ssh-stop="systemctl stop ssh"\n' >> "${file}"1072grep -q '^## samba' "${file}" 2>/dev/null \1073|| echo -e '## samba\nalias smb-start="systemctl restart smbd nmbd"\nalias smb-stop="systemctl stop smbd nmbd"\n' >> "${file}"1074grep -q '^## rdesktop' "${file}" 2>/dev/null \1075|| echo -e '## rdesktop\nalias rdesktop="rdesktop -z -P -g 90% -r disk:local=\"/tmp/\""\n' >> "${file}"1076grep -q '^## python http' "${file}" 2>/dev/null \1077|| echo -e '## python http\nalias http="python2 -m SimpleHTTPServer"\n' >> "${file}"1078#--- Add in folders1079grep -q '^## www' "${file}" 2>/dev/null \1080|| echo -e '## www\nalias wwwroot="cd /var/www/html/"\n#alias www="cd /var/www/html/"\n' >> "${file}"1081grep -q '^## ftp' "${file}" 2>/dev/null \1082|| echo -e '## ftp\nalias ftproot="cd /var/ftp/"\n' >> "${file}"1083grep -q '^## tftp' "${file}" 2>/dev/null \1084|| echo -e '## tftp\nalias tftproot="cd /var/tftp/"\n' >> "${file}"1085grep -q '^## smb' "${file}" 2>/dev/null \1086|| echo -e '## smb\nalias smb="cd /var/samba/"\n#alias smbroot="cd /var/samba/"\n' >> "${file}"1087(dmidecode | grep -iq vmware) \1088&& (grep -q '^## vmware' "${file}" 2>/dev/null \1089|| echo -e '## vmware\nalias vmroot="cd /mnt/hgfs/"\n' >> "${file}")1090grep -q '^## edb' "${file}" 2>/dev/null \1091|| echo -e '## edb\nalias edb="cd /usr/share/exploitdb/platforms/"\nalias edbroot="cd /usr/share/exploitdb/platforms/"\n' >> "${file}"1092grep -q '^## wordlist' "${file}" 2>/dev/null \1093|| echo -e '## wordlist\nalias wordlists="cd /usr/share/wordlists/"\n' >> "${file}"1094#--- Apply new aliases1095source "${file}" || source ~/.zshrc1096#--- Check1097#alias109810991100##### Install (GNOME) Terminator1101(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing (GNOME) ${GREEN}Terminator${RESET} ~ multiple terminals in a single window"1102apt -y -qq install terminator \1103|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&21104#--- Configure terminator1105mkdir -p ~/.config/terminator/1106file=~/.config/terminator/config; [ -e "${file}" ] && cp -n $file{,.bkup}1107cat <<EOF > "${file}" \1108|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&21109[global_config]1110enabled_plugins = TerminalShot, LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler1111[keybindings]1112[profiles]1113[[default]]1114background_darkness = 0.91115scroll_on_output = False1116copy_on_selection = True1117background_type = transparent1118scrollback_infinite = True1119show_titlebar = False1120[layouts]1121[[default]]1122[[[child1]]]1123type = Terminal1124parent = window01125[[[window0]]]1126type = Window1127parent = ""1128[plugins]1129EOF1130#--- Set terminator for XFCE's default1131mkdir -p ~/.config/xfce4/1132file=~/.config/xfce4/helpers.rc; [ -e "${file}" ] && cp -n $file{,.bkup} #exo-preferred-applications #xdg-mime default1133([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"1134sed -i 's_^TerminalEmulator=.*_TerminalEmulator=debian-x-terminal-emulator_' "${file}" 2>/dev/null \1135|| echo -e 'TerminalEmulator=debian-x-terminal-emulator' >> "${file}"113611371138##### Install ZSH & Oh-My-ZSH - root user. Note: 'Open terminal here', will not work with ZSH. Make sure to have tmux already installed1139(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}ZSH${RESET} & ${GREEN}Oh-My-ZSH${RESET} ~ unix shell"1140apt -y -qq install zsh git curl \1141|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&21142#--- Setup oh-my-zsh1143timeout 300 curl --progress -k -L -f "https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh" | zsh1144#--- Configure zsh1145file=~/.zshrc; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/zsh/zshrc1146([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"1147grep -q 'interactivecomments' "${file}" 2>/dev/null \1148|| echo 'setopt interactivecomments' >> "${file}"1149grep -q 'ignoreeof' "${file}" 2>/dev/null \1150|| echo 'setopt ignoreeof' >> "${file}"1151grep -q 'correctall' "${file}" 2>/dev/null \1152|| echo 'setopt correctall' >> "${file}"1153grep -q 'globdots' "${file}" 2>/dev/null \1154|| echo 'setopt globdots' >> "${file}"1155grep -q '.bash_aliases' "${file}" 2>/dev/null \1156|| echo 'source $HOME/.bash_aliases' >> "${file}"1157grep -q '/usr/bin/tmux' "${file}" 2>/dev/null \1158|| echo '#if ([[ -z "$TMUX" && -n "$SSH_CONNECTION" ]]); then /usr/bin/tmux attach || /usr/bin/tmux new; fi' >> "${file}" # If not already in tmux and via SSH1159#--- Configure zsh (themes) ~ https://github.com/robbyrussell/oh-my-zsh/wiki/Themes1160sed -i 's/ZSH_THEME=.*/ZSH_THEME="mh"/' "${file}" # Other themes: mh, jreese, alanpeabody, candy, terminalparty, kardan, nicoulaj, sunaku1161#--- Configure oh-my-zsh1162sed -i 's/plugins=(.*)/plugins=(git git-extras tmux dirhistory python pip)/' "${file}"1163#--- Set zsh as default shell (current user)1164chsh -s "$(which zsh)"116511661167##### Install tmux - all users1168(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}tmux${RESET} ~ multiplex virtual consoles"1169apt -y -qq install tmux \1170|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&21171file=~/.tmux.conf; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/tmux.conf1172#--- Configure tmux1173cat <<EOF > "${file}" \1174|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&21175#-Settings---------------------------------------------------------------------1176## Make it like screen (use CTRL+a)1177unbind C-b1178set -g prefix C-a11791180## Pane switching (SHIFT+ARROWS)1181bind-key -n S-Left select-pane -L1182bind-key -n S-Right select-pane -R1183bind-key -n S-Up select-pane -U1184bind-key -n S-Down select-pane -D11851186## Windows switching (ALT+ARROWS)1187bind-key -n M-Left previous-window1188bind-key -n M-Right next-window11891190## Windows re-ording (SHIFT+ALT+ARROWS)1191bind-key -n M-S-Left swap-window -t -11192bind-key -n M-S-Right swap-window -t +111931194## Activity Monitoring1195setw -g monitor-activity on1196set -g visual-activity on11971198## Set defaults1199set -g default-terminal screen-256color1200set -g history-limit 500012011202## Default windows titles1203set -g set-titles on1204set -g set-titles-string '#(whoami)@#H - #I:#W'12051206## Last window switch1207bind-key C-a last-window12081209## Reload settings (CTRL+a -> r)1210unbind r1211bind r source-file /etc/tmux.conf12121213## Load custom sources1214#source ~/.bashrc #(issues if you use /bin/bash & Debian)12151216EOF1217[ -e /bin/zsh ] \1218&& echo -e '## Use ZSH as default shell\nset-option -g default-shell /bin/zsh\n' >> "${file}"1219cat <<EOF >> "${file}"1220## Show tmux messages for longer1221set -g display-time 300012221223## Status bar is redrawn every minute1224set -g status-interval 60122512261227#-Theme------------------------------------------------------------------------1228## Default colours1229set -g status-bg black1230set -g status-fg white12311232## Left hand side1233set -g status-left-length '34'1234set -g status-left '#[fg=green,bold]#(whoami)#[default]@#[fg=yellow,dim]#H #[fg=green,dim][#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[fg=green,dim]]'12351236## Inactive windows in status bar1237set-window-option -g window-status-format '#[fg=red,dim]#I#[fg=grey,dim]:#[default,dim]#W#[fg=grey,dim]'12381239## Current or active window in status bar1240#set-window-option -g window-status-current-format '#[bg=white,fg=red]#I#[bg=white,fg=grey]:#[bg=white,fg=black]#W#[fg=dim]#F'1241set-window-option -g window-status-current-format '#[fg=red,bold](#[fg=white,bold]#I#[fg=red,dim]:#[fg=white,bold]#W#[fg=red,bold])'12421243## Right hand side1244set -g status-right '#[fg=green][#[fg=yellow]%Y-%m-%d #[fg=white]%H:%M#[fg=green]]'1245EOF1246#--- Setup alias1247file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases1248([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"1249grep -q '^alias tmux' "${file}" 2>/dev/null \1250|| echo -e '## tmux\nalias tmux="tmux attach || tmux new"\n' >> "${file}" #alias tmux="tmux attach -t $HOST || tmux new -s $HOST"1251#--- Apply new alias1252source "${file}" || source ~/.zshrc125312541255##### Configure screen ~ if possible, use tmux instead!1256(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Configuring ${GREEN}screen${RESET} ~ multiplex virtual consoles"1257#apt -y -qq install screen \1258# || echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&21259#--- Configure screen1260file=~/.screenrc; [ -e "${file}" ] && cp -n $file{,.bkup}1261if [[ -f "${file}" ]]; then1262echo -e ' '${RED}'[!]'${RESET}" ${file} detected. Skipping..." 1>&21263else1264cat <<EOF > "${file}"1265## Don't display the copyright page1266startup_message off12671268## tab-completion flash in heading bar1269vbell off12701271## Keep scrollback n lines1272defscrollback 100012731274## Hardstatus is a bar of text that is visible in all screens1275hardstatus on1276hardstatus alwayslastline1277hardstatus string '%{gk}%{G}%H %{g}[%{Y}%l%{g}] %= %{wk}%?%-w%?%{=b kR}(%{W}%n %t%?(%u)%?%{=b kR})%{= kw}%?%+w%?%?%= %{g} %{Y} %Y-%m-%d %C%a %{W}'12781279## Title bar1280termcapinfo xterm ti@:te@12811282## Default windows (syntax: screen -t label order command)1283screen -t bash1 01284screen -t bash2 112851286## Select the default window1287select 01288EOF1289fi129012911292##### Install vim - all users1293(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}vim${RESET} ~ CLI text editor"1294apt -y -qq install vim \1295|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&21296#--- Configure vim1297file=/etc/vim/vimrc; [ -e "${file}" ] && cp -n $file{,.bkup} #~/.vimrc1298([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"1299sed -i 's/.*syntax on/syntax on/' "${file}"1300sed -i 's/.*set background=dark/set background=dark/' "${file}"1301sed -i 's/.*set showcmd/set showcmd/' "${file}"1302sed -i 's/.*set showmatch/set showmatch/' "${file}"1303sed -i 's/.*set ignorecase/set ignorecase/' "${file}"1304sed -i 's/.*set smartcase/set smartcase/' "${file}"1305sed -i 's/.*set incsearch/set incsearch/' "${file}"1306sed -i 's/.*set autowrite/set autowrite/' "${file}"1307sed -i 's/.*set hidden/set hidden/' "${file}"1308sed -i 's/.*set mouse=.*/"set mouse=a/' "${file}"1309grep -q '^set number' "${file}" 2>/dev/null \1310|| echo 'set number' >> "${file}" # Add line numbers1311grep -q '^set expandtab' "${file}" 2>/dev/null \1312|| echo -e 'set expandtab\nset smarttab' >> "${file}" # Set use spaces instead of tabs1313grep -q '^set softtabstop' "${file}" 2>/dev/null \1314|| echo -e 'set softtabstop=4\nset shiftwidth=4' >> "${file}" # Set 4 spaces as a 'tab'1315grep -q '^set foldmethod=marker' "${file}" 2>/dev/null \1316|| echo 'set foldmethod=marker' >> "${file}" # Folding1317grep -q '^nnoremap <space> za' "${file}" 2>/dev/null \1318|| echo 'nnoremap <space> za' >> "${file}" # Space toggle folds1319grep -q '^set hlsearch' "${file}" 2>/dev/null \1320|| echo 'set hlsearch' >> "${file}" # Highlight search results1321grep -q '^set laststatus' "${file}" 2>/dev/null \1322|| echo -e 'set laststatus=2\nset statusline=%F%m%r%h%w\ (%{&ff}){%Y}\ [%l,%v][%p%%]' >> "${file}" # Status bar1323grep -q '^filetype on' "${file}" 2>/dev/null \1324|| echo -e 'filetype on\nfiletype plugin on\nsyntax enable\nset grepprg=grep\ -nH\ $*' >> "${file}" # Syntax highlighting1325grep -q '^set wildmenu' "${file}" 2>/dev/null \1326|| echo -e 'set wildmenu\nset wildmode=list:longest,full' >> "${file}" # Tab completion1327grep -q '^set invnumber' "${file}" 2>/dev/null \1328|| echo -e ':nmap <F8> :set invnumber<CR>' >> "${file}" # Toggle line numbers1329grep -q '^set pastetoggle=<F9>' "${file}" 2>/dev/null \1330|| echo -e 'set pastetoggle=<F9>' >> "${file}" # Hotkey - turning off auto indent when pasting1331grep -q '^:command Q q' "${file}" 2>/dev/null \1332|| echo -e ':command Q q' >> "${file}" # Fix stupid typo I always make1333#--- Set as default editor1334export EDITOR="vim" #update-alternatives --config editor1335file=/etc/bash.bashrc; [ -e "${file}" ] && cp -n $file{,.bkup}1336([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"1337grep -q '^EDITOR' "${file}" 2>/dev/null \1338|| echo 'EDITOR="vim"' >> "${file}"1339git config --global core.editor "vim"1340#--- Set as default mergetool1341git config --global merge.tool vimdiff1342git config --global merge.conflictstyle diff31343git config --global mergetool.prompt false134413451346##### Install git - all users1347(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}git${RESET} ~ revision control"1348apt -y -qq install git \1349|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&21350#--- Set as default editor1351git config --global core.editor "vim"1352#--- Set as default mergetool1353git config --global merge.tool vimdiff1354git config --global merge.conflictstyle diff31355git config --global mergetool.prompt false1356#--- Set as default push1357git config --global push.default simple135813591360##### Setup firefox1361(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}firefox${RESET} ~ GUI web browser"1362apt -y -qq install unzip curl firefox-esr \1363|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&21364#--- Configure firefox1365export DISPLAY=:0.01366timeout 15 firefox >/dev/null 2>&1 # Start and kill. Files needed for first time run1367timeout 5 killall -9 -q -w firefox-esr >/dev/null1368file=$(find ~/.mozilla/firefox/*.default*/ -maxdepth 1 -type f -name 'prefs.js' -print -quit)1369[ -e "${file}" ] \1370&& cp -n $file{,.bkup} #/etc/firefox-esr/pref/*.js1371([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"1372sed -i 's/^.network.proxy.socks_remote_dns.*/user_pref("network.proxy.socks_remote_dns", true);' "${file}" 2>/dev/null \1373|| echo 'user_pref("network.proxy.socks_remote_dns", true);' >> "${file}"1374sed -i 's/^.browser.safebrowsing.enabled.*/user_pref("browser.safebrowsing.enabled", false);' "${file}" 2>/dev/null \1375|| echo 'user_pref("browser.safebrowsing.enabled", false);' >> "${file}"1376sed -i 's/^.browser.safebrowsing.malware.enabled.*/user_pref("browser.safebrowsing.malware.enabled", false);' "${file}" 2>/dev/null \1377|| echo 'user_pref("browser.safebrowsing.malware.enabled", false);' >> "${file}"1378sed -i 's/^.browser.safebrowsing.remoteLookups.enabled.*/user_pref("browser.safebrowsing.remoteLookups.enabled", false);' "${file}" 2>/dev/null \1379|| echo 'user_pref("browser.safebrowsing.remoteLookups.enabled", false);' >> "${file}"1380sed -i 's/^.*browser.startup.page.*/user_pref("browser.startup.page", 0);' "${file}" 2>/dev/null \1381|| echo 'user_pref("browser.startup.page", 0);' >> "${file}"1382sed -i 's/^.*privacy.donottrackheader.enabled.*/user_pref("privacy.donottrackheader.enabled", true);' "${file}" 2>/dev/null \1383|| echo 'user_pref("privacy.donottrackheader.enabled", true);' >> "${file}"1384sed -i 's/^.*browser.showQuitWarning.*/user_pref("browser.showQuitWarning", true);' "${file}" 2>/dev/null \1385|| echo 'user_pref("browser.showQuitWarning", true);' >> "${file}"1386sed -i 's/^.*extensions.https_everywhere._observatory.popup_shown.*/user_pref("extensions.https_everywhere._observatory.popup_shown", true);' "${file}" 2>/dev/null \1387|| echo 'user_pref("extensions.https_everywhere._observatory.popup_shown", true);' >> "${file}"1388sed -i 's/^.network.security.ports.banned.override/user_pref("network.security.ports.banned.override", "1-65455");' "${file}" 2>/dev/null \1389|| echo 'user_pref("network.security.ports.banned.override", "1-65455");' >> "${file}"1390#--- Replace bookmarks (base: http://pentest-bookmarks.googlecode.com)1391file=$(find ~/.mozilla/firefox/*.default*/ -maxdepth 1 -type f -name 'bookmarks.html' -print -quit)1392[ -e "${file}" ] \1393&& cp -n $file{,.bkup} #/etc/firefox-esr/profile/bookmarks.html1394#timeout 300 curl --progress -k -L -f "http://pentest-bookmarks.googlecode.com/files/bookmarksv1.5.html" > /tmp/bookmarks_new.html \1395# || echo -e ' '${RED}'[!]'${RESET}" Issue downloading bookmarks_new.html" 1>&2 #***!!! hardcoded version! Need to manually check for updates1396#--- Configure bookmarks1397#awk '!a[$0]++' /tmp/bookmarks_new.html \1398# | \egrep -v ">(Latest Headlines|Getting Started|Recently Bookmarked|Recent Tags|Mozilla Firefox|Help and Tutorials|Customize Firefox|Get Involved|About Us|Hacker Media|Bookmarks Toolbar|Most Visited)</" \1399# | \egrep -v "^ </DL><p>" \1400# | \egrep -v "^<DD>Add" > "${file}"1401sed -i 's#^</DL><p># </DL><p>\n </DL><p>\n</DL><p>#' "${file}" # Fix import issues from pentest-bookmarks...1402sed -i 's#^ <DL><p># <DL><p>\n <DT><A HREF="http://127.0.0.1/">localhost</A>#' "${file}" # Add localhost to bookmark toolbar (before hackery folder)1403sed -i 's#^</DL><p># <DT><A HREF="https://127.0.0.1:8834/">Nessus</A>\n</DL><p>#' "${file}" # Add Nessus UI bookmark toolbar1404[ "${openVAS}" != "false" ] \1405&& sed -i 's#^</DL><p># <DT><A HREF="https://127.0.0.1:9392/">OpenVAS</A>\n</DL><p>#' "${file}" # Add OpenVAS UI to bookmark toolbar1406sed -i 's#^</DL><p># <DT><A HREF="http://127.0.0.1:3000/ui/panel">BeEF</A>\n</DL><p>#' "${file}" # Add BeEF UI to bookmark toolbar1407sed -i 's#^</DL><p># <DT><A HREF="http://127.0.0.1/rips/">RIPS</A>\n</DL><p>#' "${file}" # Add RIPs to bookmark toolbar1408sed -i 's#^</DL><p># <DT><A HREF="https://paulschou.com/tools/xlate/">XLATE</A>\n</DL><p>#' "${file}" # Add XLATE to bookmark toolbar1409sed -i 's#^</DL><p># <DT><A HREF="https://hackvertor.co.uk/public">HackVertor</A>\n</DL><p>#' "${file}" # Add HackVertor to bookmark toolbar1410sed -i 's#^</DL><p># <DT><A HREF="http://www.irongeek.com/skiddypad.php">SkiddyPad</A>\n</DL><p>#' "${file}" # Add Skiddypad to bookmark toolbar1411sed -i 's#^</DL><p># <DT><A HREF="https://www.exploit-db.com/search/">Exploit-DB</A>\n</DL><p>#' "${file}" # Add Exploit-DB to bookmark toolbar1412sed -i 's#^</DL><p># <DT><A HREF="http://offset-db.com/">Offset-DB</A>\n</DL><p>#' "${file}" # Add Offset-DB to bookmark toolbar1413sed -i 's#^</DL><p># <DT><A HREF="http://shell-storm.org/shellcode/">Shelcodes</A>\n</DL><p>#' "${file}" # Add Shelcodes to bookmark toolbar1414sed -i 's#^</DL><p># <DT><A HREF="http://ropshell.com/">ROP Shell</A>\n</DL><p>#' "${file}" # Add ROP Shell to bookmark toolbar1415sed -i 's#^</DL><p># <DT><A HREF="https://ifconfig.io/">ifconfig</A>\n</DL><p>#' "${file}" # Add ifconfig.io to bookmark toolbar1416sed -i 's#<HR>#<DT><H3 ADD_DATE="1303667175" LAST_MODIFIED="1303667175" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks Toolbar</H3>\n<DD>Add bookmarks to this folder to see them displayed on the Bookmarks Toolbar#' "${file}"1417#--- Clear bookmark cache1418find ~/.mozilla/firefox/*.default*/ -maxdepth 1 -mindepth 1 -type f -name "places.sqlite" -delete1419find ~/.mozilla/firefox/*.default*/bookmarkbackups/ -type f -delete1420#--- Set firefox for XFCE's default1421mkdir -p ~/.config/xfce4/1422file=~/.config/xfce4/helpers.rc; [ -e "${file}" ] && cp -n $file{,.bkup} #exo-preferred-applications #xdg-mime default1423([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"1424sed -i 's#^WebBrowser=.*#WebBrowser=firefox#' "${file}" 2>/dev/null \1425|| echo -e 'WebBrowser=firefox' >> "${file}"142614271428##### Setup firefox's plugins1429(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}firefox's plugins${RESET} ~ useful addons"1430#--- Configure firefox1431export DISPLAY=:0.01432#--- Download extensions1433ffpath="$(find ~/.mozilla/firefox/*.default*/ -maxdepth 0 -mindepth 0 -type d -name '*.default*' -print -quit)/extensions"1434[ "${ffpath}" == "/extensions" ] \1435&& echo -e ' '${RED}'[!]'${RESET}" Couldn't find Firefox folder" 1>&21436mkdir -p "${ffpath}/"1437#--- plug-n-hack1438#curl --progress -k -L -f "https://github.com/mozmark/ringleader/blob/master/fx_pnh.xpi?raw=true????????????????" \1439# || echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'plug-n-hack' 1>&21440#--- HttpFox1441#curl --progress -k -L -f "https://addons.mozilla.org/en-GB/firefox/addon/httpfox/??????????????" \1442# || echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'HttpFox' 1>&21443#--- SQLite Manager1444echo -n '[1/11]'; timeout 300 curl --progress -k -L -f "https://addons.mozilla.org/firefox/downloads/latest/5817/addon-5817-latest.xpi?src=dp-btn-primary" \1445-o "${ffpath}/[email protected]" \1446|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'SQLite Manager'" 1>&21447#--- Cookies Manager+1448echo -n '[2/11]'; timeout 300 curl --progress -k -L -f "https://addons.mozilla.org/firefox/downloads/latest/92079/addon-92079-latest.xpi?src=dp-btn-primary" \1449-o "${ffpath}/{bb6bc1bb-f824-4702-90cd-35e2fb24f25d}.xpi" \1450|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'Cookies Manager+'" 1>&21451#--- Firebug1452echo -n '[3/11]'; timeout 300 curl --progress -k -L -f "https://addons.mozilla.org/firefox/downloads/latest/1843/addon-1843-latest.xpi?src=dp-btn-primary" \1453-o "${ffpath}/[email protected]" \1454|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'Firebug'" 1>&21455#--- FoxyProxy Basic1456echo -n '[4/11]'; timeout 300 curl --progress -k -L -f "https://addons.mozilla.org/firefox/downloads/latest/15023/addon-15023-latest.xpi?src=dp-btn-primary" \1457-o "${ffpath}/[email protected]" \1458|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'FoxyProxy Basic'" 1>&21459#--- User Agent Overrider1460echo -n '[5/11]'; timeout 300 curl --progress -k -L -f "https://addons.mozilla.org/firefox/downloads/latest/429678/addon-429678-latest.xpi?src=dp-btn-primary" \1461-o "${ffpath}/[email protected]" \1462|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'User Agent Overrider'" 1>&21463#--- HTTPS Everywhere1464echo -n '[6/11]'; timeout 300 curl --progress -k -L -f "https://www.eff.org/files/https-everywhere-latest.xpi" \1465-o "${ffpath}/[email protected]" \1466|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'HTTPS Everywhere'" 1>&21467#--- Live HTTP Headers1468echo -n '[7/11]'; timeout 300 curl --progress -k -L -f "https://addons.mozilla.org/firefox/downloads/latest/3829/addon-3829-latest.xpi?src=dp-btn-primary" \1469-o "${ffpath}/{8f8fe09b-0bd3-4470-bc1b-8cad42b8203a}.xpi" \1470|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'Live HTTP Headers'" 1>&21471#---Tamper Data1472echo -n '[8/11]'; timeout 300 curl --progress -k -L -f "https://addons.mozilla.org/firefox/downloads/latest/966/addon-966-latest.xpi?src=dp-btn-primary" \1473-o "${ffpath}/{9c51bd27-6ed8-4000-a2bf-36cb95c0c947}.xpi" \1474|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'Tamper Data'" 1>&21475#--- Disable Add-on Compatibility Checks1476echo -n '[9/11]'; timeout 300 curl --progress -k -L -f "https://addons.mozilla.org/firefox/downloads/latest/300254/addon-300254-latest.xpi?src=dp-btn-primary" \1477-o "${ffpath}/[email protected]" \1478|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'Disable Add-on Compatibility Checks'" 1>&21479#--- Disable HackBar1480echo -n '[10/11]'; timeout 300 curl --progress -k -L -f "https://addons.mozilla.org/firefox/downloads/latest/3899/addon-3899-latest.xpi?src=dp-btn-primary" \1481-o "${ffpath}/{F5DDF39C-9293-4d5e-9AA8-E04E6DD5E9B4}.xpi" \1482|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'HackBar'" 1>&21483#--- uBlock1484echo -n '[11/11]'; timeout 300 curl --progress -k -L -f "https://addons.mozilla.org/firefox/downloads/latest/607454/addon-607454-latest.xpi?src=dp-btn-primary" \1485-o "${ffpath}/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}.xpi" \1486|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading 'uBlock'" 1>&21487#--- Installing extensions1488for FILE in $(find "${ffpath}" -maxdepth 1 -type f -name '*.xpi'); do1489d="$(basename "${FILE}" .xpi)"1490mkdir -p "${ffpath}/${d}/"1491unzip -q -o -d "${ffpath}/${d}/" "${FILE}"1492rm -f "${FILE}"1493done1494#--- Enable Firefox's addons/plugins/extensions1495timeout 15 firefox >/dev/null 2>&11496timeout 5 killall -9 -q -w firefox-esr >/dev/null1497sleep 3s1498#--- Method #1 (Works on older versions)1499file=$(find ~/.mozilla/firefox/*.default*/ -maxdepth 1 -type f -name 'extensions.sqlite' -print -quit) #&& [ -e "${file}" ] && cp -n $file{,.bkup}1500if [[ -e "${file}" ]] || [[ -n "${file}" ]]; then1501echo -e " ${YELLOW}[i]${RESET} Enabled ${YELLOW}Firefox's extensions${RESET} (via method #1 - extensions.sqlite)"1502apt -y -qq install sqlite3 \1503|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&21504rm -f /tmp/firefox.sql1505touch /tmp/firefox.sql1506echo "UPDATE 'main'.'addon' SET 'active' = 1, 'userDisabled' = 0;" > /tmp/firefox.sql # Force them all!1507sqlite3 "${file}" < /tmp/firefox.sql #fuser extensions.sqlite1508fi1509#--- Method #2 (Newer versions)1510file=$(find ~/.mozilla/firefox/*.default*/ -maxdepth 1 -type f -name 'extensions.json' -print -quit) #&& [ -e "${file}" ] && cp -n $file{,.bkup}1511if [[ -e "${file}" ]] || [[ -n "${file}" ]]; then1512echo -e " ${YELLOW}[i]${RESET} Enabled ${YELLOW}Firefox's extensions${RESET} (via method #2 - extensions.json)"1513sed -i 's/"active":false,/"active":true,/g' "${file}" # Force them all!1514sed -i 's/"userDisabled":true,/"userDisabled":false,/g' "${file}" # Force them all!1515fi1516#--- Remove cache1517file=$(find ~/.mozilla/firefox/*.default*/ -maxdepth 1 -type f -name 'prefs.js' -print -quit) #&& [ -e "${file}" ] && cp -n $file{,.bkup}1518[ -n "${file}" ] \1519&& sed -i '/extensions.installCache/d' "${file}"1520#--- For extensions that just work without restarting1521timeout 15 firefox >/dev/null 2>&11522timeout 5 killall -9 -q -w firefox-esr >/dev/null1523sleep 3s1524#--- For (most) extensions, as they need firefox to restart1525timeout 15 firefox >/dev/null 2>&11526timeout 5 killall -9 -q -w firefox-esr >/dev/null1527sleep 5s1528#--- Wipe session (due to force close)1529find ~/.mozilla/firefox/*.default*/ -maxdepth 1 -type f -name 'sessionstore.*' -delete1530#--- Configure foxyproxy1531file=$(find ~/.mozilla/firefox/*.default*/ -maxdepth 1 -type f -name 'foxyproxy.xml' -print -quit) #&& [ -e "${file}" ] && cp -n $file{,.bkup}1532if [[ -z "${file}" ]]; then1533echo -e ' '${RED}'[!]'${RESET}' Something went wrong with the FoxyProxy firefox extension (did any extensions install?). Skipping...' 1>&21534else # Create new1535echo -ne '<?xml version="1.0" encoding="UTF-8"?>\n<foxyproxy mode="disabled" selectedTabIndex="0" toolbaricon="true" toolsMenu="true" contextMenu="false" advancedMenus="false" previousMode="disabled" resetIconColors="true" useStatusBarPrefix="true" excludePatternsFromCycling="false" excludeDisabledFromCycling="false" ignoreProxyScheme="false" apiDisabled="false" proxyForVersionCheck=""><random includeDirect="false" includeDisabled="false"/><statusbar icon="true" text="false" left="options" middle="cycle" right="contextmenu" width="0"/><toolbar left="options" middle="cycle" right="contextmenu"/><logg enabled="false" maxSize="500" noURLs="false" header="<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml"><head><title></title><link rel="icon" href="http://getfoxyproxy.org/favicon.ico"/><link rel="shortcut icon" href="http://getfoxyproxy.org/favicon.ico"/><link rel="stylesheet" href="http://getfoxyproxy.org/styles/log.css" type="text/css"/></head><body><table class="log-table"><thead><tr><td class="heading">${timestamp-heading}</td><td class="heading">${url-heading}</td><td class="heading">${proxy-name-heading}</td><td class="heading">${proxy-notes-heading}</td><td class="heading">${pattern-name-heading}</td><td class="heading">${pattern-heading}</td><td class="heading">${pattern-case-heading}</td><td class="heading">${pattern-type-heading}</td><td class="heading">${pattern-color-heading}</td><td class="heading">${pac-result-heading}</td><td class="heading">${error-msg-heading}</td></tr></thead><tfoot><tr><td/></tr></tfoot><tbody>" row="<tr><td class="timestamp">${timestamp}</td><td class="url"><a href="${url}">${url}</a></td><td class="proxy-name">${proxy-name}</td><td class="proxy-notes">${proxy-notes}</td><td class="pattern-name">${pattern-name}</td><td class="pattern">${pattern}</td><td class="pattern-case">${pattern-case}</td><td class="pattern-type">${pattern-type}</td><td class="pattern-color">${pattern-color}</td><td class="pac-result">${pac-result}</td><td class="error-msg">${error-msg}</td></tr>" footer="</tbody></table></body></html>"/><warnings/><autoadd enabled="false" temp="false" reload="true" notify="true" notifyWhenCanceled="true" prompt="true"><match enabled="true" name="Dynamic AutoAdd Pattern" pattern="*://${3}${6}/*" isRegEx="false" isBlackList="false" isMultiLine="false" caseSensitive="false" fromSubscription="false"/><match enabled="true" name="" pattern="*You are not authorized to view this page*" isRegEx="false" isBlackList="false" isMultiLine="true" caseSensitive="false" fromSubscription="false"/></autoadd><quickadd enabled="false" temp="false" reload="true" notify="true" notifyWhenCanceled="true" prompt="true"><match enabled="true" name="Dynamic QuickAdd Pattern" pattern="*://${3}${6}/*" isRegEx="false" isBlackList="false" isMultiLine="false" caseSensitive="false" fromSubscription="false"/></quickadd><defaultPrefs origPrefetch="null"/><proxies>' > "${file}"1536echo -ne '<proxy name="localhost:8080" id="1145138293" notes="e.g. Burp, w3af" fromSubscription="false" enabled="true" mode="manual" selectedTabIndex="0" lastresort="false" animatedIcons="true" includeInCycle="false" color="#07753E" proxyDNS="true" noInternalIPs="false" autoconfMode="pac" clearCacheBeforeUse="true" disableCache="true" clearCookiesBeforeUse="false" rejectCookies="false"><matches/><autoconf url="" loadNotification="true" errorNotification="true" autoReload="false" reloadFreqMins="60" disableOnBadPAC="true"/><autoconf url="http://wpad/wpad.dat" loadNotification="true" errorNotification="true" autoReload="false" reloadFreqMins="60" disableOnBadPAC="true"/><manualconf host="127.0.0.1" port="8080" socksversion="5" isSocks="false" username="" password="" domain=""/></proxy>' >> "${file}"1537echo -ne '<proxy name="localhost:8081 (socket5)" id="212586674" notes="e.g. SSH" fromSubscription="false" enabled="true" mode="manual" selectedTabIndex="0" lastresort="false" animatedIcons="true" includeInCycle="false" color="#917504" proxyDNS="true" noInternalIPs="false" autoconfMode="pac" clearCacheBeforeUse="true" disableCache="true" clearCookiesBeforeUse="false" rejectCookies="false"><matches/><autoconf url="" loadNotification="true" errorNotification="true" autoReload="false" reloadFreqMins="60" disableOnBadPAC="true"/><autoconf url="http://wpad/wpad.dat" loadNotification="true" errorNotification="true" autoReload="false" reloadFreqMins="60" disableOnBadPAC="true"/><manualconf host="127.0.0.1" port="8081" socksversion="5" isSocks="true" username="" password="" domain=""/></proxy>' >> "${file}"1538echo -ne '<proxy name="No Caching" id="3884644610" notes="" fromSubscription="false" enabled="true" mode="system" selectedTabIndex="0" lastresort="false" animatedIcons="true" includeInCycle="false" color="#990DA6" proxyDNS="true" noInternalIPs="false" autoconfMode="pac" clearCacheBeforeUse="true" disableCache="true" clearCookiesBeforeUse="false" rejectCookies="false"><matches/><autoconf url="" loadNotification="true" errorNotification="true" autoReload="false" reloadFreqMins="60" disableOnBadPAC="true"/><autoconf url="http://wpad/wpad.dat" loadNotification="true" errorNotification="true" autoReload="false" reloadFreqMins="60" disableOnBadPAC="true"/><manualconf host="" port="" socksversion="5" isSocks="false" username="" password="" domain=""/></proxy>' >> "${file}"1539echo -ne '<proxy name="Default" id="3377581719" notes="" fromSubscription="false" enabled="true" mode="direct" selectedTabIndex="0" lastresort="true" animatedIcons="false" includeInCycle="true" color="#0055E5" proxyDNS="true" noInternalIPs="false" autoconfMode="pac" clearCacheBeforeUse="false" disableCache="false" clearCookiesBeforeUse="false" rejectCookies="false"><matches><match enabled="true" name="All" pattern="*" isRegEx="false" isBlackList="false" isMultiLine="false" caseSensitive="false" fromSubscription="false"/></matches><autoconf url="" loadNotification="true" errorNotification="true" autoReload="false" reloadFreqMins="60" disableOnBadPAC="true"/><autoconf url="http://wpad/wpad.dat" loadNotification="true" errorNotification="true" autoReload="false" reloadFreqMins="60" disableOnBadPAC="true"/><manualconf host="" port="" socksversion="5" isSocks="false" username="" password=""/></proxy>' >> "${file}"1540echo -e '</proxies></foxyproxy>' >> "${file}"1541fi154215431544##### Install conky1545(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}conky${RESET} ~ GUI desktop monitor"1546export DISPLAY=:0.01547apt -y -qq install conky \1548|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&21549#--- Configure conky1550file=~/.conkyrc; [ -e "${file}" ] && cp -n $file{,.bkup}1551if [[ -f "${file}" ]]; then1552echo -e ' '${RED}'[!]'${RESET}" ${file} detected. Skipping..." 1>&21553else1554cat <<EOF > "${file}"1555--# Useful: http://forums.opensuse.org/english/get-technical-help-here/how-faq-forums/unreviewed-how-faq/464737-easy-configuring-conky-conkyconf.html1556conky.config = {1557background = false,15581559font = 'monospace:size=8:weight=bold',1560use_xft = true,15611562update_interval = 2.0,15631564own_window = true,1565own_window_type = 'normal',1566own_window_transparent = true,1567own_window_class = 'conky-semi',1568own_window_argb_visual = false,1569own_window_colour = 'brown',1570own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',15711572double_buffer = true,1573maximum_width = 260,15741575draw_shades = true,1576draw_outline = false,1577draw_borders = false,15781579stippled_borders = 3,1580border_inner_margin = 9,1581border_width = 10,15821583default_color = 'grey',15841585alignment = 'bottom_right',1586gap_x = 5,1587gap_y = 0,15881589uppercase = false,1590use_spacer = 'right',1591};15921593conky.text = [[1594\${color dodgerblue3}SYSTEM \${hr 2}\$color1595#\${color white}\${time %A},\${time %e} \${time %B} \${time %G}\${alignr}\${time %H:%M:%S}1596\${color white}Host\$color: \$nodename \${alignr}\${color white}Uptime\$color: \$uptime15971598\${color dodgerblue3}CPU \${hr 2}\$color1599#\${font Arial:bold:size=8}\${execi 99999 grep "model name" -m1 /proc/cpuinfo | cut -d":" -f2 | cut -d" " -f2- | sed "s#Processor ##"}\$font\$color1600\${color white}MHz\$color: \${freq} \${alignr}\${color white}Load\$color: \${exec uptime | awk -F "load average: " '{print \$2}'}1601\${color white}Tasks\$color: \$running_processes/\$processes \${alignr}\${color white}CPU0\$color: \${cpu cpu0}% \${color white}CPU1\$color: \${cpu cpu1}%1602#\${color #c0ff3e}\${acpitemp}C1603#\${execi 20 sensors |grep "Core0 Temp" | cut -d" " -f4}\$font\$color\${alignr}\${freq_g 2} \${execi 20 sensors |grep "Core1 Temp" | cut -d" " -f4}1604\${cpugraph cpu0 25,120 000000 white} \${alignr}\${cpugraph cpu1 25,120 000000 white}1605\${color white}\${cpubar cpu1 3,120} \${alignr}\${color white}\${cpubar cpu2 3,120}\$color16061607\${color dodgerblue3}PROCESSES \${hr 2}\$color1608\${color white}NAME PID CPU MEM1609\${color white}\${top name 1}\${top pid 1} \${top cpu 1} \${top mem 1}\$color1610\${top name 2}\${top pid 2} \${top cpu 2} \${top mem 2}1611\${top name 3}\${top pid 3} \${top cpu 3} \${top mem 3}1612\${top name 4}\${top pid 4} \${top cpu 4} \${top mem 4}1613\${top name 5}\${top pid 5} \${top cpu 5} \${top mem 5}16141615\${color dodgerblue3}MEMORY & SWAP \${hr 2}\$color1616\${color white}RAM\$color \$alignr\$memperc% \${membar 6,170}\$color1617\${color white}Swap\$color \$alignr\$swapperc% \${swapbar 6,170}\$color16181619\${color dodgerblue3}FILESYSTEM \${hr 2}\$color1620\${color white}root\$color \${fs_free_perc /}% free\${alignr}\${fs_free /}/ \${fs_size /}1621\${fs_bar 3 /}\$color1622#\${color white}home\$color \${fs_free_perc /home}% free\${alignr}\${fs_free /home}/ \${fs_size /home}1623#\${fs_bar 3 /home}\$color16241625\${color dodgerblue3}LAN eth0 (\${addr eth0}) \${hr 2}\$color1626\${color white}Down\$color: \${downspeed eth0} KB/s\${alignr}\${color white}Up\$color: \${upspeed eth0} KB/s1627\${color white}Downloaded\$color: \${totaldown eth0} \${alignr}\${color white}Uploaded\$color: \${totalup eth0}1628\${downspeedgraph eth0 25,120 000000 00ff00} \${alignr}\${upspeedgraph eth0 25,120 000000 ff0000}\$color16291630EOF1631ip addr show eth1 &>/dev/null \1632&& cat <<EOF >> "${file}"1633\${color dodgerblue3}LAN eth1 (\${addr eth1}) \${hr 2}\$color1634\${color white}Down\$color: \${downspeed eth1} KB/s\${alignr}\${color white}Up\$color: \${upspeed eth1} KB/s1635\${color white}Downloaded\$color: \${totaldown eth1} \${alignr}\${color white}Uploaded\$color: \${totalup eth1}1636\${downspeedgraph eth1 25,120 000000 00ff00} \${alignr}\${upspeedgraph eth1 25,120 000000 ff0000}\$color16371638EOF1639cat <<EOF >> "${file}"1640\${color dodgerblue3}Wi-Fi (\${addr wlan0}) \${hr 2}\$color1641\${color white}Down\$color: \${downspeed wlan0} KB/s\${alignr}\${color white}Up\$color: \${upspeed wlan0} KB/s1642\${color white}Downloaded\$color: \${totaldown wlan0} \${alignr}\${color white}Uploaded\$color: \${totalup wlan0}1643\${downspeedgraph wlan0 25,120 000000 00ff00} \${alignr}\${upspeedgraph wlan0 25,120 000000 ff0000}\$color16441645\${color dodgerblue3}CONNECTIONS \${hr 2}\$color1646\${color white}Inbound: \$color\${tcp_portmon 1 32767 count} \${alignc}\${color white}Outbound: \$color\${tcp_portmon 32768 61000 count}\${alignr}\${color white}Total: \$color\${tcp_portmon 1 65535 count}1647\${color white}Inbound \${alignr}Local Service/Port\$color1648\$color \${tcp_portmon 1 32767 rhost 0} \${alignr}\${tcp_portmon 1 32767 lservice 0}1649\$color \${tcp_portmon 1 32767 rhost 1} \${alignr}\${tcp_portmon 1 32767 lservice 1}1650\$color \${tcp_portmon 1 32767 rhost 2} \${alignr}\${tcp_portmon 1 32767 lservice 2}1651\${color white}Outbound \${alignr}Remote Service/Port\$color1652\$color \${tcp_portmon 32768 61000 rhost 0} \${alignr}\${tcp_portmon 32768 61000 rservice 0}1653\$color \${tcp_portmon 32768 61000 rhost 1} \${alignr}\${tcp_portmon 32768 61000 rservice 1}1654\$color \${tcp_portmon 32768 61000 rhost 2} \${alignr}\${tcp_portmon 32768 61000 rservice 2}1655]]1656EOF1657fi1658#--- Create start script1659mkdir -p /usr/local/bin/1660file=/usr/local/bin/start-conky; [ -e "${file}" ] && cp -n $file{,.bkup}1661cat <<EOF > "${file}" \1662|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&21663#!/bin/bash16641665[[ -z \${DISPLAY} ]] && export DISPLAY=:0.016661667$(which timeout) 10 $(which killall) -9 -q -w conky1668$(which sleep) 20s1669$(which conky) &1670EOF1671chmod -f 0500 "${file}"1672#--- Run now1673bash /usr/local/bin/start-conky >/dev/null 2>&1 &1674#--- Add to startup (each login)1675mkdir -p ~/.config/autostart/1676file=~/.config/autostart/conkyscript.desktop; [ -e "${file}" ] && cp -n $file{,.bkup}1677cat <<EOF > "${file}" \1678|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&21679[Desktop Entry]1680Name=conky1681Exec=/usr/local/bin/start-conky1682Hidden=false1683NoDisplay=false1684X-GNOME-Autostart-enabled=true1685Type=Application1686Comment=1687EOF1688#--- Add keyboard shortcut (CTRL+r) to run the conky refresh script1689file=~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml #; [ -e "${file}" ] && cp -n $file{,.bkup}1690if [ -e "${file}" ]; then1691grep -q '<property name="<Primary>r" type="string" value="/usr/local/bin/start-conky"/>' "${file}" \1692|| sed -i 's#<property name="\<Alt\>F2" type="string" value="xfrun4"/>#<property name="\<Alt\>F2" type="string" value="xfrun4"/>\n <property name="\<Primary\>r" type="string" value="/usr/local/bin/start-conky"/>#' "${file}"1693fi169416951696##### Install metasploit ~ http://docs.kali.org/general-use/starting-metasploit-framework-in-kali1697(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}metasploit${RESET} ~ exploit framework"1698apt -y -qq install metasploit-framework \1699|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&21700mkdir -p ~/.msf4/modules/{auxiliary,exploits,payloads,post}/1701#--- ASCII art1702#export GOCOW=1 # Always a cow logo ;) Others: THISISHALLOWEEN (Halloween), APRILFOOLSPONIES (My Little Pony)1703#file=~/.bashrc; [ -e "${file}" ] && cp -n $file{,.bkup}1704#([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"1705#grep -q '^GOCOW' "${file}" 2>/dev/null || echo 'GOCOW=1' >> "${file}"1706#--- Fix any port issues1707file=$(find /etc/postgresql/*/main/ -maxdepth 1 -type f -name postgresql.conf -print -quit);1708[ -e "${file}" ] && cp -n $file{,.bkup}1709sed -i 's/port = .* #/port = 5432 /' "${file}"1710#--- Fix permissions - 'could not translate host name "localhost", service "5432" to address: Name or service not known'1711chmod 0644 /etc/hosts1712#--- Start services1713systemctl stop postgresql1714systemctl start postgresql1715msfdb reinit1716sleep 5s1717#--- Autorun Metasploit commands each startup1718file=~/.msf4/msf_autorunscript.rc; [ -e "${file}" ] && cp -n $file{,.bkup}1719if [[ -f "${file}" ]]; then1720echo -e ' '${RED}'[!]'${RESET}" ${file} detected. Skipping..." 1>&21721else1722cat <<EOF > "${file}"1723#run post/windows/escalate/getsystem17241725#run migrate -f -k1726#run migrate -n "explorer.exe" -k # Can trigger AV alerts by touching explorer.exe...17271728#run post/windows/manage/smart_migrate1729#run post/windows/gather/smart_hashdump1730EOF1731fi1732file=~/.msf4/msfconsole.rc; [ -e "${file}" ] && cp -n $file{,.bkup}1733if [[ -f "${file}" ]]; then1734echo -e ' '${RED}'[!]'${RESET}" ${file} detected. Skipping..." 1>&21735else1736cat <<EOF > "${file}"1737load auto_add_route17381739load alias1740alias del rm1741alias handler use exploit/multi/handler17421743load sounds17441745setg TimestampOutput true1746setg VERBOSE true17471748setg ExitOnSession false1749setg EnableStageEncoding true1750setg LHOST 0.0.0.01751setg LPORT 4431752EOF1753#use exploit/multi/handler1754#setg AutoRunScript 'multi_console_command -rc "~/.msf4/msf_autorunscript.rc"'1755#set PAYLOAD windows/meterpreter/reverse_https1756fi1757#--- Aliases time1758file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases1759([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"1760#--- Aliases for console1761grep -q '^alias msfc=' "${file}" 2>/dev/null \1762|| echo -e 'alias msfc="systemctl start postgresql; msfdb start; msfconsole -q \"\$@\""' >> "${file}"1763grep -q '^alias msfconsole=' "${file}" 2>/dev/null \1764|| echo -e 'alias msfconsole="systemctl start postgresql; msfdb start; msfconsole \"\$@\""\n' >> "${file}"1765#--- Aliases to speed up msfvenom (create static output)1766grep -q "^alias msfvenom-list-all" "${file}" 2>/dev/null \1767|| echo "alias msfvenom-list-all='cat ~/.msf4/msfvenom/all'" >> "${file}"1768grep -q "^alias msfvenom-list-nops" "${file}" 2>/dev/null \1769|| echo "alias msfvenom-list-nops='cat ~/.msf4/msfvenom/nops'" >> "${file}"1770grep -q "^alias msfvenom-list-payloads" "${file}" 2>/dev/null \1771|| echo "alias msfvenom-list-payloads='cat ~/.msf4/msfvenom/payloads'" >> "${file}"1772grep -q "^alias msfvenom-list-encoders" "${file}" 2>/dev/null \1773|| echo "alias msfvenom-list-encoders='cat ~/.msf4/msfvenom/encoders'" >> "${file}"1774grep -q "^alias msfvenom-list-formats" "${file}" 2>/dev/null \1775|| echo "alias msfvenom-list-formats='cat ~/.msf4/msfvenom/formats'" >> "${file}"1776grep -q "^alias msfvenom-list-generate" "${file}" 2>/dev/null \1777|| echo "alias msfvenom-list-generate='_msfvenom-list-generate'" >> "${file}"1778grep -q "^function _msfvenom-list-generate" "${file}" 2>/dev/null \1779|| cat <<EOF >> "${file}" \1780|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&21781function _msfvenom-list-generate {1782mkdir -p ~/.msf4/msfvenom/1783msfvenom --list > ~/.msf4/msfvenom/all1784msfvenom --list nops > ~/.msf4/msfvenom/nops1785msfvenom --list payloads > ~/.msf4/msfvenom/payloads1786msfvenom --list encoders > ~/.msf4/msfvenom/encoders1787msfvenom --help-formats 2> ~/.msf4/msfvenom/formats1788}1789EOF1790#--- Apply new aliases1791source "${file}" || source ~/.zshrc1792#--- Generate (Can't call alias)1793mkdir -p ~/.msf4/msfvenom/1794msfvenom --list > ~/.msf4/msfvenom/all1795msfvenom --list nops > ~/.msf4/msfvenom/nops1796msfvenom --list payloads > ~/.msf4/msfvenom/payloads1797msfvenom --list encoders > ~/.msf4/msfvenom/encoders1798msfvenom --help-formats 2> ~/.msf4/msfvenom/formats1799#--- First time run with Metasploit1800(( STAGE++ )); echo -e " ${GREEN}[i]${RESET} (${STAGE}/${TOTAL}) ${GREEN}Starting Metasploit for the first time${RESET} ~ this ${BOLD}will take a ~350 seconds${RESET} (~6 mintues)"1801echo "Started at: $(date)"1802systemctl start postgresql1803msfdb start1804msfconsole -q -x 'version;db_status;sleep 310;exit'180518061807##### Configuring armitage1808(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Configuring ${GREEN}armitage${RESET} ~ GUI Metasploit UI"1809export MSF_DATABASE_CONFIG=/usr/share/metasploit-framework/config/database.yml1810for file in /etc/bash.bashrc ~/.zshrc; do #~/.bashrc1811[ ! -e "${file}" ] && continue1812[ -e "${file}" ] && cp -n $file{,.bkup}1813([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"1814grep -q 'MSF_DATABASE_CONFIG' "${file}" 2>/dev/null \1815|| echo -e 'MSF_DATABASE_CONFIG=/usr/share/metasploit-framework/config/database.yml\n' >> "${file}"1816done1817#--- Test1818#msfrpcd -U msf -P test -f -S -a 127.0.0.1181918201821##### Install exe2hex1822(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}exe2hex${RESET} ~ Inline file transfer"1823apt -y -qq install exe2hexbat \1824|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2182518261827##### Install MPC1828(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}MPC${RESET} ~ Msfvenom Payload Creator"1829apt -y -qq install msfpc \1830|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2183118321833##### Configuring Gedit1834(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Configuring ${GREEN}Gedit${RESET} ~ GUI text editor"1835#--- Install Gedit1836apt -y -qq install gedit \1837|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&21838#--- Configure Gedit1839dconf write /org/gnome/gedit/preferences/editor/wrap-last-split-mode "'word'"1840dconf write /org/gnome/gedit/preferences/ui/statusbar-visible true1841dconf write /org/gnome/gedit/preferences/editor/display-line-numbers true1842dconf write /org/gnome/gedit/preferences/editor/highlight-current-line true1843dconf write /org/gnome/gedit/preferences/editor/bracket-matching true1844dconf write /org/gnome/gedit/preferences/editor/insert-spaces true1845dconf write /org/gnome/gedit/preferences/editor/auto-indent true1846for plugin in modelines sort externaltools docinfo filebrowser quickopen time spell; do1847loaded=$( dconf read /org/gnome/gedit/plugins/active-plugins )1848echo ${loaded} | grep -q "'${plugin}'" \1849&& continue1850new=$( echo "${loaded} '${plugin}']" | sed "s/'] /', /" )1851dconf write /org/gnome/gedit/plugins/active-plugins "${new}"1852done185318541855##### Install PyCharm (Community Edition)1856(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}PyCharm (Community Edition)${RESET} ~ Python IDE"1857timeout 300 curl --progress -k -L -f "https://download.jetbrains.com/python/pycharm-community-2016.2.3.tar.gz" > /tmp/pycharms-community.tar.gz \1858|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading pycharms-community.tar.gz" 1>&2 #***!!! hardcoded version!1859if [ -e /tmp/pycharms-community.tar.gz ]; then1860tar -xf /tmp/pycharms-community.tar.gz -C /tmp/1861rm -rf /opt/pycharms/1862mv -f /tmp/pycharm-community-*/ /opt/pycharms1863mkdir -p /usr/local/bin/1864ln -sf /opt/pycharms/bin/pycharm.sh /usr/local/bin/pycharms1865fi186618671868##### Install wdiff1869(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}wdiff${RESET} ~ Compares two files word by word"1870apt -y -qq install wdiff wdiff-doc \1871|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2187218731874##### Install meld1875(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}meld${RESET} ~ GUI text compare"1876apt -y -qq install meld \1877|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&21878#--- Configure meld1879gconftool-2 -t bool -s /apps/meld/show_line_numbers true1880gconftool-2 -t bool -s /apps/meld/show_whitespace true1881gconftool-2 -t bool -s /apps/meld/use_syntax_highlighting true1882gconftool-2 -t int -s /apps/meld/edit_wrap_lines 2188318841885##### Install vbindiff1886(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}vbindiff${RESET} ~ visually compare binary files"1887apt -y -qq install vbindiff \1888|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2188918901891##### Install OpenVAS1892if [[ "${openVAS}" != "false" ]]; then1893(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}OpenVAS${RESET} ~ vulnerability scanner"1894apt -y -qq install openvas \1895|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&21896openvas-setup1897#--- Bug fix (target credentials creation)1898mkdir -p /var/lib/openvas/gnupg/1899#--- Bug fix (keys)1900curl --progress -k -L -f "http://www.openvas.org/OpenVAS_TI.asc" | gpg --import - \1901|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading OpenVAS_TI.asc" 1>&21902#--- Make sure all services are correct1903openvas-start1904#--- User control1905username="root"1906password="toor"1907(openvasmd --get-users | grep -q ^admin$) \1908&& echo -n 'admin user: ' \1909&& openvasmd --delete-user=admin1910(openvasmd --get-users | grep -q "^${username}$") \1911|| (echo -n "${username} user: "; openvasmd --create-user="${username}"; openvasmd --user="${username}" --new-password="${password}" >/dev/null)1912echo -e " ${YELLOW}[i]${RESET} OpenVAS username: ${username}"1913echo -e " ${YELLOW}[i]${RESET} OpenVAS password: ${password} ***${BOLD}CHANGE THIS ASAP${RESET}***"1914echo -e " ${YELLOW}[i]${RESET} Run: # openvasmd --user=root --new-password='<NEW_PASSWORD>'"1915sleep 3s1916openvas-check-setup1917#--- Remove from start up1918systemctl disable openvas-manager1919systemctl disable openvas-scanner1920systemctl disable greenbone-security-assistant1921#--- Setup alias1922file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases1923grep -q '^## openvas' "${file}" 2>/dev/null \1924|| echo -e '## openvas\nalias openvas="openvas-stop; openvas-start; sleep 3s; xdg-open https://127.0.0.1:9392/ >/dev/null 2>&1"\n' >> "${file}"1925source "${file}" || source ~/.zshrc1926else1927echo -e "\n\n ${YELLOW}[i]${RESET} ${YELLOW}Skipping OpenVAS${RESET} (missing: '$0 ${BOLD}--openvas${RESET}')..." 1>&21928fi192919301931##### Install vFeed1932(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}vFeed${RESET} ~ vulnerability database"1933apt -y -qq install vfeed \1934|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2193519361937##### Install Burp Suite1938if [[ "${burpFree}" != "false" ]]; then1939(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}Burp Suite (Community Edition)${RESET} ~ web application proxy"1940apt -y -qq install burpsuite curl \1941|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&21942mkdir -p ~/.java/.userPrefs/burp/1943file=~/.java/.userPrefs/burp/prefs.xml; #[ -e "${file}" ] && cp -n $file{,.bkup}1944[ -e "${file}" ] \1945|| cat <<EOF > "${file}"1946<?xml version="1.0" encoding="UTF-8" standalone="no"?>1947<!DOCTYPE map SYSTEM "http://java.sun.com/dtd/preferences.dtd" >1948<map MAP_XML_VERSION="1.0">1949<entry key="eulafree" value="2"/>1950<entry key="free.suite.feedbackReportingEnabled" value="false"/>1951</map>1952EOF1953#--- Extract CA1954find /tmp/ -maxdepth 1 -name 'burp*.tmp' -delete1955export DISPLAY=:0.01956timeout 120 burpsuite >/dev/null 2>&1 &1957PID=$!1958sleep 15s1959#echo "-----BEGIN CERTIFICATE-----" > /tmp/PortSwiggerCA \1960# && awk -F '"' '/caCert/ {print $4}' ~/.java/.userPrefs/burp/prefs.xml | fold -w 64 >> /tmp/PortSwiggerCA \1961# && echo "-----END CERTIFICATE-----" >> /tmp/PortSwiggerCA1962export http_proxy="http://127.0.0.1:8080"1963rm -f /tmp/burp.crt1964while test -d /proc/${PID}; do1965sleep 1s1966curl --progress -k -L -f "http://burp/cert" -o /tmp/burp.crt 2>/dev/null # || echo -e ' '${RED}'[!]'${RESET}" Issue downloading burp.crt" 1>&21967[ -f /tmp/burp.crt ] && break1968done1969timeout 5 kill ${PID} 2>/dev/null \1970|| echo -e ' '${RED}'[!]'${RESET}" Failed to kill ${RED}burpsuite${RESET}"1971unset http_proxy1972#--- Installing CA1973if [[ -f /tmp/burp.crt ]]; then1974apt -y -qq install libnss3-tools \1975|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&21976folder=$(find ~/.mozilla/firefox/ -maxdepth 1 -type d -name '*.default' -print -quit)1977certutil -A -n Burp -t "CT,c,c" -d "${folder}" -i /tmp/burp.crt1978timeout 15 firefox >/dev/null 2>&11979timeout 5 killall -9 -q -w firefox-esr >/dev/null1980#mkdir -p /usr/share/ca-certificates/burp/1981#cp -f /tmp/burp.crt /usr/share/ca-certificates/burp/1982#dpkg-reconfigure ca-certificates # Not automated1983echo -e " ${YELLOW}[i]${RESET} Installed ${YELLOW}Burp Suite CA${RESET}"1984else1985echo -e ' '${RED}'[!]'${RESET}' Did not install Burp Suite Certificate Authority (CA)' 1>&21986echo -e ' '${RED}'[!]'${RESET}' Skipping...' 1>&21987fi1988#--- Remove old temp files1989sleep 2s1990find /tmp/ -maxdepth 1 -name 'burp*.tmp' -delete 2>/dev/null1991find ~/.mozilla/firefox/*.default*/ -maxdepth 1 -type f -name 'sessionstore.*' -delete1992unset http_proxy1993else1994echo -e "\n\n ${YELLOW}[i]${RESET} ${YELLOW}Skipping Burp Suite${RESET} (missing: '$0 ${BOLD}--burp${RESET}')..." 1>&21995fi199619971998##### Configure python console - all users1999(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Configuring ${GREEN}python console${RESET} ~ tab complete & history support"2000export PYTHONSTARTUP=$HOME/.pythonstartup2001file=/etc/bash.bashrc; [ -e "${file}" ] && cp -n $file{,.bkup} #~/.bashrc2002grep -q PYTHONSTARTUP "${file}" \2003|| echo 'export PYTHONSTARTUP=$HOME/.pythonstartup' >> "${file}"2004#--- Python start up file2005cat <<EOF > ~/.pythonstartup \2006|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&22007import readline2008import rlcompleter2009import atexit2010import os20112012## Tab completion2013readline.parse_and_bind('tab: complete')20142015## History file2016histfile = os.path.join(os.environ['HOME'], '.pythonhistory')2017try:2018readline.read_history_file(histfile)2019except IOError:2020pass20212022atexit.register(readline.write_history_file, histfile)20232024## Quit2025del os, histfile, readline, rlcompleter2026EOF2027#--- Apply new configs2028source "${file}" || source ~/.zshrc202920302031##### Install virtualenvwrapper2032(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}virtualenvwrapper${RESET} ~ virtual environment wrapper"2033apt -y -qq install virtualenvwrapper \2034|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2203520362037##### Install go2038(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}go${RESET} ~ programming language"2039apt -y -qq install golang \2040|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2204120422043##### Install gitg2044(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}gitg${RESET} ~ GUI git client"2045apt -y -qq install gitg \2046|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2204720482049##### Install sparta2050(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}sparta${RESET} ~ GUI automatic wrapper"2051apt -y -qq install sparta \2052|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2205320542055##### Install wireshark2056(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}Wireshark${RESET} ~ GUI network protocol analyzer"2057#--- Hide running as root warning2058mkdir -p ~/.wireshark/2059file=~/.wireshark/recent_common; #[ -e "${file}" ] && cp -n $file{,.bkup}2060[ -e "${file}" ] \2061|| echo "privs.warn_if_elevated: FALSE" > "${file}"2062#--- Disable lua warning2063[ -e "/usr/share/wireshark/init.lua" ] \2064&& mv -f /usr/share/wireshark/init.lua{,.disabled}206520662067##### Install silver searcher2068(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}silver searcher${RESET} ~ code searching"2069apt -y -qq install silversearcher-ag \2070|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2207120722073##### Install rips2074(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}rips${RESET} ~ source code scanner"2075apt -y -qq install apache2 php git \2076|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22077git clone -q -b master https://github.com/ripsscanner/rips.git /opt/rips-git/ \2078|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&22079pushd /opt/rips-git/ >/dev/null2080git pull -q2081popd >/dev/null2082#--- Add to path2083file=/etc/apache2/conf-available/rips.conf2084[ -e "${file}" ] \2085|| cat <<EOF > "${file}"2086Alias /rips /opt/rips-git20872088<Directory /opt/rips-git/ >2089Options FollowSymLinks2090AllowOverride None2091Order deny,allow2092Deny from all2093Allow from 127.0.0.0/255.0.0.0 ::1/1282094</Directory>2095EOF2096ln -sf /etc/apache2/conf-available/rips.conf /etc/apache2/conf-enabled/rips.conf2097systemctl restart apache2209820992100##### Install graudit2101(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}graudit${RESET} ~ source code auditing"2102apt -y -qq install git \2103|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22104git clone -q -b master https://github.com/wireghoul/graudit.git /opt/graudit-git/ \2105|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&22106pushd /opt/graudit-git/ >/dev/null2107git pull -q2108popd >/dev/null2109#--- Add to path2110mkdir -p /usr/local/bin/2111file=/usr/local/bin/graudit-git2112cat <<EOF > "${file}" \2113|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&22114#!/bin/bash21152116cd /opt/graudit-git/ && bash graudit.sh "\$@"2117EOF2118chmod +x "${file}"211921202121##### Install libreoffice2122(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}LibreOffice${RESET} ~ GUI office suite"2123apt -y -qq install libreoffice \2124|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2212521262127##### Install ipcalc & sipcalc2128(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}ipcalc${RESET} & ${GREEN}sipcalc${RESET} ~ CLI subnet calculators"2129apt -y -qq install ipcalc sipcalc \2130|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2213121322133##### Install asciinema2134(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}asciinema${RESET} ~ CLI terminal recorder"2135curl -s -L https://asciinema.org/install | sh213621372138##### Install shutter2139(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}shutter${RESET} ~ GUI static screen capture"2140apt -y -qq install shutter \2141|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2214221432144##### Install psmisc ~ allows for 'killall command' to be used2145(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}psmisc${RESET} ~ suite to help with running processes"2146apt -y -qq install psmisc \2147|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2214821492150###### Setup pipe viewer2151(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}pipe viewer${RESET} ~ CLI progress bar"2152apt -y -qq install pv \2153|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2215421552156###### Setup pwgen2157(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}pwgen${RESET} ~ password generator"2158apt -y -qq install pwgen \2159|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2216021612162##### Install htop2163(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}htop${RESET} ~ CLI process viewer"2164apt -y -qq install htop \2165|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2216621672168##### Install powertop2169(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}powertop${RESET} ~ CLI power consumption viewer"2170apt -y -qq install powertop \2171|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2217221732174##### Install iotop2175(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}iotop${RESET} ~ CLI I/O usage"2176apt -y -qq install iotop \2177|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2217821792180##### Install ca-certificates2181(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}ca-certificates${RESET} ~ HTTPS/SSL/TLS"2182apt -y -qq install ca-certificates \2183|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2218421852186##### Install testssl2187(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}testssl${RESET} ~ Testing TLS/SSL encryption"2188apt -y -qq install testssl.sh \2189|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2219021912192##### Install UACScript2193(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}UACScript${RESET} ~ UAC Bypass for Windows 7"2194apt -y -qq install git windows-binaries \2195|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22196git clone -q -b master https://github.com/Vozzie/uacscript.git /opt/uacscript-git/ \2197|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&22198pushd /opt/uacscript-git/ >/dev/null2199git pull -q2200popd >/dev/null2201ln -sf /usr/share/windows-binaries/uac-win7 /opt/uacscript-git/220222032204##### Install MiniReverse_Shell_With_Parameters2205(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}MiniReverse_Shell_With_Parameters${RESET} ~ Generate shellcode for a reverse shell"2206apt -y -qq install git windows-binaries \2207|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22208git clone -q -b master https://github.com/xillwillx/MiniReverse_Shell_With_Parameters.git /opt/minireverse-shell-with-parameters-git/ \2209|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&22210pushd /opt/minireverse-shell-with-parameters-git/ >/dev/null2211git pull -q2212popd >/dev/null2213ln -sf /usr/share/windows-binaries/MiniReverse /opt/minireverse-shell-with-parameters-git/221422152216##### Install axel2217(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}axel${RESET} ~ CLI download manager"2218apt -y -qq install axel \2219|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22220#--- Setup alias2221file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases2222([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"2223grep -q '^alias axel' "${file}" 2>/dev/null \2224|| echo -e '## axel\nalias axel="axel -a"\n' >> "${file}"2225#--- Apply new alias2226source "${file}" || source ~/.zshrc222722282229##### Install html2text2230(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}html2text${RESET} ~ CLI html rendering"2231apt -y -qq install html2text \2232|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2223322342235##### Install tmux2html2236(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}tmux2html${RESET} ~ Render tmux as HTML"2237apt -y -qq install git python python-pip \2238|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22239pip install tmux2html224022412242##### Install gparted2243(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}GParted${RESET} ~ GUI partition manager"2244apt -y -qq install gparted \2245|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2224622472248##### Install daemonfs2249(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}daemonfs${RESET} ~ GUI file monitor"2250apt -y -qq install daemonfs \2251|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2225222532254##### Install filezilla2255(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}FileZilla${RESET} ~ GUI file transfer"2256apt -y -qq install filezilla \2257|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22258#--- Configure filezilla2259export DISPLAY=:0.02260timeout 5 filezilla >/dev/null 2>&1 # Start and kill. Files needed for first time run2261mkdir -p ~/.config/filezilla/2262file=~/.config/filezilla/filezilla.xml; [ -e "${file}" ] && cp -n $file{,.bkup}2263[ ! -e "${file}" ] && cat <<EOF> "${file}"2264<?xml version="1.0" encoding="UTF-8"?>2265<FileZilla3 version="3.15.0.2" platform="*nix">2266<Settings>2267<Setting name="Default editor">0</Setting>2268<Setting name="Always use default editor">0</Setting>2269</Settings>2270</FileZilla3>2271fi2272EOF2273sed -i 's#^.*"Default editor".*#\t<Setting name="Default editor">2/usr/bin/gedit</Setting>#' "${file}"2274[ -e /usr/bin/atom ] && sed -i 's#^.*"Default editor".*#\t<Setting name="Default editor">2/usr/bin/atom</Setting>#' "${file}"2275sed -i 's#^.*"Always use default editor".*#\t<Setting name="Always use default editor">1</Setting>#' "${file}"227622772278##### Install ncftp2279(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}ncftp${RESET} ~ CLI FTP client"2280apt -y -qq install ncftp \2281|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2228222832284##### Install p7zip2285(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}p7zip${RESET} ~ CLI file extractor"2286apt -y -qq install p7zip-full \2287|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2228822892290##### Install zip & unzip2291(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}zip${RESET} & ${GREEN}unzip${RESET} ~ CLI file extractors"2292apt -y -qq install zip unzip \2293|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2229422952296##### Install file roller2297(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}file roller${RESET} ~ GUI file extractor"2298apt -y -qq install file-roller \2299|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22300apt -y -qq install unace unrar rar unzip zip p7zip p7zip-full p7zip-rar \2301|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2230223032304##### Install VPN support2305(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}VPN${RESET} support for Network-Manager"2306for FILE in network-manager-openvpn network-manager-pptp network-manager-vpnc network-manager-openconnect network-manager-iodine; do2307apt -y -qq install "${FILE}" \2308|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22309done231023112312##### Install hashid2313(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}hashid${RESET} ~ identify hash types"2314apt -y -qq install hashid \2315|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2231623172318##### Install httprint2319(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}httprint${RESET} ~ GUI web server fingerprint"2320apt -y -qq install httprint \2321|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2232223232324##### Install lbd2325(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}lbd${RESET} ~ load balancing detector"2326apt -y -qq install lbd \2327|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2232823292330##### Install wafw00f2331(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}wafw00f${RESET} ~ WAF detector"2332apt -y -qq install wafw00f \2333|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2233423352336##### Install aircrack-ng2337(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}Aircrack-ng${RESET} ~ Wi-Fi cracking suite"2338apt -y -qq install aircrack-ng curl \2339|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22340#--- Setup hardware database2341mkdir -p /etc/aircrack-ng/2342(timeout 600 airodump-ng-oui-update 2>/dev/null) \2343|| timeout 600 curl --progress -k -L -f "http://standards-oui.ieee.org/oui/oui.txt" > /etc/aircrack-ng/oui.txt2344[ -e /etc/aircrack-ng/oui.txt ] \2345&& (\grep "(hex)" /etc/aircrack-ng/oui.txt | sed 's/^[ \t]*//g;s/[ \t]*$//g' > /etc/aircrack-ng/airodump-ng-oui.txt)2346[[ ! -f /etc/aircrack-ng/airodump-ng-oui.txt ]] \2347&& echo -e ' '${RED}'[!]'${RESET}" Issue downloading oui.txt" 1>&22348#--- Setup alias2349file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases2350([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"2351grep -q '^## aircrack-ng' "${file}" 2>/dev/null \2352|| echo -e '## aircrack-ng\nalias aircrack-ng="aircrack-ng -z"\n' >> "${file}"2353grep -q '^## airodump-ng' "${file}" 2>/dev/null \2354|| echo -e '## airodump-ng \nalias airodump-ng="airodump-ng --manufacturer --wps --uptime"\n' >> "${file}" # aircrack-ng 1.2 rc22355#--- Apply new alias2356source "${file}" || source ~/.zshrc235723582359##### Install reaver (community fork)2360(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}reaver (community fork)${RESET} ~ WPS pin brute force + Pixie Attack"2361apt -y -qq install reaver pixiewps \2362|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2236323642365##### Install bully2366(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}bully${RESET} ~ WPS pin brute force"2367apt -y -qq install bully \2368|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2236923702371##### Install wifite2372(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}wifite${RESET} ~ automated Wi-Fi tool"2373apt -y -qq install wifite \2374|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2237523762377##### Install vulscan script for nmap2378(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}vulscan script for nmap${RESET} ~ vulnerability scanner add-on"2379apt -y -qq install nmap curl \2380|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22381mkdir -p /usr/share/nmap/scripts/vulscan/2382timeout 300 curl --progress -k -L -f "http://www.computec.ch/projekte/vulscan/download/nmap_nse_vulscan-2.0.tar.gz" > /tmp/nmap_nse_vulscan.tar.gz \2383|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading file" 1>&2 #***!!! hardcoded version! Need to manually check for updates2384gunzip /tmp/nmap_nse_vulscan.tar.gz2385tar -xf /tmp/nmap_nse_vulscan.tar -C /usr/share/nmap/scripts/2386#--- Fix permissions (by default its 0777)2387chmod -R 0755 /usr/share/nmap/scripts/; find /usr/share/nmap/scripts/ -type f -exec chmod 0644 {} \;238823892390##### Install unicornscan2391(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}unicornscan${RESET} ~ fast port scanner"2392apt -y -qq install unicornscan \2393|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2239423952396##### Install onetwopunch2397(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}onetwopunch${RESET} ~ unicornscan & nmap wrapper"2398apt -y -qq install git nmap unicornscan \2399|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22400git clone -q -b master https://github.com/superkojiman/onetwopunch.git /opt/onetwopunch-git/ \2401|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&22402pushd /opt/onetwopunch-git/ >/dev/null2403git pull -q2404popd >/dev/null2405#--- Add to path2406mkdir -p /usr/local/bin/2407file=/usr/local/bin/onetwopunch-git2408cat <<EOF > "${file}" \2409|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&22410#!/bin/bash24112412cd /opt/onetwopunch-git/ && bash onetwopunch.sh "\$@"2413EOF2414chmod +x "${file}"241524162417##### Install Gnmap-Parser (fork)2418(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}Gnmap-Parser (fork)${RESET} ~ Parse Nmap exports into various plain-text formats"2419apt -y -qq install git \2420|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22421git clone -q -b master https://github.com/nullmode/gnmap-parser.git /opt/gnmap-parser-git/ \2422|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&22423pushd /opt/gnmap-parser-git/ >/dev/null2424git pull -q2425popd >/dev/null2426#--- Add to path2427chmod +x /opt/gnmap-parser-git/gnmap-parser.sh2428mkdir -p /usr/local/bin/2429ln -sf /opt/gnmap-parser-git/gnmap-parser.sh /usr/local/bin/gnmap-parser-git243024312432##### Install udp-proto-scanner2433(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}udp-proto-scanner${RESET} ~ common UDP port scanner"2434apt -y -qq install curl \2435|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22436timeout 300 curl --progress -k -L -f "https://labs.portcullis.co.uk/download/udp-proto-scanner-1.1.tar.gz" -o /tmp/udp-proto-scanner.tar.gz \2437|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading udp-proto-scanner.tar.gz" 1>&22438gunzip /tmp/udp-proto-scanner.tar.gz2439tar -xf /tmp/udp-proto-scanner.tar -C /opt/2440mv -f /opt/udp-proto-scanner{-1.1,}2441#--- Add to path2442mkdir -p /usr/local/bin/2443file=/usr/local/bin/udp-proto-scanner2444cat <<EOF > "${file}" \2445|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&22446#!/bin/bash24472448cd /opt/udp-proto-scanner/ && perl udp-proto-scanner.pl "\$@"2449EOF2450chmod +x "${file}"245124522453##### Install clusterd2454(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}clusterd${RESET} ~ clustered attack toolkit (JBoss, ColdFusion, WebLogic, Tomcat etc)"2455apt -y -qq install clusterd \2456|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2245724582459##### Install webhandler2460(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}webhandler${RESET} ~ shell TTY handler"2461apt -y -qq install webhandler \2462|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22463#--- Add to path2464mkdir -p /usr/local/bin/2465ln -sf /usr/bin/webhandler /usr/local/bin/wh246624672468##### Install azazel2469(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}azazel${RESET} ~ Linux userland rootkit"2470apt -y -qq install git \2471|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22472git clone -q -b master https://github.com/chokepoint/azazel.git /opt/azazel-git/ \2473|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&22474pushd /opt/azazel-git/ >/dev/null2475git pull -q2476popd >/dev/null247724782479##### Install Babadook2480(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}Babadook${RESET} ~ connection-less powershell backdoor"2481apt -y -qq install git \2482|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22483git clone -q -b master https://github.com/jseidl/Babadook.git /opt/babadook-git/ \2484|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&22485pushd /opt/babadook-git/ >/dev/null2486git pull -q2487popd >/dev/null248824892490##### Install pupy2491(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}pupy${RESET} ~ Remote Administration Tool"2492apt -y -qq install git \2493|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22494git clone -q -b master https://github.com/n1nj4sec/pupy.git /opt/pupy-git/ \2495|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&22496pushd /opt/pupy-git/ >/dev/null2497git pull -q2498popd >/dev/null249925002501##### Install gobuster2502(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}gobuster${RESET} ~ Directory/File/DNS busting tool"2503apt -y -qq install git gobuster \2504|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2250525062507##### Install reGeorg2508(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}reGeorg${RESET} ~ pivot via web shells"2509git clone -q -b master https://github.com/sensepost/reGeorg.git /opt/regeorg-git \2510|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&22511pushd /opt/regeorg-git/ >/dev/null2512git pull -q2513popd >/dev/null2514#--- Link to others2515apt -y -qq install webshells \2516|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22517ln -sf /opt/reGeorg-git /usr/share/webshells/reGeorg251825192520##### Install b374k (https://bugs.kali.org/view.php?id=1097)2521(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}b374k${RESET} ~ (PHP) web shell"2522apt -y -qq install git php-cli \2523|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22524git clone -q -b master https://github.com/b374k/b374k.git /opt/b374k-git/ \2525|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&22526pushd /opt/b374k-git/ >/dev/null2527git pull -q2528php index.php -o b374k.php -s2529popd >/dev/null2530#--- Link to others2531apt -y -qq install webshells \2532|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22533ln -sf /opt/b374k-git /usr/share/webshells/php/b374k253425352536##### Install adminer2537(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}adminer${RESET} ~ Database management in a single PHP file"2538apt -y -qq install git \2539|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22540git clone -q -b master https://github.com/vrana/adminer.git /opt/adminer-git/ \2541|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&22542pushd /opt/adminer-git/ >/dev/null2543git pull -q2544php compile.php 2>/dev/null2545popd >/dev/null2546#--- Link to others2547apt -y -qq install webshells \2548|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22549file=$(find /opt/adminer-git/ -name adminer-*.php -type f -print -quit)2550ln -sf "${file}" /usr/share/webshells/php/adminer.php255125522553##### Install WeBaCoo2554(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}WeBaCoo${RESET} ~ Web backdoor cookie"2555apt -y -qq install webacoo \2556|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2255725582559##### Install cmdsql2560(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}cmdsql${RESET} ~ (ASPX) web shell"2561apt -y -qq install git \2562|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22563git clone -q -b master https://github.com/NetSPI/cmdsql.git /opt/cmdsql-git/ \2564|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&22565pushd /opt/cmdsql-git/ >/dev/null2566git pull -q2567popd >/dev/null2568#--- Link to others2569apt -y -qq install webshells \2570|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22571ln -sf /opt/cmdsql-git /usr/share/webshells/aspx/cmdsql257225732574##### Install JSP file browser2575(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}JSP file browser${RESET} ~ (JSP) web shell"2576apt -y -qq install curl \2577|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22578mkdir -p /opt/jsp-filebrowser/2579timeout 300 curl --progress -k -L -f "http://www.vonloesch.de/files/browser.zip" > /tmp/jsp.zip \2580|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading jsp.zip" 1>&22581unzip -q -o -d /opt/jsp-filebrowser/ /tmp/jsp.zip2582#--- Link to others2583apt -y -qq install webshells \2584|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22585ln -sf /opt/jsp-filebrowser /usr/share/webshells/jsp/jsp-filebrowser258625872588##### Install htshells2589(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}htShells${RESET} ~ (htdocs/apache) web shells"2590apt -y -qq install htshells \2591|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2259225932594##### Install python-pty-shells2595(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}python-pty-shells${RESET} ~ PTY shells"2596apt -y -qq install git \2597|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22598git clone -q -b master https://github.com/infodox/python-pty-shells.git /opt/python-pty-shells-git/ \2599|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&22600pushd /opt/python-pty-shells-git/ >/dev/null2601git pull -q2602popd >/dev/null260326042605##### Install bridge-utils2606(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}bridge-utils${RESET} ~ Bridge network interfaces"2607apt -y -qq install bridge-utils \2608|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2260926102611##### Install FruityWifi2612(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}FruityWifi${RESET} ~ Wireless network auditing tool"2613apt -y -qq install fruitywifi \2614|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22615# URL: https://localhost:84432616if [[ -e /var/www/html/index.nginx-debian.html ]]; then2617grep -q '<title>Welcome to nginx on Debian!</title>' /var/www/html/index.nginx-debian.html \2618&& echo 'Permission denied.' > /var/www/html/index.nginx-debian.html2619fi262026212622##### Install WPA2-HalfHandshake-Crack2623(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}WPA2-HalfHandshake-Crack${RESET} ~ Rogue AP for handshakes without a AP"2624apt -y -qq install git \2625|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22626git clone -q -b master https://github.com/dxa4481/WPA2-HalfHandshake-Crack.git /opt/wpa2-halfhandshake-crack-git/ \2627|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&22628pushd /opt/wpa2-halfhandshake-crack-git/ >/dev/null2629git pull -q2630popd >/dev/null263126322633##### Install HT-WPS-Breaker2634(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}HT-WPS-Breaker${RESET} ~ Auto WPS tool"2635apt -y -qq install git \2636|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22637git clone -q -b master https://github.com/SilentGhostX/HT-WPS-Breaker.git /opt/ht-wps-breaker-git/ \2638|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&22639pushd /opt/ht-wps-breaker-git/ >/dev/null2640git pull -q2641popd >/dev/null264226432644##### Install dot11decrypt2645(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}dot11decrypt${RESET} ~ On-the-fly WEP/WPA2 decrypter"2646apt -y -qq install git \2647|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22648git clone -q -b master https://github.com/mfontanini/dot11decrypt.git /opt/dot11decrypt-git/ \2649|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&22650pushd /opt/dot11decrypt-git/ >/dev/null2651git pull -q2652popd >/dev/null265326542655##### Install mana toolkit2656(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}MANA toolkit${RESET} ~ Rogue AP for MITM Wi-Fi"2657apt -y -qq install mana-toolkit \2658|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22659#--- Disable profile2660a2dissite 000-mana-toolkit; a2ensite 000-default2661#--- Setup alias2662file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases2663([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"2664grep -q '^## mana-toolkit' "${file}" 2>/dev/null \2665|| (echo -e '## mana-toolkit\nalias mana-toolkit-start="a2ensite 000-mana-toolkit;a2dissite 000-default; systemctl restart apache2"' >> "${file}" \2666&& echo -e 'alias mana-toolkit-stop="a2dissite 000-mana-toolkit; a2ensite 000-default; systemctl restart apache2"\n' >> "${file}" )2667#--- Apply new alias2668source "${file}" || source ~/.zshrc266926702671##### Install wifiphisher2672(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}wifiphisher${RESET} ~ Automated Wi-Fi phishing"2673apt -y -qq install git \2674|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22675git clone -q -b master https://github.com/sophron/wifiphisher.git /opt/wifiphisher-git/ \2676|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&22677pushd /opt/wifiphisher-git/ >/dev/null2678git pull -q2679popd >/dev/null2680#--- Add to path2681mkdir -p /usr/local/bin/2682file=/usr/local/bin/wifiphisher-git2683cat <<EOF > "${file}" \2684|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&22685#!/bin/bash26862687cd /opt/wifiphisher-git/ && python wifiphisher.py "\$@"2688EOF2689chmod +x "${file}"269026912692##### Install hostapd-wpe-extended2693(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}hostapd-wpe-extended${RESET} ~ Rogue AP for WPA-Enterprise"2694apt -y -qq install git \2695|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22696git clone -q -b master https://github.com/NerdyProjects/hostapd-wpe-extended.git /opt/hostapd-wpe-extended-git/ \2697|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&22698pushd /opt/hostapd-wpe-extended-git/ >/dev/null2699git pull -q2700popd >/dev/null270127022703##### Install proxychains-ng (https://bugs.kali.org/view.php?id=2037)2704(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}proxychains-ng${RESET} ~ Proxifier"2705apt -y -qq install git gcc \2706|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22707git clone -q -b master https://github.com/rofl0r/proxychains-ng.git /opt/proxychains-ng-git/ \2708|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&22709pushd /opt/proxychains-ng-git/ >/dev/null2710git pull -q2711make -s clean2712./configure --prefix=/usr --sysconfdir=/etc >/dev/null2713make -s 2>/dev/null && make -s install # bad, but it gives errors which might be confusing (still builds)2714popd >/dev/null2715#--- Add to path (with a 'better' name)2716mkdir -p /usr/local/bin/2717ln -sf /usr/bin/proxychains4 /usr/local/bin/proxychains-ng271827192720##### Install httptunnel2721(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}httptunnel${RESET} ~ Tunnels data streams in HTTP requests"2722apt -y -qq install http-tunnel \2723|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2272427252726##### Install sshuttle2727(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}sshuttle${RESET} ~ VPN over SSH"2728apt -y -qq install sshuttle \2729|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22730#--- Example2731#sshuttle --dns --remote [email protected] 0/0 -vv273227332734##### Install pfi2735(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}pfi${RESET} ~ Port Forwarding Interceptor"2736apt -y -qq install git \2737|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22738git clone -q -b master https://github.com/s7ephen/pfi.git /opt/pfi-git/ \2739|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&22740pushd /opt/pfi-git/ >/dev/null2741git pull -q2742popd >/dev/null274327442745##### Install icmpsh2746(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}icmpsh${RESET} ~ Reverse ICMP shell"2747apt -y -qq install git \2748|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22749git clone -q -b master https://github.com/inquisb/icmpsh.git /opt/icmpsh-git/ \2750|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&22751pushd /opt/icmpsh-git/ >/dev/null2752git pull -q2753popd >/dev/null275427552756##### Install dnsftp2757(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}dnsftp${RESET} ~ Transfer files over DNS"2758apt -y -qq install git \2759|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22760git clone -q -b master https://github.com/breenmachine/dnsftp.git /opt/dnsftp-git/ \2761|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&22762pushd /opt/dnsftp-git/ >/dev/null2763git pull -q2764popd >/dev/null276527662767##### Install iodine2768(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}iodine${RESET} ~ DNS tunnelling (IP over DNS)"2769apt -y -qq install iodine \2770|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22771#iodined -f -P password1 10.0.0.1 dns.mydomain.com2772#iodine -f -P password1 123.9.9.9 dns.mydomain.com; ssh -C -D 8081 [email protected]277327742775##### Install dns2tcp2776(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}dns2tcp${RESET} ~ DNS tunnelling (TCP over DNS)"2777apt -y -qq install dns2tcp \2778|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22779#--- Daemon2780file=/etc/dns2tcpd.conf; [ -e "${file}" ] && cp -n $file{,.bkup};2781cat <<EOF > "${file}" \2782|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&22783listen = 0.0.0.02784port = 532785user = nobody2786chroot = /tmp2787domain = dnstunnel.mydomain.com2788key = password12789ressources = ssh:127.0.0.1:222790EOF2791#--- Client2792file=/etc/dns2tcpc.conf; [ -e "${file}" ] && cp -n $file{,.bkup};2793cat <<EOF > "${file}" \2794|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&22795domain = dnstunnel.mydomain.com2796key = password12797resources = ssh2798local_port = 80002799debug_level=12800EOF2801#--- Example2802#dns2tcpd -F -d 1 -f /etc/dns2tcpd.conf2803#dns2tcpc -f /etc/dns2tcpc.conf 178.62.206.227; ssh -C -D 8081 -p 8000 [email protected]280428052806##### Install ptunnel2807(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}ptunnel${RESET} ~ ICMP tunnelling"2808apt -y -qq install ptunnel \2809|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22810#--- Example2811#ptunnel -x password12812#ptunnel -x password1 -p 123.9.9.9 -lp 8000 -da 127.0.0.1 -dp 22; ssh -C -D 8081 -p 8000 [email protected]281328142815##### Install stunnel2816(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}stunnel${RESET} ~ SSL wrapper"2817apt -y -qq install stunnel \2818|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22819#--- Remove from start up2820systemctl disable stunnel4282128222823##### Install zerofree2824(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}zerofree${RESET} ~ CLI nulls free blocks on a HDD"2825apt -y -qq install zerofree \2826|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22827#--- Example2828#fdisk -l2829#zerofree -v /dev/sda12830#for i in $(mount | grep sda | grep ext | cut -b 9); do mount -o remount,ro /dev/sda${i} && zerofree -v /dev/sda${i} && mount -o remount,rw /dev/sda${i}; done283128322833##### Install gcc & multilib2834(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}gcc${RESET} & ${GREEN}multilibc${RESET} ~ compiling libraries"2835for FILE in cc gcc g++ gcc-multilib make automake libc6 libc6-dev libc6-amd64 libc6-dev-amd64 libc6-i386 libc6-dev-i386 libc6-i686 libc6-dev-i686 build-essential dpkg-dev; do2836apt -y -qq install "${FILE}" 2>/dev/null2837done283828392840##### Install MinGW ~ cross compiling suite2841(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}MinGW${RESET} ~ cross compiling suite"2842for FILE in mingw-w64 binutils-mingw-w64 gcc-mingw-w64 cmake mingw-w64-dev mingw-w64-tools gcc-mingw-w64-i686 gcc-mingw-w64-x86-64 mingw32; do2843apt -y -qq install "${FILE}" 2>/dev/null2844done284528462847##### Install WINE2848(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}WINE${RESET} ~ run Windows programs on *nix"2849apt -y -qq install wine winetricks \2850|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22851#--- Using x64?2852if [[ "$(uname -m)" == 'x86_64' ]]; then2853(( STAGE++ )); echo -e " ${GREEN}[i]${RESET} (${STAGE}/${TOTAL}) Configuring ${GREEN}WINE (x64)${RESET}"2854dpkg --add-architecture i3862855apt -qq update2856apt -y -qq install wine32 \2857|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22858fi2859#--- Run WINE for the first time2860[ -e /usr/share/windows-binaries/whoami.exe ] && wine /usr/share/windows-binaries/whoami.exe &>/dev/null2861#--- Setup default file association for .exe2862file=~/.local/share/applications/mimeapps.list; [ -e "${file}" ] && cp -n $file{,.bkup}2863([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"2864echo -e 'application/x-ms-dos-executable=wine.desktop' >> "${file}"286528662867##### Install MinGW (Windows) ~ cross compiling suite2868(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}MinGW (Windows)${RESET} ~ cross compiling suite"2869apt -y -qq install wine curl unzip \2870|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22871timeout 300 curl --progress -k -L -f "http://sourceforge.net/projects/mingw/files/Installer/mingw-get/mingw-get-0.6.2-beta-20131004-1/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip/download" > /tmp/mingw-get.zip \2872|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading mingw-get.zip" 1>&2 #***!!! hardcoded path!2873mkdir -p ~/.wine/drive_c/MinGW/bin/2874unzip -q -o -d ~/.wine/drive_c/MinGW/ /tmp/mingw-get.zip2875pushd ~/.wine/drive_c/MinGW/ >/dev/null2876for FILE in mingw32-base mingw32-gcc-g++ mingw32-gcc-objc; do #msys-base2877wine ./bin/mingw-get.exe install "${FILE}" 2>&1 | grep -v 'If something goes wrong, please rerun with\|for more detailed debugging output'2878done2879popd >/dev/null2880#--- Add to windows path2881grep -q '^"PATH"=.*C:\\\\MinGW\\\\bin' ~/.wine/system.reg \2882|| sed -i '/^"PATH"=/ s_"$_;C:\\\\MinGW\\\\bin"_' ~/.wine/system.reg288328842885##### Downloading AccessChk.exe2886(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Downloading ${GREEN}AccessChk.exe${RESET} ~ Windows environment tester"2887apt -y -qq install curl windows-binaries unzip \2888|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22889echo -n '[1/2]'; timeout 300 curl --progress -k -L -f "https://web.archive.org/web/20080530012252/http://live.sysinternals.com/accesschk.exe" > /usr/share/windows-binaries/accesschk_v5.02.exe \2890|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading accesschk_v5.02.exe" 1>&2 #***!!! hardcoded path!2891echo -n '[2/2]'; timeout 300 curl --progress -k -L -f "https://download.sysinternals.com/files/AccessChk.zip" > /usr/share/windows-binaries/AccessChk.zip \2892|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading AccessChk.zip" 1>&22893unzip -q -o -d /usr/share/windows-binaries/ /usr/share/windows-binaries/AccessChk.zip2894rm -f /usr/share/windows-binaries/{AccessChk.zip,Eula.txt}289528962897##### Downloading PsExec.exe2898(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Downloading ${GREEN}PsExec.exe${RESET} ~ Pass The Hash 'phun'"2899apt -y -qq install curl windows-binaries unzip unrar \2900|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22901echo -n '[1/2]'; timeout 300 curl --progress -k -L -f "https://download.sysinternals.com/files/PSTools.zip" > /tmp/pstools.zip \2902|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading pstools.zip" 1>&22903echo -n '[2/2]'; timeout 300 curl --progress -k -L -f "http://www.coresecurity.com/system/files/pshtoolkit_v1.4.rar" > /tmp/pshtoolkit.rar \2904|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading pshtoolkit.rar" 1>&2 #***!!! hardcoded path!2905unzip -q -o -d /usr/share/windows-binaries/pstools/ /tmp/pstools.zip2906unrar x -y /tmp/pshtoolkit.rar /usr/share/windows-binaries/ >/dev/null290729082909##### Install Python (Windows via WINE)2910(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}Python (Windows)${RESET}"2911echo -n '[1/2]'; timeout 300 curl --progress -k -L -f "https://www.python.org/ftp/python/2.7.9/python-2.7.9.msi" > /tmp/python.msi \2912|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading python.msi" 1>&2 #***!!! hardcoded path!2913echo -n '[2/2]'; timeout 300 curl --progress -k -L -f "http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win32-py2.7.exe/download" > /tmp/pywin32.exe \2914|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading pywin32.exe" 1>&2 #***!!! hardcoded path!2915wine msiexec /i /tmp/python.msi /qb 2>&1 | grep -v 'If something goes wrong, please rerun with\|for more detailed debugging output'2916pushd /tmp/ >/dev/null2917rm -rf "PLATLIB/" "SCRIPTS/"2918unzip -q -o /tmp/pywin32.exe2919cp -rf PLATLIB/* ~/.wine/drive_c/Python27/Lib/site-packages/2920cp -rf SCRIPTS/* ~/.wine/drive_c/Python27/Scripts/2921rm -rf "PLATLIB/" "SCRIPTS/"2922popd >/dev/null292329242925##### Install veil framework2926(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}veil-evasion framework${RESET} ~ bypassing anti-virus"2927apt -y -qq install veil-evasion \2928|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22929#bash /usr/share/veil-evasion/setup/setup.sh --silent2930mkdir -p /var/lib/veil-evasion/go/bin/2931touch /etc/veil/settings.py2932sed -i 's/TERMINAL_CLEAR=".*"/TERMINAL_CLEAR="false"/' /etc/veil/settings.py293329342935##### Install OP packers2936(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}OP packers${RESET} ~ bypassing anti-virus"2937apt -y -qq install upx-ucl curl \2938|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22939mkdir -p /opt/packers/2940echo -n '[1/3]'; timeout 300 curl --progress -k -L -f "http://www.eskimo.com/~scottlu/win/cexe.exe" > /opt/packers/cexe.exe \2941|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading cexe.exe" 1>&2 #***!!! hardcoded version! Need to manually check for updates2942echo -n '[2/3]'; timeout 300 curl --progress -k -L -f "http://www.farbrausch.de/~fg/kkrunchy/kkrunchy_023a2.zip" > /opt/packers/kkrunchy.zip \2943&& unzip -q -o -d /opt/packers/ /opt/packers/kkrunchy.zip \2944|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading kkrunchy.zip" 1>&2 #***!!! hardcoded version! Need to manually check for updates2945echo -n '[3/3]'; timeout 300 curl --progress -k -L -f "https://github.com/Veil-Framework/Veil-Evasion/blob/master/tools/pescrambler/PEScrambler.exe" > /opt/packers/PEScrambler \2946|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading PEScrambler.exe" 1>&2 #***!!! hardcoded version! Need to manually check for updates2947#*** ??????? Need to make a bash script like hyperion...2948#--- Link to others2949apt -y -qq install windows-binaries \2950|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22951ln -sf /opt/packers/ /usr/share/windows-binaries/packers295229532954##### Install hyperion2955(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}hyperion${RESET} ~ bypassing anti-virus"2956apt -y -qq install unzip windows-binaries \2957|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&22958unzip -q -o -d /usr/share/windows-binaries/ $(find /usr/share/windows-binaries/ -name "Hyperion-*.zip" -type f -print -quit)2959#--- Compile2960i686-w64-mingw32-g++ -static-libgcc -static-libstdc++ \2961/usr/share/windows-binaries/Hyperion-1.0/Src/Crypter/*.cpp \2962-o /usr/share/windows-binaries/Hyperion-1.0/Src/Crypter/bin/crypter.exe2963ln -sf /usr/share/windows-binaries/Hyperion-1.0/Src/Crypter/bin/crypter.exe /usr/share/windows-binaries/Hyperion-1.0/crypter.exe #***!!! hardcoded path!2964wine ~/.wine/drive_c/MinGW/bin/g++.exe /usr/share/windows-binaries/Hyperion-1.0/Src/Crypter/*.cpp \2965-o /usr/share/windows-binaries/hyperion.exe 2>&1 \2966| grep -v 'If something goes wrong, please rerun with\|for more detailed debugging output'2967#--- Add to path2968mkdir -p /usr/local/bin/2969file=/usr/local/bin/hyperion2970cat <<EOF > "${file}" \2971|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&22972#!/bin/bash29732974## Note: This is far from perfect...29752976CWD=\$(pwd)/2977BWD="?"29782979## Using full path?2980[ -e "/\${1}" ] && BWD=""29812982## Using relative path?2983[ -e "./\${1}" ] && BWD="\${CWD}"29842985## Can't find input file!2986[[ "\${BWD}" == "?" ]] && echo -e ' '${RED}'[!]'${RESET}' Cant find \$1. Quitting...' && exit29872988## The magic!2989cd /usr/share/windows-binaries/Hyperion-1.0/2990$(which wine) ./Src/Crypter/bin/crypter.exe \${BWD}\${1} output.exe29912992## Restore our path2993cd \${CWD}/2994sleep 1s29952996## Move the output file2997mv -f /usr/share/windows-binaries/Hyperion-1.0/output.exe \${2}29982999## Generate file hashes3000for FILE in \${1} \${2}; do3001echo "[i] \$(md5sum \${FILE})"3002done3003EOF3004chmod +x "${file}"300530063007##### Install shellter3008(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}shellter${RESET} ~ dynamic shellcode injector"3009apt -y -qq install shellter \3010|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2301130123013##### Install the backdoor factory3014(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}Backdoor Factory${RESET} ~ bypassing anti-virus"3015apt -y -qq install backdoor-factory \3016|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2301730183019##### Install Backdoor Factory Proxy (BDFProxy)3020(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}Backdoor Factory Proxy (BDFProxy)${RESET} ~ patches binaries files during a MITM"3021apt -y -qq install bdfproxy \3022|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2302330243025##### Install BetterCap3026(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}BetterCap${RESET} ~ MITM framework"3027apt -y -qq install git ruby-dev libpcap-dev \3028|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23029git clone -q -b master https://github.com/evilsocket/bettercap.git /opt/bettercap-git/ \3030|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&23031pushd /opt/bettercap-git/ >/dev/null3032git pull -q3033gem build bettercap.gemspec3034gem install bettercap*.gem3035popd >/dev/null303630373038##### Install mitmf3039(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}MITMf${RESET} ~ framework for MITM attacks"3040apt -y -qq install mitmf \3041|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2304230433044##### Install responder3045(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}Responder${RESET} ~ rogue server"3046apt -y -qq install responder \3047|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2304830493050##### Install seclist3051(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}seclist${RESET} ~ multiple types of (word)lists (and similar things)"3052apt -y -qq install seclists \3053|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23054#--- Link to others3055apt -y -qq install wordlists \3056|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23057[ -e /usr/share/seclists ] \3058&& ln -sf /usr/share/seclists /usr/share/wordlists/seclists30593060# https://github.com/fuzzdb-project/fuzzdb306130623063##### Update wordlists3064(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Updating ${GREEN}wordlists${RESET} ~ collection of wordlists"3065apt -y -qq install wordlists curl \3066|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23067#--- Extract rockyou wordlist3068[ -e /usr/share/wordlists/rockyou.txt.gz ] \3069&& gzip -dc < /usr/share/wordlists/rockyou.txt.gz > /usr/share/wordlists/rockyou.txt3070#--- Add 10,000 Top/Worst/Common Passwords3071mkdir -p /usr/share/wordlists/3072(curl --progress -k -L -f "http://xato.net/files/10k most common.zip" > /tmp/10kcommon.zip 2>/dev/null \3073|| curl --progress -k -L -f "http://download.g0tmi1k.com/wordlists/common-10k_most_common.zip" > /tmp/10kcommon.zip 2>/dev/null) \3074|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading 10kcommon.zip" 1>&23075unzip -q -o -d /usr/share/wordlists/ /tmp/10kcommon.zip 2>/dev/null #***!!! hardcoded version! Need to manually check for updates3076mv -f /usr/share/wordlists/10k{\ most\ ,_most_}common.txt3077#--- Linking to more - folders3078[ -e /usr/share/dirb/wordlists ] \3079&& ln -sf /usr/share/dirb/wordlists /usr/share/wordlists/dirb3080#--- Extract sqlmap wordlist3081unzip -o -d /usr/share/sqlmap/txt/ /usr/share/sqlmap/txt/wordlist.zip3082ln -sf /usr/share/sqlmap/txt/wordlist.txt /usr/share/wordlists/sqlmap.txt3083#--- Not enough? Want more? Check below!3084#apt search wordlist3085#find / \( -iname '*wordlist*' -or -iname '*passwords*' \) #-exec ls -l {} \;308630873088##### Install apt-file3089(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}apt-file${RESET} ~ which package includes a specific file"3090apt -y -qq install apt-file \3091|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23092apt-file update309330943095##### Install apt-show-versions3096(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}apt-show-versions${RESET} ~ which package version in repo"3097apt -y -qq install apt-show-versions \3098|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2309931003101##### Install Babel scripts3102(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}Babel scripts${RESET} ~ post exploitation scripts"3103apt -y -qq install git \3104|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23105git clone -q -b master https://github.com/attackdebris/babel-sf.git /opt/babel-sf-git/ \3106|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&23107pushd /opt/babel-sf-git/ >/dev/null3108git pull -q3109popd >/dev/null311031113112##### Install checksec3113(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}checksec${RESET} ~ check *nix OS for security features"3114apt -y -qq install curl \3115|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23116mkdir -p /usr/share/checksec/3117file=/usr/share/checksec/checksec.sh3118timeout 300 curl --progress -k -L -f "http://www.trapkit.de/tools/checksec.sh" > "${file}" \3119|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading checksec.sh" 1>&2 #***!!! hardcoded patch3120chmod +x "${file}"312131223123##### Install shellconv3124(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}shellconv${RESET} ~ shellcode disassembler"3125apt -y -qq install git \3126|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23127git clone -q -b master https://github.com/hasherezade/shellconv.git /opt/shellconv-git/ \3128|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&23129pushd /opt/shellconv-git/ >/dev/null3130git pull -q3131popd >/dev/null3132#--- Add to path3133mkdir -p /usr/local/bin/3134file=/usr/local/bin/shellconv-git3135cat <<EOF > "${file}" \3136|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&23137#!/bin/bash31383139cd /opt/shellconv-git/ && python shellconv.py "\$@"3140EOF3141chmod +x "${file}"314231433144##### Install bless3145#(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}bless${RESET} ~ GUI hex editor"3146#apt -y -qq install bless \3147# || echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2314831493150##### Install dhex3151(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}dhex${RESET} ~ CLI hex compare"3152apt -y -qq install dhex \3153|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2315431553156##### Install firmware-mod-kit3157(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}firmware-mod-kit${RESET} ~ customize firmware"3158apt -y -qq install firmware-mod-kit \3159|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2316031613162##### Install lnav3163(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}lnav${RESET} ~ CLI log veiwer"3164apt -y -qq install lnav \3165|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2316631673168##### Install commix3169(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}commix${RESET} ~ automatic command injection"3170apt -y -qq install commix \3171|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2317231733174##### Install fimap3175(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}fimap${RESET} ~ automatic LFI/RFI tool"3176apt -y -qq install fimap \3177|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2317831793180##### Install smbmap3181(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}smbmap${RESET} ~ SMB enumeration tool"3182apt -y -qq install smbmap \3183|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2318431853186##### Install smbspider3187(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}smbspider${RESET} ~ search network shares"3188apt -y -qq install git \3189|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23190git clone -q -b master https://github.com/T-S-A/smbspider.git /opt/smbspider-git/ \3191|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&23192pushd /opt/smbspider-git/ >/dev/null3193git pull -q3194popd >/dev/null319531963197##### Install CrackMapExec3198(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}CrackMapExec${RESET} ~ Swiss army knife for Windows environments"3199apt -y -qq install git \3200|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23201git clone -q -b master https://github.com/byt3bl33d3r/CrackMapExec.git /opt/crackmapexec-git/ \3202|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&23203pushd /opt/crackmapexec-git/ >/dev/null3204git pull -q3205popd >/dev/null320632073208##### Install credcrack3209(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}credcrack${RESET} ~ credential harvester via Samba"3210apt -y -qq install git \3211|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23212git clone -q -b master https://github.com/gojhonny/CredCrack.git /opt/credcrack-git/ \3213|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&23214pushd /opt/credcrack-git/ >/dev/null3215git pull -q3216popd >/dev/null321732183219##### Install Empire3220(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}Empire${RESET} ~ PowerShell post-exploitation"3221apt -y -qq install git \3222|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23223git clone -q -b master https://github.com/PowerShellEmpire/Empire.git /opt/empire-git/ \3224|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&23225pushd /opt/empire-git/ >/dev/null3226git pull -q3227popd >/dev/null322832293230##### Install wig (https://bugs.kali.org/view.php?id=1932)3231(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}wig${RESET} ~ web application detection"3232apt -y -qq install git \3233|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23234git clone -q -b master https://github.com/jekyc/wig.git /opt/wig-git/ \3235|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&23236pushd /opt/wig-git/ >/dev/null3237git pull -q3238popd >/dev/null3239#--- Add to path3240mkdir -p /usr/local/bin/3241file=/usr/local/bin/wig-git3242cat <<EOF > "${file}" \3243|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&23244#!/bin/bash32453246cd /opt/wig-git/ && python wig.py "\$@"3247EOF3248chmod +x "${file}"324932503251##### Install CMSmap3252(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}CMSmap${RESET} ~ CMS detection"3253apt -y -qq install git \3254|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23255git clone -q -b master https://github.com/Dionach/CMSmap.git /opt/cmsmap-git/ \3256|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&23257pushd /opt/cmsmap-git/ >/dev/null3258git pull -q3259popd >/dev/null3260#--- Add to path3261mkdir -p /usr/local/bin/3262file=/usr/local/bin/cmsmap-git3263cat <<EOF > "${file}" \3264|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&23265#!/bin/bash32663267cd /opt/cmsmap-git/ && python cmsmap.py "\$@"3268EOF3269chmod +x "${file}"327032713272##### Install droopescan3273(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}DroopeScan${RESET} ~ Drupal vulnerability scanner"3274apt -y -qq install git \3275|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23276git clone -q -b master https://github.com/droope/droopescan.git /opt/droopescan-git/ \3277|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&23278pushd /opt/droopescan-git/ >/dev/null3279git pull -q3280popd >/dev/null3281#--- Add to path3282mkdir -p /usr/local/bin/3283file=/usr/local/bin/droopescan-git3284cat <<EOF > "${file}" \3285|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&23286#!/bin/bash32873288cd /opt/droopescan-git/ && python droopescan "\$@"3289EOF3290chmod +x "${file}"329132923293##### Install BeEF XSS3294(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}BeEF XSS${RESET} ~ XSS framework"3295apt -y -qq install beef-xss \3296|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23297#--- Configure beef3298file=/usr/share/beef-xss/config.yaml; [ -e "${file}" ] && cp -n $file{,.bkup}3299username="root"3300password="toor"3301sed -i 's/user:.*".*"/user: "'${username}'"/' "${file}"3302sed -i 's/passwd:.*".*"/passwd: "'${password}'"/' "${file}"3303echo -e " ${YELLOW}[i]${RESET} BeEF username: ${username}"3304echo -e " ${YELLOW}[i]${RESET} BeEF password: ${password} ***${BOLD}CHANGE THIS ASAP${RESET}***"3305echo -e " ${YELLOW}[i]${RESET} Edit: /usr/share/beef-xss/config.yaml"3306#--- Example3307#<script src="http://192.168.155.175:3000/hook.js" type="text/javascript"></script>330833093310##### Install patator (GIT)3311(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}patator${RESET} (GIT) ~ brute force"3312apt -y -qq install git \3313|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23314git clone -q -b master https://github.com/lanjelot/patator.git /opt/patator-git/ \3315|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&23316pushd /opt/patator-git/ >/dev/null3317git pull -q3318popd >/dev/null3319#--- Add to path3320mkdir -p /usr/local/bin/3321file=/usr/local/bin/patator-git3322cat <<EOF > "${file}" \3323|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&23324#!/bin/bash33253326cd /opt/patator-git/ && python patator.py "\$@"3327EOF3328chmod +x "${file}"332933303331##### Install crowbar3332(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}crowbar${RESET} ~ brute force"3333apt -y -qq install git openvpn freerdp-x11 vncviewer \3334|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23335git clone -q -b master https://github.com/galkan/crowbar.git /opt/crowbar-git/ \3336|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&23337pushd /opt/crowbar-git/ >/dev/null3338git pull -q3339popd >/dev/null3340#--- Add to path3341mkdir -p /usr/local/bin/3342file=/usr/local/bin/crowbar-git3343cat <<EOF > "${file}" \3344|| echo -e ' '${RED}'[!] Issue with writing file'${RESET} 1>&23345#!/bin/bash33463347cd /opt/crowbar-git/ && python crowbar.py "\$@"3348EOF3349chmod +x "${file}"335033513352##### Install xprobe3353(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}xprobe${RESET} ~ OS fingerprinting"3354apt -y -qq install xprobe \3355|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2335633573358##### Install p0f3359(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}p0f${RESET} ~ OS fingerprinting"3360apt -y -qq install p0f \3361|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23362#p0f -i eth0 -p & curl 192.168.0.1336333643365##### Install nbtscan ~ http://unixwiz.net/tools/nbtscan.html vs http://inetcat.org/software/nbtscan.html (see http://sectools.org/tool/nbtscan/)3366(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}nbtscan${RESET} (${GREEN}inetcat${RESET} & ${GREEN}unixwiz${RESET}) ~ netbios scanner"3367#--- inetcat - 1.5.x3368apt -y -qq install nbtscan \3369|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23370#--- Examples3371#nbtscan -r 192.168.0.1/243372#nbtscan -r 192.168.0.1/24 -v3373#--- unixwiz - 1.0.x3374mkdir -p /usr/local/src/nbtscan-unixwiz/3375timeout 300 curl --progress -k -L -f "http://unixwiz.net/tools/nbtscan-source-1.0.35.tgz" > /usr/local/src/nbtscan-unixwiz/nbtscan.tgz \3376|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading nbtscan.tgz" 1>&2 #***!!! hardcoded version! Need to manually check for updates3377tar -zxf /usr/local/src/nbtscan-unixwiz/nbtscan.tgz -C /usr/local/src/nbtscan-unixwiz/3378pushd /usr/local/src/nbtscan-unixwiz/ >/dev/null3379make -s clean;3380make -s 2>/dev/null # bad, I know3381popd >/dev/null3382#--- Add to path3383mkdir -p /usr/local/bin/3384ln -sf /usr/local/src/nbtscan-unixwiz/nbtscan /usr/local/bin/nbtscan-uw3385#--- Examples3386#nbtscan-uw -f 192.168.0.1/24338733883389##### Setup tftp client & server3390(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Setting up ${GREEN}tftp client${RESET} & ${GREEN}server${RESET} ~ file transfer methods"3391apt -y -qq install tftp atftpd \3392|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23393#--- Configure atftpd3394file=/etc/default/atftpd; [ -e "${file}" ] && cp -n $file{,.bkup}3395echo -e 'USE_INETD=false\nOPTIONS="--tftpd-timeout 300 --retry-timeout 5 --maxthread 100 --verbose=5 --daemon --port 69 /var/tftp"' > "${file}"3396mkdir -p /var/tftp/3397chown -R nobody\:root /var/tftp/3398chmod -R 0755 /var/tftp/3399#--- Setup alias3400file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases3401([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"3402grep -q '^## tftp' "${file}" 2>/dev/null \3403|| echo -e '## tftp\nalias tftproot="cd /var/tftp/"\n' >> "${file}"3404#--- Apply new alias3405source "${file}" || source ~/.zshrc3406#--- Remove from start up3407systemctl disable atftpd3408#--- Disabling IPv6 can help3409#echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv63410#echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6341134123413##### Install Pure-FTPd3414(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}Pure-FTPd${RESET} ~ FTP server/file transfer method"3415apt -y -qq install pure-ftpd \3416|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23417#--- Setup pure-ftpd3418mkdir -p /var/ftp/3419groupdel ftpgroup 2>/dev/null;3420groupadd ftpgroup3421userdel ftp 2>/dev/null;3422useradd -r -M -d /var/ftp/ -s /bin/false -c "FTP user" -g ftpgroup ftp3423chown -R ftp\:ftpgroup /var/ftp/3424chmod -R 0755 /var/ftp/3425pure-pw userdel ftp 2>/dev/null;3426echo -e '\n' | pure-pw useradd ftp -u ftp -d /var/ftp/3427pure-pw mkdb3428#--- Configure pure-ftpd3429echo "no" > /etc/pure-ftpd/conf/UnixAuthentication3430echo "no" > /etc/pure-ftpd/conf/PAMAuthentication3431echo "yes" > /etc/pure-ftpd/conf/NoChmod3432echo "yes" > /etc/pure-ftpd/conf/ChrootEveryone3433#echo "yes" > /etc/pure-ftpd/conf/AnonymousOnly3434echo "no" > /etc/pure-ftpd/conf/NoAnonymous3435echo "yes" > /etc/pure-ftpd/conf/AnonymousCanCreateDirs3436echo "yes" > /etc/pure-ftpd/conf/AllowAnonymousFXP3437echo "no" > /etc/pure-ftpd/conf/AnonymousCantUpload3438echo "30768 31768" > /etc/pure-ftpd/conf/PassivePortRange #cat /proc/sys/net/ipv4/ip_local_port_range3439echo "/etc/pure-ftpd/welcome.msg" > /etc/pure-ftpd/conf/FortunesFile #/etc/motd3440echo "FTP" > /etc/pure-ftpd/welcome.msg3441ln -sf /etc/pure-ftpd/conf/PureDB /etc/pure-ftpd/auth/50pure3442#--- 'Better' MOTD3443apt -y -qq install cowsay \3444|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23445echo "moo" | /usr/games/cowsay > /etc/pure-ftpd/welcome.msg3446echo -e " ${YELLOW}[i]${RESET} Pure-FTPd username: anonymous"3447echo -e " ${YELLOW}[i]${RESET} Pure-FTPd password: anonymous"3448#--- Apply settings3449systemctl restart pure-ftpd3450#--- Setup alias3451file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases3452([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"3453grep -q '^## ftp' "${file}" 2>/dev/null \3454|| echo -e '## ftp\nalias ftproot="cd /var/ftp/"\n' >> "${file}"3455#--- Apply new alias3456source "${file}" || source ~/.zshrc3457#--- Remove from start up3458systemctl disable pure-ftpd345934603461##### Install samba3462(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}samba${RESET} ~ file transfer method"3463#--- Installing samba3464apt -y -qq install samba \3465|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23466apt -y -qq install cifs-utils \3467|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23468#--- Create samba user3469groupdel smbgroup 2>/dev/null;3470groupadd smbgroup3471userdel samba 2>/dev/null;3472useradd -r -M -d /nonexistent -s /bin/false -c "Samba user" -g smbgroup samba3473#--- Use the samba user3474file=/etc/samba/smb.conf; [ -e "${file}" ] && cp -n $file{,.bkup}3475sed -i 's/guest account = .*/guest account = samba/' "${file}" 2>/dev/null3476grep -q 'guest account' "${file}" 2>/dev/null \3477|| sed -i 's#\[global\]#\[global\]\n guest account = samba#' "${file}"3478#--- Setup samba paths3479grep -q '^\[shared\]' "${file}" 2>/dev/null \3480|| cat <<EOF >> "${file}"34813482[shared]3483comment = Shared3484path = /var/samba/3485browseable = yes3486guest ok = yes3487#guest only = yes3488read only = no3489writable = yes3490create mask = 06443491directory mask = 07553492EOF3493#--- Create samba path and configure it3494mkdir -p /var/samba/3495chown -R samba\:smbgroup /var/samba/3496chmod -R 0755 /var/samba/3497#--- Bug fix3498touch /etc/printcap3499#--- Check3500#systemctl restart samba3501#smbclient -L \\127.0.0.1 -N3502#mount -t cifs -o guest //127.0.0.1/share /mnt/smb mkdir -p /mnt/smb3503#--- Disable samba at startup3504systemctl stop samba3505systemctl disable samba3506echo -e " ${YELLOW}[i]${RESET} Samba username: guest"3507echo -e " ${YELLOW}[i]${RESET} Samba password: <blank>"3508#--- Setup alias3509file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases3510([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"3511grep -q '^## smb' "${file}" 2>/dev/null \3512|| echo -e '## smb\nalias smb="cd /var/samba/"\n#alias smbroot="cd /var/samba/"\n' >> "${file}"3513#--- Apply new alias3514source "${file}" || source ~/.zshrc351535163517##### Install apache2 & php3518(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}apache2${RESET} & ${GREEN}php${RESET} ~ web server"3519apt -y -qq install apache2 php php-cli php-curl \3520|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23521touch /var/www/html/favicon.ico3522grep -q '<title>Apache2 Debian Default Page: It works</title>' /var/www/html/index.html 2>/dev/null \3523&& rm -f /var/www/html/index.html \3524&& echo '<?php echo "Access denied for " . $_SERVER["REMOTE_ADDR"]; ?>' > /var/www/html/index.php \3525&& echo -e 'User-agent: *n\Disallow: /\n' > /var/www/html/robots.txt3526#--- Setup alias3527file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases3528([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"3529grep -q '^## www' "${file}" 2>/dev/null \3530|| echo -e '## www\nalias wwwroot="cd /var/www/html/"\n' >> "${file}"3531#--- Apply new alias3532source "${file}" || source ~/.zshrc353335343535##### Install mysql3536(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}MySQL${RESET} ~ database"3537apt -y -qq install mysql-server \3538|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23539echo -e " ${YELLOW}[i]${RESET} MySQL username: root"3540echo -e " ${YELLOW}[i]${RESET} MySQL password: <blank> ***${BOLD}CHANGE THIS ASAP${RESET}***"3541[[ -e ~/.my.cnf ]] \3542|| cat <<EOF > ~/.my.cnf3543[client]3544user=root3545host=localhost3546password=3547EOF354835493550##### Install rsh-client3551(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}rsh-client${RESET} ~ remote shell connections"3552apt -y -qq install rsh-client \3553|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2355435553556##### Install sshpass3557(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}sshpass${RESET} ~ automating SSH connections"3558apt -y -qq install sshpass \3559|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2356035613562##### Install DBeaver3563(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}DBeaver${RESET} ~ GUI DB manager"3564apt -y -qq install curl \3565|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23566arch="i386"3567[[ "$(uname -m)" == "x86_64" ]] && arch="amd64"3568timeout 300 curl --progress -k -L -f "http://dbeaver.jkiss.org/files/dbeaver-ce_latest_${arch}.deb" > /tmp/dbeaver.deb \3569|| echo -e ' '${RED}'[!]'${RESET}" Issue downloading dbeaver.deb" 1>&2 #***!!! hardcoded version! Need to manually check for updates3570if [ -e /tmp/dbeaver.deb ]; then3571dpkg -i /tmp/dbeaver.deb3572#--- Add to path3573mkdir -p /usr/local/bin/3574ln -sf /usr/share/dbeaver/dbeaver /usr/local/bin/dbeaver3575fi357635773578##### Install ashttp3579(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}ashttp${RESET} ~ terminal via the web"3580apt -y -qq install git \3581|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23582git clone -q -b master https://github.com/JulienPalard/ashttp.git /opt/ashttp-git/ \3583|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&23584pushd /opt/ashttp-git/ >/dev/null3585git pull -q3586popd >/dev/null358735883589##### Install gotty3590(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Installing ${GREEN}gotty${RESET} ~ terminal via the web"3591apt -y -qq install git \3592|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23593git clone -q -b master https://github.com/yudai/gotty.git /opt/gotty-git/ \3594|| echo -e ' '${RED}'[!] Issue when git cloning'${RESET} 1>&23595pushd /opt/gotty-git/ >/dev/null3596git pull -q3597popd >/dev/null359835993600##### Preparing a jail ~ http://allanfeid.com/content/creating-chroot-jail-ssh-access // http://www.cyberciti.biz/files/lighttpd/l2chroot.txt3601(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Preparing up a ${GREEN}jail${RESET} ~ testing environment"3602apt -y -qq install debootstrap curl \3603|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&2360436053606##### Setup SSH3607(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) Setting up ${GREEN}SSH${RESET} ~ CLI access"3608apt -y -qq install openssh-server \3609|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23610#--- Wipe current keys3611rm -f /etc/ssh/ssh_host_*3612find ~/.ssh/ -type f ! -name authorized_keys -delete 2>/dev/null3613#--- Generate new keys3614ssh-keygen -b 4096 -t rsa1 -f /etc/ssh/ssh_host_key -P "" >/dev/null3615ssh-keygen -b 4096 -t rsa -f /etc/ssh/ssh_host_rsa_key -P "" >/dev/null3616ssh-keygen -b 1024 -t dsa -f /etc/ssh/ssh_host_dsa_key -P "" >/dev/null3617ssh-keygen -b 521 -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -P "" >/dev/null3618ssh-keygen -b 4096 -t rsa -f ~/.ssh/id_rsa -P "" >/dev/null3619#--- Change MOTD3620apt -y -qq install cowsay \3621|| echo -e ' '${RED}'[!] Issue with apt install'${RESET} 1>&23622echo "Moo" | /usr/games/cowsay > /etc/motd3623#--- Change SSH settings3624file=/etc/ssh/sshd_config; [ -e "${file}" ] && cp -n $file{,.bkup}3625sed -i 's/^PermitRootLogin .*/PermitRootLogin yes/g' "${file}" # Accept password login (overwrite Debian 8+'s more secure default option...)3626sed -i 's/^#AuthorizedKeysFile /AuthorizedKeysFile /g' "${file}" # Allow for key based login3627#sed -i 's/^Port .*/Port 2222/g' "${file}"3628#--- Enable ssh at startup3629#systemctl enable ssh3630#--- Setup alias (handy for 'zsh: correct 'ssh' to '.ssh' [nyae]? n')3631file=~/.bash_aliases; [ -e "${file}" ] && cp -n $file{,.bkup} #/etc/bash.bash_aliases3632([[ -e "${file}" && "$(tail -c 1 ${file})" != "" ]]) && echo >> "${file}"3633grep -q '^## ssh' "${file}" 2>/dev/null \3634|| echo -e '## ssh\nalias ssh-start="systemctl restart ssh"\nalias ssh-stop="systemctl stop ssh"\n' >> "${file}"3635#--- Apply new alias3636source "${file}" || source ~/.zshrc3637363836393640##### Custom insert point3641364236433644##### Clean the system3645(( STAGE++ )); echo -e "\n\n ${GREEN}[+]${RESET} (${STAGE}/${TOTAL}) ${GREEN}Cleaning${RESET} the system"3646#--- Clean package manager3647for FILE in clean autoremove; do apt -y -qq "${FILE}"; done3648apt -y -qq purge $(dpkg -l | tail -n +6 | egrep -v '^(h|i)i' | awk '{print $2}') # Purged packages3649#--- Update slocate database3650updatedb3651#--- Reset folder location3652cd ~/ &>/dev/null3653#--- Remove any history files (as they could contain sensitive info)3654history -cw 2>/dev/null3655for i in $(cut -d: -f6 /etc/passwd | sort -u); do3656[ -e "${i}" ] && find "${i}" -type f -name '.*_history' -delete3657done365836593660##### Time taken3661finish_time=$(date +%s)3662echo -e "\n\n ${YELLOW}[i]${RESET} Time (roughly) taken: ${YELLOW}$(( $(( finish_time - start_time )) / 60 )) minutes${RESET}"3663echo -e " ${YELLOW}[i]${RESET} Stages skipped: $(( TOTAL-STAGE ))"366436653666#-Done-----------------------------------------------------------------#366736683669##### Done!3670echo -e "\n ${YELLOW}[i]${RESET} Don't forget to:"3671echo -e " ${YELLOW}[i]${RESET} + Check the above output (Did everything install? Any errors? (${RED}HINT: What's in RED${RESET}?)"3672echo -e " ${YELLOW}[i]${RESET} + Manually install: Nessus, Nexpose, and/or Metasploit Community"3673echo -e " ${YELLOW}[i]${RESET} + Agree/Accept to: Maltego, OWASP ZAP, w3af, PyCharm, etc"3674echo -e " ${YELLOW}[i]${RESET} + Setup git: ${YELLOW}git config --global user.name <name>;git config --global user.email <email>${RESET}"3675echo -e " ${YELLOW}[i]${RESET} + ${BOLD}Change default passwords${RESET}: PostgreSQL/MSF, MySQL, OpenVAS, BeEF XSS, etc"3676echo -e " ${YELLOW}[i]${RESET} + ${YELLOW}Reboot${RESET}"3677(dmidecode | grep -iq virtual) \3678&& echo -e " ${YELLOW}[i]${RESET} + Take a snapshot (Virtual machine detected)"36793680echo -e '\n'${BLUE}'[*]'${RESET}' '${BOLD}'Done!'${RESET}'\n\a'3681exit 0368236833684