From 52d66e781bdfddf4afd71969724f269c04866874 Mon Sep 17 00:00:00 2001 From: cyb0rgdoll <19384876+cyb0rgdoll@users.noreply.github.com> Date: Fri, 16 Sep 2022 15:36:48 +0800 Subject: [PATCH] Add files via upload --- intrec.sh | 875 +++++++++++++++++++++++++++++++++++++++++++++ pkgs_exploits.sh | 14 + pkgs_fuzzbunch.sh | 54 +++ pkgs_git_repos.sh | 68 ++++ pkgs_msf_prep.sh | 12 + pkgs_upgrade.sh | 11 + pkgs_wine.sh | 11 + pkgs_wordlists.sh | 13 + setup.sh | 121 +++++++ shell_aliases.sh | 38 ++ sshd_allow_root.sh | 14 + swap_add.sh | 32 ++ xfce4.sh | 10 + 13 files changed, 1273 insertions(+) create mode 100644 intrec.sh create mode 100644 pkgs_exploits.sh create mode 100644 pkgs_fuzzbunch.sh create mode 100644 pkgs_git_repos.sh create mode 100644 pkgs_msf_prep.sh create mode 100644 pkgs_upgrade.sh create mode 100644 pkgs_wine.sh create mode 100644 pkgs_wordlists.sh create mode 100644 setup.sh create mode 100644 shell_aliases.sh create mode 100644 sshd_allow_root.sh create mode 100644 swap_add.sh create mode 100644 xfce4.sh diff --git a/intrec.sh b/intrec.sh new file mode 100644 index 0000000..af5f029 --- /dev/null +++ b/intrec.sh @@ -0,0 +1,875 @@ +#!/bin/bash + +# Coloring scheme for notfications and logo +ESC="\x1b[" +RESET=$ESC"39;49;00m" +CYAN=$ESC"33;36m" +RED=$ESC"31;01m" +GREEN=$ESC"32;01m" + +# Warning +function warning() +{ echo -e "\n$RED [!] $1 $RESET\n" + } + +# Green notification +function notification() +{ echo -e "\n$GREEN [+] $1 $RESET\n" + } + +# Cyan notification +function notification_b() +{ echo -e "\n$CYAN [-] $1 $RESET\n" + } + +# Print logo and general info +function logo() +{ echo -e "$CYAN" + echo -e "\ + _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ +| | | |_ _| __ | __| |___| _ | _ | | | | +|- -| | | | | | | -| __| --|___| __| | --| -| +|_____|_|___| |_| |__|__|_____|_____| |__| |__|__|_____|__|__| + +################################################################# +#---Author: NullArray/Vector--# IntRec-Pack, # +#---Twitter: @Real__Vector-----# Intelligence # +#---Type: Bundle Installer--# and Reconnaissance # +#---Version: 1.3.0-------------# Package Installer # +#################################################################" && echo -e "$RESET\n" + main_menu + } + +# print tool list +function tools() +{ notification_b "Available tools, select a number to install" + printf "\ ++-----------------------+-------------------------------------------+ +| Tool | Utility type and feature summary | ++-----------------------+-------------------------------------------+ +|1. QuickScan | Port Scanner/WHOIS/Domain Resolver | +|2. DNSRecon | Advanced DNS Enumeration & Domain Utility | +|3. Sublist3r | OSINT Based Subdomain Enumeration | +|4. TekDefense-Automator| OSINT Based IP, URL and Hash Analyzer | +|5. TheHarvester | eMail, vHost, Domain and PII Enumeration | +|6. IOC-Parser | Threat Intel, parses IOC data from reports| +|7. PyParser-CVE | Multi Source Exploit Parser/CVE Lookup | +|8. Mimir | HoneyDB CLI/Threat Intelligence Utility | +|9. Tadpole | Open AWS bucket, file search and Download | +|10.Harbinger | Cymon.io, Virus Total, Threat Feed Parser | +|11.Inquisitor | OSINT Recon/data visualization utility | +|12.BirdWatch | SOCMINT Utility with a focus on Twitter | +|13.Spiderfoot | Advanced OSINT/Reconnaissance Framework | +|14.EagleEye | Facial recognition powered SOCMINT utility| ++-----------------------+-------------------------------------------+\n" + list + } + +function opt_list() +{ notification_b "Welcome to IntRec-Pack" + printf " +1) Help 4) Specify Install Location +2) List and Install 5) Online Resources +3) Install All 6) Quit\n" + + main_menu + } + +# Display usage information and details +function usage() +{ notification_b "Welcome to IntRec-Pack" + printf "This script fetches and installs a selection +of tools used in open source intelligence gathering, and +reconnaissance. Functionality to install any dependencies needed +by the tools in question is included in this script in order to +facilitate quick and easy deployment. + +Below is an overview of the options available to you. + +The 'help' option displays this informational message. The 'List and Install' +option shows you a list of tools available to download and install with +IntRec-Pack. The 'Install All' options automatically downloads and installs +every utility that is featured in this script including their individual +dependencies respectively. 'Specify Install Location' allows you to input +a path to a directory to which you'd like the utilities saved to. The default +location is the current working directory. + +The 'Online Resources' option employs the Mozilla Geckodriver in order to load +two web based OSINT resource aggregators and an OSINT Threat Intel service as well. +The first entry under this category is 'osintframework.com' which serves as a +curated list of OSINT oriented web services, documentation, and provides a catalog +of utilities and assorted programs to help customize and expand your intel gathering +environment and OSINT toolkit in general. + +The second item under 'Online Resources' loads 'toddignton.com/resources'. +This website serves as an additional knowledge hub, which can be used as a +comprehensive reference guide geared towards tooling, techniques, and documentation. + +The third and final item under this category is HoneyDB which is an OSINT based threat +intelligence aggregator. HoneyPy honeypots provide the data accesible here and the +HoneyDB web application provides a data visualization service and Thread Feed +functionality as well. +\n" + } + +# Function to check for the existence of common Linux utilities needed to perform +# some of the install operations. Distros like Debian might not have some of these +# available by default. +function nix_util() +{ notification_b "Checking Linux utilities required by the installer." + sleep 2 + + # Check for sudo + su_do=$(which sudo) + case $su_do in + */usr/bin/sudo*) + sd=1 + ;; + esac + + if [[ $sd != 1 ]]; then + warning "Heuristics indicate sudo is not installed on this system." + read -p 'Automatically resolve? Y/n : ' choice + if [[ $choice == 'y' || $choice == 'Y' ]]; then + notification "Please enter root password." + su - + apt-get install sudo && notification "Sudo was succesfully installed" || warning "An error was encountered while trying to install sudo. Quitting..." && exit 1 + printf "Please add your regular user account to sudoers and restart the script." + printf "Quitting..." + sleep 2 && exit 1 + else + warning "Not resolving." + sleep 2 && exit 1 + fi + fi + + # Check to see if we have wget + wgt=$(which wget) + case $wgt in + */usr/bin/wget*) + wg=1 + ;; + esac + + if [[ $wg != 1 ]]; then + warning "Heuristics indicate wget is not installed on this system." + notification "Attempting to resolve." + sleep 2 + + sudo apt-get install wget + notification "Wget has been succesfully installed." + sleep 2 + fi + + # Check to see if we have git + get_git=$(which git) + case $get_git in + */usr/bin/git*) + ggit=1 + ;; + esac + + if [[ $ggit != 1 ]]; then + warning "Heuristics indicate git is not installed on this system." + notification "Attempting to resolve." + sleep 2 + + sudo apt-get install git + notification "Git has been succesfully installed." + sleep 2 + fi + + # Check to see if we have pip, if not get setuptools and install pip + pypip=$(which pip) + case $pypip in + */usr/bin/pip*) + pp=1 + ;; + esac + + if [[ pp != 1 ]]; then + case $pypip in + */usr/local/bin/pip*) + pp=2 + ;; + esac + fi + + if [[ $pp != 1 ]]; then + if [[ $pp != 2 ]]; then + warning "Heuristics indicate pip is not installed on this system." + notification "Attempting to resolve." + sleep 2 + + notification "Installing Python setuptools and pip" + sudo apt-get install python-setuptools python-pip + notification "Operation completed" + sleep 2 + + fi + fi + + notification "All Linux utilities required by the installer appear to be present. Proceeding to main menu." + sleep 2 && clear + logo + + } + +# Function to check CPU architecture and install the proper version of Geckodriver +function get_gdriver() +{ printf "\n\n" + MACHINE_TYPE=`uname -m` + if [[ ${MACHINE_TYPE} == 'x86_64' ]]; then + notification "x86_64 architecture detected..." + sleep 1 + + wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz + tar -xvf geckodriver-v0.24.0-linux64.tar.gz + rm geckodriver-v0.24.0-linux64.tar.gz + chmod +x geckodriver + mv geckodriver /usr/sbin + sudo ln -s /usr/sbin/geckodriver /usr/bin/geckodriver + + notification "Geckodriver has been succesfully installed" + else + notification "x32 architecture detected..." + sleep 1 + wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux32.tar.gz + tar -xvf geckodriver-v0.24.0-linux32.tar.gz + rm geckodriver-v0.24.0-linux32.tar.gz + chmod +x geckodriver + mv geckodriver /usr/sbin + sudo ln -s /usr/sbin/geckodriver /usr/bin/geckodriver + notification "Geckodriver has been succesfully installed." + fi + } + + +# The Mimir install operation will be a little more involved since we will need +# to check and make sure we have OpenSSL support in the PycURL module +# Mimir depends on. This is important in order for Mimir +# to be compatible with HoneyDB and retrieve the data we want via the API. +function mimir_install() +{ printf "\n\n" + if [[ -d "Mimir" ]]; then + warning "Mimir is already installed." + else + notification "Installing Mimir. Please do not interrupt this process until all dependencies and supporting features have been installed as well." && sleep 1 + + git clone https://github.com/NullArray/Mimir.git + + notification "Installing dependencies." + sleep 1.5 + + sudo -H pip install selenium blessings ipwhois + sudo apt-get install python-pycurl + notification "Checking PyCurl for OpenSSL support..." + sleep 1.5 + + # Save version to var + pcurl=$(python -c "import pycurl; print pycurl.version") + case $pcurl in + *OpenSSL*) + openssl=1 + ;; + esac + + if [[ $openssl == 1 ]]; then + notification "Heuristics indicate your PyCurl version Supports OpenSSL" + else + warning "Heuristics indicate your version of PyCurl does not support OpenSSL" + notification "Attempting to resolve..." + + cwd=$(pwd) + cd Mimir + chmod +x rebuild.sh + + # Invoke 'rebuild.sh' to rebuild PyCurl with OpenSSL support + sudo ./rebuild.sh && cd $cwd && sleep 1 + notification "PyCurl has been rebuilt with OpenSSL support." && sleep 1 + fi + + notification "Checking to see if the Mozilla Geckodriver is installed on this system." + sleep 1.5 + + gdrive=$(which geckodriver) + case $gdrive in + */usr/bin/geckodriver*) + gd=1 + ;; + esac + + if [[ $gd == 1 ]]; then + notification "Heuristics indicate Geckodriver is currently installed." + else + notification "Installing Mozilla Geckodriver..." + + get_gdriver && sleep 1.5 + notification "Operation completed." + fi + + notification "Finally Intrec-Pack will now check to see if Nmap is installed on this system." + sleep 1 + + net_mapper=$(which nmap) + case $net_mapper in + */usr/bin/nmap*) + nm=1 + ;; + esac + + if [[ $nm == 1 ]]; then + notification "Heuristics indicate Nmap is currently installed." + else + notification "Installing nmap..." + sudo apt-get install nmap + fi + fi + + + notification "Mimir installation and configuration has been completed succesfully." + notification "Returning to menu." + sleep 2 + tools + + } + +# This function will be called in the event Ruby gets installed without RubyGems +# See birdwatcher install below for details +function gems_install() +{ notification "Attempting to resolve..." + sleep 1 + + git clone https://github.com/rubygems/rubygems.git + cd rubygems && git submodule update --init + sudo ruby setup.rb install + + gem pristine rake + sudo gem update --system + + notification "Operation complete." + sleep 1 + + } + + +function BirdWatcher() +{ if [[ -d "birdwatcher" ]]; then + warning "BirdWatcher is already installed." + clear + else + notification "Installing BirdWatcher" + sleep 1 + + git clone https://github.com/michenriksen/birdwatcher.git + notification "Installing dependencies." + sleep 1 + + sudo apt-get install graphviz + sudo apt-get install libmagickwand-dev imagemagick + + rby=$(which ruby) + case $rby in + */usr/bin/ruby*) + rb=1 + ;; + esac + + if [[ $rb == 1 ]]; then + notification "Heuristics indicate Ruby is already installed." + else + notification "Installing Ruby..." + sleep 1 + + sudo apt-get install ruby + fi + + notification "Updating gems..." + sleep 1 + + sudo gem update --system || warning "Heuristics indicate RubyGems are not installed on this system." && gems_install + + notification "Checking to see if PostgreSQL is installed." + sleep 1 + + sudo service postgresql status > /dev/null || $check='failed' + if [[ $check == 'failed' ]]; then + notification "Installing PostgreSQL..." + sleep 1 + + sudo apt-get install postgresql + sudo apt-get install libpq-dev + + notification "Operation completed." + else + notification "Heuristics indicate PostgreSQL is already installed." + + fi + + fi + notification "BirdWatcher was succesfully installed." + echo "Please reference the BirdWatcher README.md for instructions on" + echo "how to set up a PostgreSQL database and configure it for use" + echo "with Birdwatcher" + + } + +function EaglEye() +{ if [[ -d "EagleEye" ]]; then + warning "EagleEye is already installed" + clear + else + notification "Installing EagleEye" + notification "Retrieving auto installer Shell script" + wget -O installer.sh https://raw.githubusercontent.com/ThoughtfulDev/EagleEye/master/install.sh + chmod +x install.sh && ./install.sh + sleep 1 && clear + + notification_b "Checking for GeckoDriver" + + gdrive=$(which geckodriver) + case $gdrive in + */usr/bin/geckodriver*) + gd=1 + ;; + esac + + # We're checking here as well solely because ThoughtfulDev(The author of the tool in question) + # has this exact location listed as example of where geckodriver should/could go, technically + # geckodriver can go anywhere as long as it gets exported to $PATH but you got to draw the line somewhere. + # Check out ThoughtfulDev on Github https://github.com/ThoughtfulDev cool projects! + case $gdrive in + */usr/local/bin/geckodriver*) + gd=1 + ;; + esac + + if [[ $gd == 1 ]]; then + notification "Heuristics indicate Geckodriver is currently installed." + else + notification "Installing Mozilla Geckodriver..." + + get_gdriver && sleep 1.5 + notification "Operation completed." + fi + fi + } + +function QuickScan() +{ if [[ -d "QuickScan" ]]; then + warning "QuickScan is already installed." + clear + else + notification "Installing QuickScan." + sleep 1 + git clone https://github.com/NullArray/QuickScan.git + notification "Installing dependencies." + sleep 1 + sudo -H pip install blessings whois + notification "QuickScan was successfully installed." + fi + } + + + +function TadPole() +{ if [[ -d "tadpole" ]]; then + warning "TadPole is already installed" + clear + else + notification "Installing TadPole" + sleep 1 + git clone https://github.com/Ekultek/tadpole.git + notification "Installing dependencies." + sudo -H pip install beautifulsoup4 requests + notification "TadPole was successfully installed." + + fi + } + +function DNSRecon() +{ if [[ -d "dnsrecon" ]]; then + warning "DNSRecon is already installed." + clear + else + notification "Installing DNSRecon" + sleep 1 + git clone https://github.com/darkoperator/dnsrecon.git + notification "Installing dependencies" + sleep 1 + sudo -H pip install dnspython netaddr + notification "DNSRecon was successfully installed." + fi + } + +function Sublist3r() +{ if [[ -d "Sublist3r" ]]; then + warning "Sublist3r is already installed." + clear + else + notification "Installing Sublist3r." + sleep 1 + git clone https://github.com/aboul3la/Sublist3r.git + notification "Installing dependencies." + sleep 1 + sudo -H pip install argparse dnspython requests + notification "Sublist3r was successfully installed." + fi + } + +function TekDefense() +{ if [[ -d "TekDefense-Automater" ]]; then + warning "TekDefense-Automater is already installed." + clear + else + notification "Installing TekDefense-Automater." + sleep 1 + git clone https://github.com/1aN0rmus/TekDefense-Automater.git + notification "Installing dependencies." + sleep 1 + sudo -H pip install argparse requests + notification "TekDefense-Automater was successfully installed." + fi + } + +function theHarvester() +{ if [[ -d "theHarvester" ]]; then + warning "TheHarvester is already installed." + clear + else + notification "Installing TheHarvester." + sleep 1 + git clone https://github.com/laramies/theHarvester.git + notification "Installing dependencies." + sleep 1 + sudo -H pip install requests + notification "TheHarvester was successfully installed." + fi +} + +function ioc_parser() +{ if [[ -d "ioc_parser" ]]; then + warning "IOC-Parser is already installed." + clear + else + notification "Installing IOC-Parser." + sleep 1 + git clone https://github.com/armbues/ioc_parser.git + sleep 1 + notification "Installing dependencies." + sudo -H pip install ioc_parser beautifulsoup4 requests + notification "IOC-Parer was successfully installed." + fi + } + +function pyparser() +{ if [[ -d " PyParser-CVE" ]]; then + warning "PyParser-CVE is already installed." + clear + else + notification "Installing PyParser-CVE." + sleep 1 + git clone https://github.com/NullArray/PyParser-CVE.git + notification "Installing dependencies." + sleep 1 + sudo -H pip install blessings shodan + sudo apt-get install python-pycurl + notification "PyParser-CVE was successfully installed." + fi + } + +function harbinger() +{ if [[ -d "harbinger" ]]; then + warning "Harbinger is already installed." + clear + else + notification "Installing Harbinger." + sleep 1 + git clone https://github.com/exp0se/harbinger.git + notification "Installing dependencies" + sleep 1 + sudo -H pip install requests cymon beautifulsoup4 + notification "Harbinger was successfully installed." + fi + } + +function inquisitor() +{ if [[ -d "inquisitor" ]]; then + warning "Inquisitor is already installed" + clear + else + notification "Installing Inquisitor..." + sleep 1 + git clone https://github.com/penafieljlm/inquisitor.git + notification "Installing dependencies" + sleep 1 + sudo -H pip install cython + + notification "Building..." + sleep 1 + cwd=$(pwd) + cd inquisitor + sudo -H python setup.py install + cd $cwd + + notification "Inquisitor was succesfully installed." + fi + } + +function Spiderfoot() +{ if [[ -d "spiderfoot" ]]; then + warning "Spiderfoot is already installed." + clear + else + notification "Installing Spiderfoot." + sleep 1 + git clone https://github.com/smicallef/spiderfoot.git + + notification "Installing required SSL components." + sleep 1 + sudo apt-get install libssl-dev + + notification "Installing M2Crypto Python OpenSSL wrapper." + sleep 1 + sudo apt-get install python-m2crypto + + notification "Installing remaining python dependencies." + sleep 1 + + sudo -H pip install lxml netaddr cherrypy mako requests bs4 + notification "Spiderfoot was successfully installed." + fi + } + +# List and download function +function list() +{ printf "\n\n" + options=("QuickScan" "TadPole" "DNSRecon" "Sublist3r" "TekDefense" "TheHarvester" "IOC-Parser" "PyParser-CVE" "Mimir" "Harbinger" "Inquisitor" "BirdWatcher" "Spiderfoot" "EagleEye" "Main Menu") + PS3='Please enter your choice: ' + select opt in "${options[@]}" + do + case $opt in + "QuickScan") + QuickScan + tools + printf "%b \n" + ;; + "TadPole") + TadPole + tools + printf "%b \n" + ;; + "DNSRecon") + DNSRecon + tools + printf "%b \n" + ;; + "Sublist3r") + Sublist3r + tools + printf "%b \n" + ;; + "TekDefense") + TekDefense + tools + printf "%b \n" + ;; + "TheHarvester") + theHarvester + tools + printf "%b \n" + ;; + "IOC-Parser") + ioc_parser + tools + printf "%b \n" + ;; + "PyParser-CVE") + pyparser + tools + printf "%b \n" + ;; + "Mimir") + mimir_install + printf "%b \n" + ;; + "Harbinger") + harbinger + tools + printf "%b \n" + ;; + "Inquisitor") + inquisitor + tools + printf "%b \n" + ;; + "BirdWatcher") + BirdWatcher + tools + printf "%b \n" + ;; + "Spiderfoot") + Spiderfoot + tools + printf "%b \n" + ;; + "EagleEye") + EaglEye + tools + printf "%b \n" + ;; + "Main Menu") + printf "\nReturning to main menu." + sleep 2 && logo + ;; + *) echo invalid option;; + esac + done + } + +# Download and install all +function install_all() +{ printf "\n\n" + notification_b "Installing all available tools plus dependencies." + QuickScan + TadPole + DNSRecon + Sublist3r + TekDefense + theHarvester + ioc_parser + pyparser + harbinger + inquisitor + BirdWatcher + Spiderfoot + mimir_install + EagleEye + } + +# Function to interact with online OSINT/Threat Intel resources. +function online() +{ notification_b "Online Resources" + printf " ++-----------------------+---------------------------------------+ +| 1. osintframework.com | Comprehensive OSINT Resource Pool | +| 2. toddington.com | Additional OSINT Resource References | +| 3. riskdiscovery.com | Hosts HoneyDB/Aggregates Honeypot Data| ++-----------------------+---------------------------------------+ +\n" + + PS3='Please enter your choice: ' + options=("osintframework.com" "toddignton.com" "riskdiscovery.com" "Main Menu") + select opt in "${options[@]}" + do + case $opt in + "osintframework.com") + notification "Opening osintframework.com with Geckodriver..." + sleep 1.5 + + # Python one liner in order to open online resource/web application + python -c "from selenium import webdriver; driver = webdriver.Firefox(); driver.get('http://osintframework.com/')" + printf "%b \n" + ;; + "toddignton.com") + notification "Opening toddington.com/resources with Geckodriver..." + sleep 1.5 + + # Python one liner in order to open online resource/web application + python -c "from selenium import webdriver; driver = webdriver.Firefox(); driver.get('https://www.toddington.com/resources/')" + printf "%b \n" + ;; + "riskdiscovery.com") + notification "Opening riskdiscovery.com/honeydb with Geckodriver..." + sleep 1.5 + + # Python one liner in order to open online resource/web application + python -c "from selenium import webdriver; driver = webdriver.Firefox(); driver.get('http://riskdiscovery.com/honeydb')" + printf "%b \n" + ;; + "Main Menu") + printf "\nReturning to Main Menu" + sleep 1.5 && logo + esac + done + } + +function main_menu() +{ options=("Help" "List and Install" "Install All" "Specify Install Location" "Online Resources" "Quit") + PS3='Please enter your choice: ' + select opt in "${options[@]}" + do + case $opt in + "Help") + usage + printf "%b \n" + ;; + "List and Install") + tools + printf "%b \n" + ;; + "Install All") + install_all + printf "%b \n" + ;; + "Specify Install Location") + printf "\nBy default utilities will be installed in the current working directory." + read -p 'Would you like to change install location? Y/n : ' choice + + if [[ $choice == 'y' || $choice == 'Y' ]]; then + read -p 'Enter target location : ' cwd + cd $cwd > /dev/null || mkdir $cwd && notification "Directory created." && cd $cwd || warning "Invalid format." + else + notification "Using default setting." + fi + ;; + "Online Resources") + gecko=$(which geckodriver) + + case $gecko in + */usr/bin/geckodriver*) + gdriver=1 + ;; + esac + + if [[ $gdriver == 1 ]]; then + online + else + warning "Heuristics indicate Geckodriver is not installed on this system." + printf "The Online Resource option invokes Python and Selenium to open " + printf "these resources in browser. Without the Mozilla Geckodriver this is not" + printf "possible within the scope of this script.\n" + + read -p 'Would you like to automatically resolve this issue? Y/n : ' choice + if [[ $choice == 'y' || $choice == 'Y' ]]; then + get_gdriver + else + warning "Not Resolving" + fi + fi + + printf "%b \n" + ;; + "Quit") + exit 1 + ;; + *) echo invalid option;; + esac + done + } + +if [[ "$EUID" -ne 0 ]]; then + warning "It is recommended that this script is run as root" + printf "Running it without super user privilege may result " + printf "in the utility failing to install critical components correctly \n" + + read -p 'Continue without root? Y/n : ' choice + if [[ $choice == 'y' || $choice == 'Y' ]]; then + nix_util + else + warning "Aborted" + exit 1 + fi +else + nix_util +fi diff --git a/pkgs_exploits.sh b/pkgs_exploits.sh new file mode 100644 index 0000000..63e0cda --- /dev/null +++ b/pkgs_exploits.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +export DEBIAN_FRONTEND=noninteractive + +echo ">>> adding extra packages..." + +apt-get -qq -y install rlwrap > /dev/null +apt-get -qq -y install ftp > /dev/null +apt-get -qq -y install php-curl > /dev/null +apt-get -qq -y install python-smb > /dev/null +apt-get -qq -y install mingw-w64 > /dev/null +apt-get -qq -y install lftp > /dev/null +apt-get -qq -y install python-pyftpdlib > /dev/null +pip install PyWebDAV3 diff --git a/pkgs_fuzzbunch.sh b/pkgs_fuzzbunch.sh new file mode 100644 index 0000000..0ce829f --- /dev/null +++ b/pkgs_fuzzbunch.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +#export DEBIAN_FRONTEND=noninteractive + +echo ">>> adding Wine dependencies if missing... " +apt-get -qq -y install wine winbind winetricks +dpkg --add-architecture i386 > /dev/null +apt-get -qq update > /dev/null +apt-get -qq -y install wine32 > /dev/null + +echo ">>> adding wine32 environment: ./winefzb..." +WINEPREFIX="/root/.winefzb" WINEARCH=win32 wine wineboot + +echo ">>> adding wine32 environment: ./winefzb..." +whoami +export WINEPREFIX="/root/.winefzb" +echo "export WINEPREFIX=/root/.winefzb" >> /root/.bashrc +source /root/.bashrc + +echo ">>> creating reg file fzb.reg..." +cat < /root/fzb.reg +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\Environment] +"PATH"="Value: c:\\\\windows;c:\\\\windows\\\\system;C:\\\\Python26;C:\\\\fuzzbunch-debian\\\\windows\\\\fuzzbunch" +"TEMP"="C:\\users\\root\\Temp" +"TMP"="C:\\users\\root\\Temp" +EOF + +echo ">>> importing regkey..." +WINEPREFIX="/root/.winefzb" wine regedit /S /root/fzb.reg + +echo ">>> cloning fuzzbunch repo..." +if [[ -e /root/.winefzb/drive_c/fuzzbunch-debian ]]; then + echo ">>> SKIP: fuzzbunch repo already exists." +else + git clone https://github.com/mdiazcl/fuzzbunch-debian.git /root/.winefzb/drive_c/fuzzbunch-debian +fi + +echo ">>> fuzzbunch cloned to /root/.winefzb/drive_c" + +echo "*** To finish fuzzbunch installation, login and run:" +echo "winetricks python26" +echo " " + +#THIS WON"T WORK !!!! :( +#cd /root/.winefzb/drive_c +#WINEPREFIX="/root/.winefzb" winetricks python26 /q + +#THIS WON"T WORK !!!! :( +#wget -qO /root/.winefzb/drive_c/python-2.6.2.msi https://www.python.org/ftp/python/2.6.2/python-2.6.2.msi +#WINEPREFIX="/root/.winefzb" wine msiexec -i "c:\python-2.6.2.msi TARGETDIR=C:\Python26 ALLUSERS=1 /q" + + diff --git a/pkgs_git_repos.sh b/pkgs_git_repos.sh new file mode 100644 index 0000000..3b03987 --- /dev/null +++ b/pkgs_git_repos.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +export DEBIAN_FRONTEND=noninteractive + +echo ">>> cloning AutoRecon and dependencies ..." + +if [[ -e /opt/AutoRecon ]]; then + echo ">>> SKIP: already cloned." +else + apt-get -qq -y install seclists > /dev/null + git clone https://github.com/Tib3rius/AutoRecon.git /opt/AutoRecon +fi + +echo ">>> cloning AutoBlue..." + +if [[ -e /opt/AutoBlue ]]; then + echo ">>> SKIP: already cloned." +else + git clone https://github.com/3ndG4me/AutoBlue-MS17-010.git /opt/AutoBlue +fi + +echo ">>> cloning LinEnum..." + +if [[ -e /opt/LinEnum ]]; then + echo ">>> SKIP: already cloned." +else + git clone https://github.com/rebootuser/LinEnum.git /opt/LinEnum +fi + +echo ">>> cloning Windows Enum NG..." + +if [[ -e /opt/wesng ]]; then + echo ">>> SKIP: already cloned." +else + git clone https://github.com/bitsadmin/wesng.git /opt/wesng +fi + +echo ">>> cloning JAWS..." + +if [[ -e /opt/JAWS ]]; then + echo ">>> SKIP: already cloned." +else + git clone https://github.com/411Hall/JAWS.git /opt/JAWS +fi + +echo ">>> cloning Linux Exploit Suggester 2..." + +if [[ -e /opt/linux-exploit-suggester-2 ]]; then + echo ">>> SKIP: already cloned." +else + git clone https://github.com/jondonas/linux-exploit-suggester-2.git /opt/linux-exploit-suggester-2 +fi + +echo ">>> cloning NMap Bootstrap XSL..." + +if [[ -e /opt/nmap-bootstrap-xsl ]]; then + echo ">>> SKIP: already cloned." +else + git clone https://github.com/honze-net/nmap-bootstrap-xsl.git /opt/nmap-bootstrap-xsl +fi + +echo ">>> cloning AutoNSE..." + +if [[ -e /opt/AutoNSE ]]; then + echo ">>> SKIP: already cloned." +else + git clone https://github.com/m4ll0k/AutoNSE /opt/AutoNSE +fi diff --git a/pkgs_msf_prep.sh b/pkgs_msf_prep.sh new file mode 100644 index 0000000..b7793cd --- /dev/null +++ b/pkgs_msf_prep.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +if [[ -e /tmp/msf_prep ]]; then + echo ">>> SKIP: msf already prepped " +else + echo ">>> setting up postgresql db..." + systemctl start postgresql + systemctl enable postgresql + msfdb init + + touch /tmp/msf_prep +fi diff --git a/pkgs_upgrade.sh b/pkgs_upgrade.sh new file mode 100644 index 0000000..04913b7 --- /dev/null +++ b/pkgs_upgrade.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +#export DEBIAN_FRONTEND=noninteractive + +echo ">>> updating and upgrading... go make a sammich." + +apt-get -qq update > /dev/null +#apt-get -qq -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade > /dev/null +apt-get -y upgrade +apt-get -qq -y autoremove > /dev/null + diff --git a/pkgs_wine.sh b/pkgs_wine.sh new file mode 100644 index 0000000..530962f --- /dev/null +++ b/pkgs_wine.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +export DEBIAN_FRONTEND=noninteractive + +echo ">>> adding wine packages" + +apt-get -qq -y install wine > /dev/null +apt-get -qq -y install winetricks > /dev/null +dpkg --add-architecture i386 > /dev/null +apt-get -qq update > /dev/null +apt-get -qq -y install wine32 > /dev/null diff --git a/pkgs_wordlists.sh b/pkgs_wordlists.sh new file mode 100644 index 0000000..3318a72 --- /dev/null +++ b/pkgs_wordlists.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +export DEBIAN_FRONTEND=noninteractive + +echo ">>> adding seclists package to /usr/share/seclists..." +apt-get -qq -y install seclists > /dev/null + +echo ">>> unzipping rockyou..." +if [[ -e /usr/share/wordlists/rockyou.txt ]]; then + echo ">>> SKIP: already extracted rockyou." +else + gunzip -q -k /usr/share/wordlists/rockyou.txt.gz +fi diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..d3a78ef --- /dev/null +++ b/setup.sh @@ -0,0 +1,121 @@ +#!/bin/bash + +# Add 32-bit archictecture + +dpkg --add-architecture i386 + +# Get the latest system updates + +apt-get update +apt-get upgrade -y +apt-get dist-upgrade -y + +# Clean up + +apt-get autoremove -y + +# Add Kali Metapackages + +apt-get install -y kali-linux-large \ +kali-tools-web \ +kali-tools-passwords \ +kali-tools-post-exploitation \ +kali-tools-crypto-stego \ +kali-tools-windows-resources + +# Clean up + +apt-get autoremove -y + +# Add essential packages +apt-get install -y ufw gufw rlwrap lftp bettercap fonts-powerline crackmapexec xclip +apt-get install -y seclists gobuster + +# Add packages for cross-compiling and exploits + +apt-get install -y gcc-multilib g++-multilib \ +python-pip python-smb python-pyftpdlib PyWebDAV3 php-curl \ + +# Add packages for Windows Emulation + +apt-get install -y wine winetricks winbind wine32 + +# Setup wine + +wine cmd.exe /c dir +winetricks python27 +wine pip.exe install pyinstaller + +# Prep lists + +wget -nd -P /opt/crackstation https://crackstation.net/files/crackstation-human-only.txt.gz +gunzip /opt/crackstation/crackstation-human-only.txt.gz +gunzip -q -k /usr/share/wordlists/rockyou.txt.gz + +# Prep metasploit +systemctl start postgresql +systemctl enable postgresql +msfdb init + +# Clone Repos + +git clone https://github.com/Tib3rius/AutoRecon.git /opt/AutoRecon +git clone https://github.com/jondonas/linux-exploit-suggester-2.git /opt/linux-exploit-suggester-2 +git clone https://github.com/rebootuser/LinEnum.git /opt/LinEnum +git clone https://github.com/bitsadmin/wesng.git /opt/wesng +git clone https://github.com/411Hall/JAWS.git /opt/JAWS +git clone https://github.com/abatchy17/WindowsExploits.git /opt/WindowsExploits +git clone https://github.com/3ndG4me/AutoBlue-MS17-010.git /opt/AutoBlue +git clone https://github.com/m4ll0k/AutoNSE /opt/AutoNSE +git clone https://github.com/SecWiki/linux-kernel-exploits.git /opt/linux-kernel-exploits +git clone https://github.com/SecWiki/windows-kernel-exploits.git /opt/windows-kernel-exploits +git clone https://github.com/diego-treitos/linux-smart-enumeration.git /opt/linux-smart-enumeration +git clone https://github.com/ThePacketBender/pentest_scripts.git /opt/pentest_scripts +git clone https://github.com/M4ximuss/Powerless.git /opt/powerless +git clone https://github.com/andrew-d/static-binaries.git /opt/static-binaries +git clone https://github.com/AlessandroZ/BeRoot.git /opt/beroot + + +# Download Stuff + +wget -nd -P /opt/accesschk https://web.archive.org/web/20071007120748if_/http://download.sysinternals.com/Files/Accesschk.zip +unzip /opt/accesschk/Accesschk.zip -d /opt/accesschk + +wget -nd -P /opt/tilix https://github.com/gnunn1/tilix/releases/download/1.9.3/tilix.zip +unzip /opt/tilix/tilix.zip -d / +glib-compile-schemas /usr/share/glib-2.0/schemas/ + +# Host Linux Files + +mkdir /srv/linux + +ln -s /opt/LinEnum/LinEnum.sh /srv/linux/linenum.sh +ln -s /usr/share/unix-privesc-check/unix-privesc-check /srv/linux/upc +ln -s /opt/linux-exploit-suggester-2/ /srv/linux/les2.pl +ln -s /opt/linux-smart-enumeration/lse.sh /srv/linux/lse.sh + +# Host Windows Files + +mkdir /srv/windows + +ln -s /opt/accesschk/accesschk.exe /srv/windows/accesschk.exe +ln -s /opt/sysinternals/ /srv/windows/sysinternals +ln -s /usr/share/windows-resources/powersploit/ /srv/windows/powersploit +ln -s /usr/share/nishang/ /srv/windows/nishang +ln -s /opt/JAWS/jaws-enum.ps1 /srv/windows/jaws.ps1 +ln -s /usr/share/windows-resources/binaries/nc.exe /srv/windows/nc.exe +ln -s /opt/beroot/beRoot.exe /srv/windows/beroot.exe +ln -s /usr/share/windows-resources/mimikatz/ /srv/windows/mimikatz +ln -s /opt/powerless/Powerless.bat /srv/windows/pless.bat + +# Host RFI + +mkdir /srv/rfi +echo "

