diff --git a/install.sh b/install.sh index fc014ab..212617b 100755 --- a/install.sh +++ b/install.sh @@ -2,204 +2,101 @@ . ./configuration.cfg +BOLD=$(tput bold) +YELLOW=$(tput setaf 3) +MAGENTA=$(tput setaf 5) +CYAN=$(tput setaf 6) +NORMAL=$(tput sgr0) + printf "${BOLD}${YELLOW}##########################################################\n" printf "##### Welcome to the MagicRecon dependency installer #####\n" printf "##########################################################\n\n${NORMAL}" sudo apt-get -y update -printf "${BOLD}${MAGENTA}Installing programming languages\n${NORMAL}" - -printf "${CYAN}Installing Python\n${NORMAL}" -sudo apt-get install -y python3-pip -sudo apt-get install -y python-pip -sudo apt-get install -y dnspython - -printf "${CYAN}Installing GO\n\n${NORMAL}" -sudo apt install -y golang -export GOROOT=/usr/lib/go -export GOPATH=~/go -export PATH=$GOPATH/bin:$GOROOT/bin:$PATH - -echo "export GOROOT=/usr/lib/go" >> ~/.bashrc -echo "export GOPATH=~/go" >> ~/.bashrc -echo "export PATH=$GOPATH/bin:$GOROOT/bin:$PATH" >> ~/.bashrc - -source ~/.bashrc - -printf "${CYAN}Installing Cargo\n\n${NORMAL}" -sudo apt install cargo - -printf "${CYAN}Installing html2text\n\n${NORMAL}" -sudo apt install html2text +printf "${BOLD}${MAGENTA}Installing programming languages and essential packages\n${NORMAL}" +sudo apt-get install -y python3-pip dnspython golang cargo html2text whatweb theharvester nmap dirsearch sqlmap cargo subjack -printf "${BOLD}${MAGENTA}Installing repositories\n${NORMAL}" +printf "${BOLD}${MAGENTA}Cloning repositories and installing dependencies\n${NORMAL}" cd $HOME -mkdir tools +mkdir -p tools cd tools -printf "${CYAN}Cloning ASNLookup\n${NORMAL}" -git clone https://github.com/yassineaboukir/Asnlookup -cd Asnlookup -pip3 install -r requirements.txt -cd .. - -printf "${CYAN}Cloning ssl-checker\n${NORMAL}" -git clone https://github.com/narbehaj/ssl-checker -cd ssl-checker -pip3 install -r requirements.txt -cd .. - -printf "${CYAN}Cloning CloudEnum\n${NORMAL}" -git clone https://github.com/initstring/cloud_enum -cd cloud_enum -pip3 install -r requirements.txt -cd .. - -printf "${CYAN}Cloning GitDorker\n${NORMAL}" -git clone https://github.com/obheda12/GitDorker -cd GitDorker -pip3 install -r requirements.txt -cd .. - -printf "${CYAN}Cloning RobotScraper\n${NORMAL}" -git clone https://github.com/robotshell/robotScraper.git +declare -A REPOS=( + ["Asnlookup"]="https://github.com/yassineaboukir/Asnlookup" + ["ssl-checker"]="https://github.com/narbehaj/ssl-checker" + ["cloud_enum"]="https://github.com/initstring/cloud_enum" + ["GitDorker"]="https://github.com/obheda12/GitDorker" + ["robotScraper"]="https://github.com/robotshell/robotScraper.git" + ["nuclei-templates"]="https://github.com/projectdiscovery/nuclei-templates.git" + ["SecLists"]="https://github.com/danielmiessler/SecLists" + ["Corsy"]="https://github.com/s0md3v/Corsy.git" + ["SecretFinder"]="https://github.com/m4ll0k/SecretFinder.git" + ["CMSeeK"]="https://github.com/Tuhinshubhra/CMSeeK" + ["findomain"]="https://github.com/findomain/findomain.git" + ["hacks"]="https://github.com/tomnomnom/hacks" + ["Bolt"]="https://github.com/s0md3v/Bolt" + ["Gf-Patterns"]="https://github.com/1ndianl33t/Gf-Patterns" +) + +for repo in "${!REPOS[@]}"; do + printf "${CYAN}Cloning ${repo}\n${NORMAL}" + git clone "${REPOS[$repo]}" + cd "$repo" + if [ -f requirements.txt ]; then + pip3 install -r requirements.txt --break-system-packages + fi + cd .. +done -printf "${CYAN}Install Arjun\n${NORMAL}" pip3 install arjun -printf "${CYAN}Cloning nuclei-templates\n${NORMAL}" -git clone https://github.com/projectdiscovery/nuclei-templates.git - -printf "${CYAN}Cloning SecLists\n${NORMAL}" -git clone https://github.com/danielmiessler/SecLists - -printf "${CYAN}Cloning Corsy\n${NORMAL}" -git clone https://github.com/s0md3v/Corsy.git -cd Corsy -pip3 install requests -cd .. - -printf "${CYAN}Cloning SecretFinder\n${NORMAL}" -git clone https://github.com/m4ll0k/SecretFinder.git secretfinder -cd secretfinder -pip install -r requirements.txt -cd .. - -printf "${CYAN}Cloning CMSeek\n${NORMAL}" -git clone https://github.com/Tuhinshubhra/CMSeeK -cd CMSeeK -pip3 install -r requirements.txt -cd .. - -printf "${CYAN}Cloning Findomain\n${NORMAL}" -git clone https://github.com/findomain/findomain.git +printf "${CYAN}Building findomain\n${NORMAL}" cd findomain cargo build --release sudo cp target/release/findomain /usr/bin/ cd .. -printf "${CYAN}Cloning anti-burl\n${NORMAL}" -git clone https://github.com/tomnomnom/hacks +printf "${CYAN}Building anti-burl\n${NORMAL}" cd hacks/anti-burl/ go build main.go sudo mv main ~/go/bin/anti-burl -cd .. - -printf "${CYAN}Cloning XSRFProbe\n${NORMAL}" -git clone https://github.com/s0md3v/Bolt -cd Bolt -pip3 install -r requirements.txt -cd .. +cd ../.. -printf "${CYAN}Cloning Gf-Patterns\n${NORMAL}" -git clone https://github.com/1ndianl33t/Gf-Patterns -mkdir ~/.gf +mkdir -p ~/.gf cp -r Gf-Patterns/* ~/.gf -cd .. -cd .. - - -printf "${BOLD}${MAGENTA}Installing tools\n${NORMAL}" -printf "${CYAN}Installing WhatWeb\n\n${NORMAL}" -sudo apt-get install whatweb +printf "${BOLD}${MAGENTA}Installing GO tools\n${NORMAL}" +declare -a GO_TOOLS=( + "github.com/OWASP/Amass/v3/..." + "github.com/michenriksen/aquatone" + "github.com/projectdiscovery/subfinder/v2/cmd/subfinder" + "github.com/hakluke/hakrawler" + "github.com/tomnomnom/anew" + "github.com/projectdiscovery/httpx/cmd/httpx" + "github.com/projectdiscovery/notify/cmd/notify" + "github.com/projectdiscovery/nuclei/v2/cmd/nuclei" + "github.com/lc/gau" + "github.com/tomnomnom/gf" + "github.com/tomnomnom/qsreplace" + "github.com/hahwul/dalfox/v2" + "github.com/tomnomnom/hacks/html-tool" + "github.com/tomnomnom/waybackurls" +) + +for tool in "${GO_TOOLS[@]}"; do + printf "${CYAN}Installing $(basename $tool)\n${NORMAL}" + go install "$tool@latest" + sudo cp "$HOME/go/bin/$(basename $tool)" /usr/local/bin/ +done -printf "${CYAN}Installing TheHarvester\n\n${NORMAL}" -sudo apt-get install theharvester - -printf "${CYAN}Installing Nmap\n\n${NORMAL}" -sudo apt-get install nmap - -printf "${CYAN}Installing Dirsearch\n\n${NORMAL}" -sudo apt-get install dirsearch - -printf "${CYAN}Installing SqlMap\n\n${NORMAL}" -sudo apt-get install sqlmap - -printf "${CYAN}Installing Amass\n${NORMAL}" -go get -v github.com/OWASP/Amass/v3/.. -sudo cp ~/go/bin/amass /usr/local/bin - -printf "${CYAN}Installing Aquatone\n${NORMAL}" -go get -u github.com/michenriksen/aquatone -sudo cp ~/go/bin/aquatone /usr/local/bin - -printf "${CYAN}Installing Subfinder\n${NORMAL}" -GO111MODULE=on go get -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder -sudo cp ~/go/bin/subfinder /usr/local/bin - -printf "${CYAN}Installing Hakrawler\n${NORMAL}" -go install github.com/hakluke/hakrawler@latest -sudo cp ~/go/bin/hakrawler /usr/local/bin - -printf "${CYAN}Installing anew\n${NORMAL}" -go get -u github.com/tomnomnom/anew -sudo cp ~/go/bin/anew /usr/local/bin - -printf "${CYAN}Installing HTTPX\n${NORMAL}" -GO111MODULE=on go get -v github.com/projectdiscovery/httpx/cmd/httpx -sudo cp ~/go/bin/httpx /usr/local/bin - -printf "${CYAN}Installing Notify\n${NORMAL}" -GO111MODULE=on go get -v github.com/projectdiscovery/notify/cmd/notify -sudo cp ~/go/bin/notify /usr/local/bin - -printf "${CYAN}Installing Nuclei\n${NORMAL}" -GO111MODULE=on go get -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei -sudo cp ~/go/bin/nuclei /usr/local/bin - -printf "${CYAN}Installing Shcheck\n${NORMAL}" -git clone https://github.com/santoru/shcheck +echo 'source $GOPATH/src/github.com/tomnomnom/gf/gf-completion.bash' >> ~/.bashrc +cp -r ~/go/src/github.com/tomnomnom/gf/examples ~/.gf printf "${CYAN}Installing MailSpoof\n${NORMAL}" sudo pip3 install mailspoof -printf "${CYAN}Installing MailSpoof\n${NORMAL}" -go get github.com/haccer/subjack -sudo cp ~/go/bin/subjack /usr/local/bin - -printf "${CYAN}Installing gau\n${NORMAL}" -GO111MODULE=on go get -u -v github.com/lc/gau -sudo cp ~/go/bin/gau /usr/local/bin - -printf "${CYAN}Installing gf\n${NORMAL}" -go get -u github.com/tomnomnom/gf -echo 'source $GOPATH/src/github.com/tomnomnom/gf/gf-completion.bash' >> ~/.bashrc -cp -r $GOPATH/src/github.com/tomnomnom/gf/examples ~/.gf -sudo cp ~/go/bin/gf /usr/local/bin - -printf "${CYAN}Installing qsreplace\n${NORMAL}" -go get -u github.com/tomnomnom/qsreplace -sudo cp ~/go/bin/qsreplace /usr/local/bin - -printf "${CYAN}Installing Dalfox\n${NORMAL}" -GO111MODULE=on go get -v github.com/hahwul/dalfox/v2 -sudo cp ~/go/bin/dalfox /usr/local/bin - -printf "${CYAN}Installing html-tool\n${NORMAL}" -go get -u github.com/tomnomnom/hacks/html-tool -sudo cp ~/go/bin/html-tool /usr/local/bin +printf "${CYAN}Installing Shcheck\n${NORMAL}" +git clone https://github.com/santoru/shcheck -printf "${CYAN}Installing waybackurls\n${NORMAL}" -go get github.com/tomnomnom/waybackurls +printf "${BOLD}${YELLOW}Installation completed successfully!\n${NORMAL}"