-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.sh
139 lines (111 loc) · 4.16 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/bin/bash
GREEN='\033[32m'
RED='\033[31m'
YELLOW='\033[33m'
RESET='\033[0m'
check_command() {
if ! command -v "$1" &> /dev/null; then
echo -e "${RED}$1 is not installed.${RESET}"
return 1
else
echo -e "${GREEN}$1 is already installed.${RESET}"
return 0
fi
}
install_apt() {
echo -e "${YELLOW}Installing $1 using apt...${RESET}"
sudo apt-get update
sudo apt-get install -y "$1"
}
install_git_clone() {
echo -e "${YELLOW}Cloning $2 from GitHub...${RESET}"
git clone "$1" "$2"
}
install_go() {
echo -e "${YELLOW}Installing $1 using go install...${RESET}"
go install "$1"
}
install_pip() {
echo -e "${YELLOW}Installing $1 using pip...${RESET}"
pip install "$1"
}
apt_tools=("figlet" "lolcat" "curl" "jq" "xdotool")
for tool in "${apt_tools[@]}"; do
check_command "$tool"
if [ $? -ne 0 ]; then
install_apt "$tool"
fi
done
declare -A go_tools=(
["subfinder"]="github.com/projectdiscovery/subfinder/v2/cmd/subfinder"
["assetfinder"]="github.com/tomnomnom/assetfinder"
["httpx"]="github.com/projectdiscovery/httpx/cmd/httpx"
["anew"]="github.com/tomnomnom/anew"
["waybackurls"]="github.com/tomnomnom/waybackurls"
["hakrawler"]="github.com/hakluke/hakrawler@latest"
["katana"]="github.com/projectdiscovery/katana/cmd/katana"
["gospider"]="github.com/jaeles-project/gospider@latest"
["naabu"]="github.com/projectdiscovery/naabu/v2/cmd/naabu"
["ffuf"]="github.com/ffuf/ffuf/v2@latest"
)
for tool in "${!go_tools[@]}"; do
check_command "$tool"
if [ $? -ne 0 ]; then
install_go "${go_tools[$tool]}"
fi
done
declare -A git_tools=(
["Sublist3r"]="https://github.com/aboul3la/Sublist3r.git"
["ParamSpider"]="https://github.com/devanshbatham/paramspider.git"
["gf"]="https://github.com/tomnomnom/gf.git"
)
for tool in "${!git_tools[@]}"; do
if [ ! -d "$HOME/tools/$tool" ]; then
install_git_clone "${git_tools[$tool]}" "$HOME/tools/$tool"
else
echo -e "${GREEN}$tool is already cloned in $HOME/tools/$tool.${RESET}"
fi
done
if [ ! -d "$HOME/.gf" ]; then
echo -e "${YELLOW}Setting up gf patterns...${RESET}"
mkdir -p "$HOME/.gf"
cp -r "$HOME/tools/gf/examples/"* "$HOME/.gf/"
echo -e "${GREEN}gf patterns have been set up.${RESET}"
else
echo -e "${GREEN}gf patterns are already set up.${RESET}"
fi
if [ ! -d "$HOME/tools/Gf-Patterns" ]; then
echo -e "${YELLOW}Cloning Gf-Patterns...${RESET}"
git clone https://github.com/1ndianl33t/Gf-Patterns "$HOME/tools/Gf-Patterns"
cp "$HOME/tools/Gf-Patterns/"*.json "$HOME/.gf/"
echo -e "${GREEN}Gf-Patterns have been installed in ~/.gf.${RESET}"
else
echo -e "${GREEN}Gf-Patterns is already cloned in $HOME/tools/Gf-Patterns.${RESET}"
fi
check_command "knockpy"
if [ $? -ne 0 ]; then
install_pip "git+https://github.com/guelfoweb/knock.git"
fi
echo -e "${YELLOW}Downloading and setting up pattrans...${RESET}"
if [ ! -d "$HOME/tools/pattrans" ]; then
git clone https://github.com/someone/pattrans.git "$HOME/tools/pattrans"
echo -e "${GREEN}pattrans has been cloned to $HOME/tools/pattrans.${RESET}"
else
echo -e "${GREEN}pattrans is already cloned in $HOME/tools/pattrans.${RESET}"
fi
echo -e "${YELLOW}Setting up kidrecon.sh...${RESET}"
if [ ! -f "./kidrecon.sh" ]; then
echo -e "${RED}kidrecon.sh not found in the current directory.${RESET}"
exit 1
fi
chmod +x kidrecon.sh
echo -e "${GREEN}kidrecon.sh is now executable.${RESET}"
sudo mv ./kidrecon.sh /usr/local/bin/kidrecon
sudo ln -sf /usr/local/bin/kidrecon /usr/local/bin/kr
echo -e "${GREEN}You can now run the tool by typing 'kr' or 'kidrecon' from anywhere.${RESET}"
echo -e "${GREEN}All tools are installed and kidrecon is ready to use!${RESET}"
echo -e "${YELLOW}Note: Please check Sublist3r, ParamSpider, and pattrans manually. Go into their directories and install any necessary dependencies to avoid issues.${RESET}"
echo -e "${YELLOW}Copying Go binaries to /usr/bin for global access...${RESET}"
sudo cp ~/go/bin/* /usr/bin/
echo -e "${GREEN}Go binaries are now accessible from anywhere!${RESET}"
echo -e "${GREEN}You can now type 'kidrecon' or 'kr' to start the tool.${RESET}"