ZishanAdThandar

Hackify Linux By ZishanAdThandar

Dec 2nd, 2021 (edited)
1,877
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 8.34 KB | None | 0 0
  1. #! /usr/bin/env bash
  2.  
  3. # Color Codes of Regular Colors
  4. Black='\033[0;30m'        # Black
  5. Red='\033[0;31m'          # Red
  6. Green='\033[0;32m'        # Green
  7. Yellow='\033[0;33m'       # Yellow
  8. Blue='\033[0;34m'         # Blue
  9. Purple='\033[0;35m'       # Purple
  10. Cyan='\033[0;36m'         # Cyan
  11. White='\033[0;37m'        # White
  12. Nc='\033[0m'              # No Color
  13.  
  14. # banner
  15. clear
  16. printf "\n\n${Green}Hacking Tools and Wordlist Installer written by,\n\n\n"
  17. printf "${Red}" # banner bg and fg color
  18.  
  19. cat << "EOF"
  20.   _____    _                _      _ _____ _                 _          
  21.  |_  (_)__| |_  __ _ _ _   /_\  __| |_   _| |_  __ _ _ _  __| |__ _ _ _
  22.   / /| (_-| ' \/ _` | ' \ / _ \/ _` | | | | ' \/ _` | ' \/ _` / _` | '_|
  23. /___|_/__|_||_\__,_|_||_/_/ \_\__,_| |_| |_||_\__,_|_||_\__,_\__,_|_|  
  24.  
  25. EOF
  26. printf "\n\n${Cyan}https://twitter.com/ZishanAdThandar${Nc}\n\n"
  27. sleep 2 #banner break  
  28.                              
  29. # one liner bash if loop to check root user
  30. [ "$EUID" -ne 0 ] && printf "\n\033[30;5;41mPlease run as root.${Nc}\n" && sudo su
  31.  
  32. # function for wordlists from github
  33. function wsgit {
  34. [ -d "/opt/wordlist/$1" ] && printf "${Green}$1 already installed${Nc}\n"
  35. [ ! -d "/opt/wordlist/$1" ] && git clone $2 /opt/wordlist/$1 && printf "${Purple}$1 downloaded successfully\n${Nc}"
  36. }
  37. # function for wordlists with wget
  38. function wswget {
  39. [ -f "/opt/wordlist/$1" ] && printf "${Green}$1 already downloaded${Nc}\n"
  40. [ ! -f "/opt/wordlist/$1" ] && wget $2 -O /opt/wordlist/$1 && printf "${Purple}$1 downloaded\n${Nc}"
  41. }
  42. # Making wordlist folder if not exist
  43. [ ! -d "/opt/wordlist" ] && mkdir /opt/wordlist
  44. cd /opt/wordlist
  45. printf "we are in $(pwd) folder.\n\n/opt/wordlist/ Folder Contains:\n"
  46. ls
  47. # Array for wordlists
  48. declare -A wsgitarray=( [PayloadsAllTheThings]="https://github.com/swisskyrepo/PayloadsAllTheThings" [SecLists]="https://github.com/danielmiessler/SecLists" [fuzzdb]="https://github.com/fuzzdb-project/fuzzdb" [node-dirbuster]="https://github.com/daviddias/node-dirbuster" [api_wordlist]="https://github.com/chrislockard/api_wordlist")
  49. declare -A wsgetarray=( [all.txt]="https://gist.githubusercontent.com/jhaddix/86a06c5dc309d08580a018c66354a056/raw/96f4e51d96b2203f19f6381c8c545b278eaa0837/all.txt" [markdownxss.txt]="https://raw.githubusercontent.com/cujanovic/Markdown-XSS-Payloads/master/Markdown-XSS-Payloads.txt")
  50.  
  51. # for loop to git clone wordlists
  52. for i in "${!wsgitarray[@]}"
  53. do
  54.  wsgit $i ${wsgitarray[$i]}
  55. done
  56. # for loop to wget wordlists
  57. for i in "${!wsgetarray[@]}"
  58. do
  59.  wswget $i ${wsgetarray[$i]}
  60. done
  61.  
  62. # Rockyou unzipping
  63. [ -f "/opt/wordlist/rockyou.txt" ] && printf "${Green}rockyou.txt already downloaded${Nc}\n"
  64. [ ! -f "/opt/wordlist/rockyou.txt" ] && tar -xf /opt/wordlist/SecLists/Passwords/Leaked-Databases/rockyou.txt.tar.gz -C /opt/wordlist/ && printf "${Purple}unzipped rockyou.txt${Nc}\n"
  65.  
  66.  
  67. # Assetnote API wordlist (creates logical block error, because of large files)
  68. # [ -d "/opt/wordlist/assetnote" ] && printf "\n${Yellow}Assetnote API wordlist already installed${Nc}\n"
  69. #[ ! -d "/opt/wordlist/assetnote" ] && mkdir /opt/wordlist/assetnote && wget -r --no-parent -R "index.html*" https://wordlists-cdn.assetnote.io/data/ -nH -np /opt/wordlist/assetnote/ && printf "${Purple}Assetnote API wordlist downloaded successfully\n${Nc}" && mv /opt/wordlist/data/* /opt/wordlist/assetnote && rm -rf /opt/wordlist/data
  70.  
  71. printf "\n${Cyan}Stage 1 Finished!\nWordlists Downloaded.${Nc}\n\n"
  72. sleep 3 #stage 1 break
  73.  
  74. declare -a aptarray=("aircrack-ng" "audacity" "axiom" "beef" "binwalk" "bully" "cewl" "crunch" "dirb" "dnsenum" "dnsrecon" "exiftool" "ffmpeg" "git" "hashcat" "hcxdumptool" "httrack" "hydra" "john" "jq" "libpcap-dev" "masscan" "macchanger" "ndiff" "nodejs" "nikto" "nmap" "npm" "openvpn" "pixiewps" "pngcheck" "proxychains" "python2" "python3" "python3-pip" "reaver" "stegcracker" "steghide" "tmux" "tor" "uget" "wafw00f" "wapiti" "whatweb" "wifite" "wireshark" "youtube-dl")
  75. ### NOTE: "python3-pip" "libpcap-dev" "uget" will be installed but not showing because command is different.
  76.  
  77.  
  78. #Function to check if installed and install it
  79. function aptinstall {
  80. dpkg -l "$1" | grep -q ^ii && return 1
  81. apt-get -y install "$1"
  82. return 0
  83. }
  84. #Installing from array
  85. for i in "${aptarray[@]}"
  86. do
  87.  aptinstall $i
  88. done
  89. #functions to check missing tools
  90. function missapt {
  91. if ! command -v $1 &> /dev/null
  92. then
  93.     printf "${Red}Install $1 manually.\n${Nc}"
  94. fi
  95. }
  96. #Recommending missing tools from array
  97. for i in "${aptarray[@]}"
  98. do
  99.  missapt $i
  100. done
  101.  
  102. printf "\n${Cyan}Stage 2 Finished!\nApt Installation Finished.\nCheck for missing tools and manually install.${Nc}\n"
  103. sleep 2 #stage 2 break
  104.  
  105.  
  106. # installing and setting up Golang
  107. [ -d "/usr/local/go" ] && printf "\n${Green}GoLang already downloaded${Nc}\n"
  108. [ ! -d "/usr/local/go" ] && cd /tmp && wget https://go.dev/dl/go1.20.1.linux-amd64.tar.gz && tar -C /usr/local/ -xzf go1.20.1.linux-amd64.tar.gz && cd /usr/local/ && printf "export GOROOT=/usr/lib/go \nexport GOPATH=\$HOME/go \nexport PATH=\$PATH:$GOROOT/bin:\$GOPATH/bin" >> ~/.bashrc && printf "export GOROOT=/usr/lib/go \nexport GOPATH=\$HOME/go \nexport PATH=\$PATH:$GOROOT/bin:\$GOPATH/bin" >> /home/*/.bashrc && source ~/.bashrc && source /home/*/.bashrc
  109.  
  110. # Installing GoLang tools
  111. printf "\n${Cyan}Installing Go Tools for user ${Red}ROOT${Nc}${Cyan} (Current User).${Nc}\n\n"
  112. sleep 1
  113. function goinstall {
  114. [ -f "$HOME/go/bin/$1" ] && printf "${Green}$1 already installed.\n${Nc}"
  115. [ ! -f "$HOME/go/bin/$1" ] &&  go install -v $2 && printf "$1 installed successfully.\n"
  116. }
  117. declare -A goinstallarray=( [amass]="github.com/OWASP/Amass/v3/...@master" [assetfinder]="github.com/tomnomnom/assetfinder@latest" [dalfox]="github.com/hahwul/dalfox@latest" [ffuf]="github.com/ffuf/ffuf@latest" [gf]="github.com/tomnomnom/gf@latest" [git-hound]="github.com/tillson/git-hound@latest" [gobuster]="github.com/OJ/gobuster/v3@latest" [hakrawler]="github.com/hakluke/hakrawler@latest" [httprobe]="github.com/tomnomnom/httprobe@master" [httpx]="github.com/projectdiscovery/httpx/cmd/httpx@latest" [interactsh-client]="github.com/projectdiscovery/interactsh/cmd/interactsh-client@latest" [naabu]="github.com/projectdiscovery/naabu/v2/cmd/naabu@latest" [nuclei]="github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest" [qsreplace]="github.com/tomnomnom/qsreplace@latest" [waybackurls]="github.com/tomnomnom/waybackurls@latest" [subfinder]="github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest" [subzy]="github.com/LukaSikic/subzy@latest")
  118.  
  119. for i in "${!goinstallarray[@]}"
  120. do
  121.  goinstall $i ${goinstallarray[$i]}
  122. done
  123.  
  124. # setting gf patterns by 1ndianl33t
  125. [ -d "$HOME/.gf" ] && printf "${Green}gf patterns by 1ndianl33t already installed.\n${Nc}"
  126. [ ! -d "$HOME/.gf" ] && git clone https://github.com/1ndianl33t/Gf-Patterns ~/.gf && printf "gf patterns by 1ndianl33t installed succesfully.\n"
  127.  
  128. [ -f "$HOME/.gf/base64.json" ] && printf "${Green}gf patterns by tomnomnom already installed.\n${Nc}"
  129. [ ! -f "$HOME/.gf/base64.json" ] && git clone https://github.com/tomnomnom/gf /tmp/gf && mv /tmp/gf/examples/* ~/.gf/ && printf "gf patterns by tomnomnom installed succesfully.\n"
  130.  
  131.  
  132. #At the end Installing python3 tools
  133. printf "\n${Cyan}Installing Python Tools for user ROOT.${Nc}\n"
  134. sleep 1
  135.  
  136. yes | python3 -m pip install -U pip --quiet #update pip
  137. yes | python3 -m pip install sublist3r dirsearch pwntools arsenal-cli --quiet
  138. yes | python3 -m pip install sublist3r dirsearch pwntools arsenal-cli sqlmap --quiet
  139.  
  140. # Ruby Based Tools
  141. # WPScan Installation
  142. [ ! -f "/usr/local/bin/wpscan" ] && sudo apt install curl git libcurl4-openssl-dev make zlib1g-dev gawk g++ gcc libreadline6-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 autoconf libgdbm-dev libncurses5-dev automake libtool bison pkg-config ruby ruby-bundler ruby-dev -y && sudo gem install wpscan
  143.  
  144. # metasploit installation
  145. if ! command -v msfconsole &> /dev/null
  146. then
  147.  curl -s https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && \
  148.  chmod 755 msfinstall && \
  149.  ./msfinstall
  150.  rm msfinstall
  151. fi
  152.  
  153.  
  154. printf "\n${Cyan}Stage 3 Finished!\nOne by One Installation Finished.\nRun this script 4-5 times ${Red}WITH REOPENING TERMINAL AS ROOT. \n${Cyan}Check for missing tools in output and manually install.${Nc}\n\n"
  155.  
  156. printf "${Green}Thank you for using.\nHackify by ZɪsʜᴀɴAᴅTʜᴀɴᴅᴀʀ\n\n${nc}"
Add Comment
Please, Sign In to add comment