-
Notifications
You must be signed in to change notification settings - Fork 35
/
setup.sh
executable file
·74 lines (63 loc) · 2.7 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#Global variables
RED="\e[31m"
YELLOW="\e[33m"
ENDCOLOR="\e[0m"
echo -ne "${RED}\nStarting setup script${ENDCOLOR}\n\n"
#change this if you don't use bash
shellConfig="$HOME/.bashrc"
location=$(pwd)
function installTool()
{
toolName="$1"
installCmd="$2"
echo -ne "${YELLOW}\n Checking if $toolName is out of date or not installed...${ENDCOLOR}\n"
$installCmd
}
function addtoBashrc()
{
helper="$1"
configFile="$2"
# Check if helper path is already present in config file
count=$(grep -c "$helper" "$configFile")
if [[ "$count" -eq 0 ]]; then
# If not present, add the value to the file
echo -ne "${YELLOW}Adding $helper to $configFile${ENDCOLOR}\n"
echo "source $location/$helper " >> $configFile
fi
}
#installing dependencies
echo -ne "${YELLOW}Installing dependencies...${ENDCOLOR}\n\n"
sudo apt update
installTool snap "sudo apt install snapd"
installTool gcc "sudo apt install gcc -qqq"
installTool gawk "sudo apt install gawk"
installTool jq "sudo apt install jq"
installTool go "sudo snap install go --classic"
installTool subfinder "go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest"
installTool httpx "go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest"
installTool dnsx "go install -v github.com/projectdiscovery/dnsx/cmd/dnsx@latest"
installTool assetfinder "go install -v github.com/tomnomnom/assetfinder@latest"
installTool httprobe "go install -v github.com/tomnomnom/httprobe@master"
installTool gau "go install -v github.com/lc/gau/v2/cmd/gau@latest"
installTool waybackurls "go install -v github.com/tomnomnom/waybackurls@latest"
installTool amass "go install -v github.com/owasp-amass/amass/v4/...@master"
installTool unfurl "go install -v github.com/tomnomnom/unfurl@latest"
installTool nuclei "go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest"
echo ""
addtoBashrc bbrf_helper.sh $shellConfig
addtoBashrc nuclei_helper.sh $shellConfig
addtoBashrc general_helper.sh $shellConfig
addtoBashrc axiom_helper.sh $shellConfig
addtoBashrc amass_helper.sh $shellConfig
addtoBashrc hackerone_helper.sh $shellConfig
# Define the lines to be added GO CONFIG
lines_to_add="export GOROOT=/usr/local/go
export GOPATH=\$HOME/go
export PATH=\$GOPATH/bin:\$GOROOT/bin:\$HOME/.local/bin:\$PATH"
# Check if lines already exist in .bashrc
if ! grep -qxF "$lines_to_add" $shellConfig; then
# If lines do not exist, append them to .bashrc
echo "$lines_to_add" >> $shellConfig
fi
source $shellConfig
echo -ne "\n${YELLOW}After installation you need to configure API KEYs for${ENDCOLOR} ${RED}subfinder and amass${ENDCOLOR}\n\n"