PHP INFO PAGE


" > /srv/rfi/phpinfo.php + +# Update indexing + +updatedb + +# Install OH-My-ZSH +sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" diff --git a/shell_aliases.sh b/shell_aliases.sh new file mode 100644 index 0000000..d13dea1 --- /dev/null +++ b/shell_aliases.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +if [[ -e /root/.bash_aliases ]]; then + echo ">>> SKIP: .bash_aliases already exists..." +else + echo ">>> adding aliases..." + + # Add your aliases here + + #ls + echo "alias ll='ls -lvhAF --file-type --group-directories-first'" >> /root/.bash_aliases + echo "alias lr='ll -R'" >> /root/.bash_aliases + + #python web server + echo "alias http-server='python -m SimpleHTTPServer 80'" >> /root/.bash_aliases + echo "alias ftp-server='python -m pyftpdlib -p 21 -w'" >> /root/.bash_aliases + echo "alias tftp-server='service atftpd start'" >> /root/.bash_aliases + echo "alias smb-server='impacket-smbserver FILES .'" >> /root/.bash_aliases + echo "alias webdav-server='davserver -D ./ -n'" >> /root/.bash_aliases + + #netcat shortcuts (rlwrap!!!) + echo "alias ncr='rlwrap nc'" >> /root/.bash_aliases + echo "alias ncrl='rlwrap nc -nlvp'" >> /root/.bash_aliases + echo "alias ncl='nc -nlvp'" >> /root/.bash_aliases + + #mingw + echo "alias wcc32='i686-w64-mingw32-gcc'" >> /root/.bash_aliases + echo "alias wcc64='x86_64-w64-mingw32-gcc'" >> /root/.bash_aliases + echo "alias wcc32+='i686-w64-mingw32-g++'" >> /root/.bash_aliases + echo "alias wcc64+='x86_64-w64-mingw32-g++'" >> /root/.bash_aliases + + echo ">>> sourcing .bash_aliases..." + source /root/.bash_aliases + + echo " " + cat /root/.bash_aliases + echo " " +fi diff --git a/sshd_allow_root.sh b/sshd_allow_root.sh new file mode 100644 index 0000000..09cdb30 --- /dev/null +++ b/sshd_allow_root.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +if [[ -e /tmp/sshd_allow_root_login ]]; then + echo ">>> SKIP: root login already allowed." +else + echo ">>> Updating sshd_config..." + echo "PermitRootLogin yes" >> /etc/ssh/sshd_config + touch /tmp/sshd_allow_root_login + echo ">>> Restarting sshd..." + systemctl restart sshd + echo " " + cat /etc/ssh/sshd_config | grep "PermitRootLogin" + echo " " +fi diff --git a/swap_add.sh b/swap_add.sh new file mode 100644 index 0000000..ee2f853 --- /dev/null +++ b/swap_add.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +size=$1 + +if [[ -z $size ]]; then + echo ">>> ABORT: swapfile size in GB must be passed as the first script argument " + exit 0 +fi + +if [[ -e /swapfile ]]; then + echo ">>> SKIP: swapfile already exists " +else + echo ">>> allocating $size GB swapfile... " + fallocate -l ${size}G /swapfile > /dev/null + + echo ">>> setting permissions... " + chown root:root /swapfile > /dev/null + chmod 0600 /swapfile > /dev/null + + echo ">>> making swap..." + mkswap /swapfile > /dev/null + swapon /swapfile > /dev/null + + echo ">>> saving in fstab... " + cp /etc/fstab /etc/fstab.bak + echo '/swapfile none swap sw 0 0' | tee -a /etc/fstab + + echo " " + swapon + echo " " + +fi diff --git a/xfce4.sh b/xfce4.sh new file mode 100644 index 0000000..721c11e --- /dev/null +++ b/xfce4.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +export DEBIAN_FRONTEND=noninteractive + +echo ">>> adding XFCE4..." + +apt-get -qq -y install xfce +apt-get -qq -y xfce4-places-plugin +apt-get -qq -y xfce4-goodies +