-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.sh
311 lines (228 loc) · 6.29 KB
/
main.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
#!/bin/bash
#!/bin/bash
figlet -f maxiwi "RECCI"
echo " _.-._ "
echo " .' | | ."
echo " / | | \ "
echo " | | | | "
echo " |____|_|____| "
echo " |____(_)____| "
echo " /|(o)| |(o)|\ "
echo "/ | | | | \\\\"
echo "\ | (|_|) | /"
echo " | \/ \/ |"
echo " / / ___ \ \ VK"
echo "( )"
echo " \ /"
echo " ._______.'"
echo "welcome to script"
echo "Enter the ip address"
read ip
echo "Which tool you want to use ?"
echo "[0] ping"
echo "[1] nmap check all ports"
echo "[2] Common Ports"
echo "[3] Directory enamuration"
echo "[4] robots.txt"
echo "[5] sitemap.xml"
echo "[6] Find the subdomains"
echo "[7] Find all the possible vulnerabilities"
echo "[8] Find all the email addresses"
echo "[9] Generate full report from all the finding"
echo "[10] whatweb"
echo "[11] whois"
echo "[12] exit"
read tool
while [[ $tool -ne 12 ]]
do
case $tool in
0)
echo "Please wait..."
ping $ip -c 10 > ping/file # pinging the site and storing the data in file (text file)
g++ ping/temp.cpp -o ping/run # the cpp file name and compiling the file
cd ping
./run
cd ..
;;
1)
echo "Running nmap for all the ports. it will take some times"
echo "Please Wait..."
nmap -sC -sV -p- --min-rate 2500 $ip > nmap/nmapRead
wait
g++ nmap/nmapTextManipulation.cpp -o run
./run
echo "Execution is Done "
echo "The following are Open Ports"
cat nmap/OpenPorts
;;
2)
echo "Running nmap for common ports. it will take some times"
echo "Please Wait..."
nmap -sC -sV --min-rate 2500 $ip > nmap/nmapRead
wait
g++ nmap/nmapTextManipulation.cpp -o run
./run
echo "Execution is Done "
echo "The following are Open Ports"
cat nmap/OpenPorts
;;
3)
echo "Now running the GoBuster"
gobuster dir -u $ip -w gobuster/wordlist.txt > gobuster/gobusterInput
cat gobuster/gobusterInput
;;
4)
code=$(curl -s -o /dev/null -w "%{http_code}" $ip/robots.txt)
if [[ $code -eq 404 ]];
then
echo "Robots.txt does not exist in this site"
else
echo "the following is the result of robots.txt"
echo
curl $ip/robots.txt > robots.txt
cat robots.txt
fi
;;
5)
code=$(curl -s -o /dev/null -w "%{http_code}" $ip/sitemap.xml)
if [[ $code -eq 404 ]];
then
echo "sitemap.xml does not exist in this site"
else
echo
curl $ip/sitemap.xml > sitemap.xml
echo "The result of sitemap.xml has been written into file"
fi
;;
6)
echo "Finding all the subdomains."
echo "Please wait..."
sublist3r -d $ip -n > subdomains/resultoOfSublist3r.txt
wait
cd subdomains
g++ sub.cpp
./a.out
cd ..
echo "All the subdomains are being written into file resultoOfSublist3r"
rm subdomains/resultoOfSublist3r.txt
;;
7)
# for finding the possible vulnerabilities
echo "Please wait..."
rm vulnerabilities/vuln
while read -r variableName; do
searchsploit -w --colour $variableName >> vulnerabilities/vuln
done < nmap/Versions
echo "All the possible exploits are been identified and stored"
;;
8)
echo "Now finding the emails."
echo "Please wait"
theHarvester -d $ip -b google > findemails/file3.txt
g++ findemails/harvest.cpp -o findemails/run # the cpp file name and compiling the file
findemails/./run # running the cpp program
;;
9)
echo "The Ip and Ping details here " > all
echo "--------------------------------------" >> all
cat ping/file >> all
echo >> all
echo >> all
echo "The open ports are " >> all
echo "--------------------------------------" >> all
cat nmap/OpenPorts >> all
echo >> all
echo >> all
echo "The Services and Versions are " >> all
echo "--------------------------------------" >> all
cat nmap/ServicesAndVersions >> all
echo >> all
echo >> all
echo "The found directories are " >> all
echo "--------------------------------------" >> all
cat gobuster/gobusterInput >> all
echo >> all
echo >> all
echo "The emails are " >> all
echo "--------------------------------------" >> all
cat findemails/file3.txt >> all
echo >> all
echo >> all
echo "The web technologies used are are " >> all
echo "--------------------------------------" >> all
cat whatweb/file.txt >> all
echo >> all
echo >> all
echo "The result of robots.txt " >> all
echo "--------------------------------------" >> all
cat robots.txt >> all
echo >> all
echo >> all
echo "The result of sitemap.xml " >> all
echo "--------------------------------------" >> all
cat sitemap.xml >> all
echo >> all
echo >> all
echo "The subdomains are " >> all
echo "--------------------------------------" >> all
cat subdomains/finalresultoOfSublist3r.txt >> all
echo >> all
echo >> all
echo "The whois Data is " >> all
echo "--------------------------------------" >> all
cat whois/WhoisData >> all
echo >> all
echo >> all
echo "The possible vulnerabilities are " >> all
echo "--------------------------------------" >> all
cat vulnerabilities/vuln >> all
echo >> all
echo >> all
enscript -p all.ps all
ps2pdf all.ps final.pdf
rm all.ps
rm all
;;
10)
# echo "destination ${{ip}}"
echo "Now finding the web info."
echo "Please wait"
whatweb -v --color='never' $ip > whatweb/file2.txt #running the whatweb
gawk '{gsub(/[[:cntrl:]]/,x)}1' whatweb/file2.txt > whatweb/file.txt # removing the binary characters
rm whatweb/file2.txt
g++ whatweb/whatwebprog.cpp -o whatweb/run # the cpp file name and compiling the file
cd whatweb
./run # running the cpp program
cd ..
;;
11)
echo "Now running whois"
whois $ip > whois/data
cd whois
g++ text.cpp
./a.out
rm data
cd ..
;;
*)
echo "Please choose valid option"
;;
esac
echo "Which tool you want to use ?"
echo "[0] ping"
echo "[1] nmap check all ports"
echo "[2] Common Ports"
echo "[3] Directory enamuration"
echo "[4] robots.txt"
echo "[5] sitemap.xml"
echo "[6] Find the subdomains"
echo "[7] Find all the possible vulnerabilities"
echo "[8] Find all the email addresses"
echo "[9] Generate full report from all the finding"
echo "[10] whatweb"
echo "[11] whois"
echo "[12] exit"
read tool
done
# echo "Now running the GoBuster"
# gobuster dir -u 192.168.37.134 -w gobuster/wordlist.txt > gobuster/gobusterInput