forked from vishnudxb/automated-pentest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpentest.sh
executable file
·290 lines (284 loc) · 22.8 KB
/
pentest.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
#!/bin/bash
#This script is only for an Educational purpose. Any actions and or activities related to the material contained
#within this repo is solely your responsibility.The misuse of the information in this repo can result in criminal
#charges brought against the persons in question. The author Vishnu Nair will not be held responsible in the
#event any criminal charges be brought against any individuals misusing the information in this repo to break the law.
DOMAIN=""
printhelp() {
echo "
Usage: sh pentest.sh [OPTION]...
-d, --domain Provide your DOMAIN domain.
-h, --help Display help file
"
}
while [ "$1" != "" ]; do
case "$1" in
-d | --domain ) DOMAIN=$2; shift 2 ;;
-h | --help ) echo "$(printhelp)"; exit; shift; break ;;
esac
done
echo "YOUR TARGET DOMAIN IS:" $DOMAIN
echo ""
echo ""
echo ""
echo "╔════════════════════════════════╗"
echo "║ DNS DETAILS ║"
echo "╚════════════════════════════════╝"
echo ""
echo "whois started"
whois $DOMAIN > whois-report.txt
echo "╔══════════════════════════════════════════════════════════════════════════════╗"
echo "║ The output of whois saved in /src/whois-report.html/ ║"
echo "╚══════════════════════════════════════════════════════════════════════════════╝"
echo ""
echo "whois finished"
echo ""
echo "nslookup started"
nslookup $DOMAIN > nslookup-report.txt
echo "╔══════════════════════════════════════════════════════════════════════════════╗"
echo "║ The output of nslookup saved in /src/wnslookup-report.html ║"
echo "╚══════════════════════════════════════════════════════════════════════════════╝"
echo "nslookup finished"
echo ""
echo "Nmap Scanning Started"
nmap -v -O $DOMAIN > nmap-report.txt
echo "╔══════════════════════════════════════════════════════════════════════════════╗"
echo "║ The output of Nmap saved in /src/nmap-report.html ║"
echo "╚══════════════════════════════════════════════════════════════════════════════╝"
echo "Nmap Scanning finished"
echo ""
echo "Uniscan Started"
uniscan -u http://$DOMAIN/ -qwedsgj
mkdir -p /src/uniscan && cp -rvf /usr/share/uniscan/report/* /src/uniscan
echo "╔══════════════════════════════════════════════════════════════════════════════╗"
echo "║ The output of Uniscan is saved in /src/uniscan/report/ ║"
echo "╚══════════════════════════════════════════════════════════════════════════════╝"
echo ""
echo "Uniscan finished"
echo ""
echo "Starting theharvester – A tool for gathering e-mail accounts and subdomain names from public sources"
theharvester -d $DOMAIN -l 50 -b all -f theharvester-report.txt
echo "╔════════════════════════════════════════════════════════════════════════════════════╗"
echo "║ The output of theharvester is saved in /src/theharvester-report.html ║"
echo "╚════════════════════════════════════════════════════════════════════════════════════╝"
echo ""
echo "theharvester is finished"
echo ""
echo "Starting Dnsrecon - A powerful DNS enumeration script"
dnsrecon -d $DOMAIN -t axfr > dnsrecon-report.txt
dnsrecon -D /usr/share/dnsrecon/namelist.txt -t brt -d $DOMAIN > dnsrecon-bruteforce.txt
dnsrecon -d $DOMAIN -a > dnsrecon-zone-transfer.txt
dnsrecon -d $DOMAIN -t tld > dnsrecon-tld.txt
echo "╔════════════════════════════════════════════════════════════════════════════════════╗"
echo "║ The output of dnsrecon is saved in /src/dnsrecon-*.html ║"
echo "╚════════════════════════════════════════════════════════════════════════════════════╝"
echo ""
echo "Dnsrecon is finished"
echo ""
echo "dnsmap started"
dnsmap $DOMAIN -r dnsmap-report.txt
echo "╔════════════════════════════════════════════════════════════════════════════════════╗"
echo "║ The output of dnsmap is saved in /src/dnsmap-report.html ║"
echo "╚════════════════════════════════════════════════════════════════════════════════════╝"
echo ""
echo "dnsmap finished"
echo ""
echo "Starting dirb – A web content scanner"
dirb http://$DOMAIN -o dirb-report.txt
echo "╔════════════════════════════════════════════════════════════════════════════════════╗"
echo "║ The output of dirb is saved in /src/dirb-report.html ║"
echo "╚════════════════════════════════════════════════════════════════════════════════════╝"
echo ""
echo "Finished dirb"
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ Web Application Firewall Scanning Starting ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo ""
echo "scanning WAF with wafw00f"
wafw00f http://$DOMAIN > waf-report.txt
echo "╔════════════════════════════════════════════════════════════════════════════════════╗"
echo "║ The output of wafw00f is saved in /src/waf-report.html ║"
echo "╚════════════════════════════════════════════════════════════════════════════════════╝"
echo ""
echo "scanning WAF finished..."
echo ""
echo ""
echo "scanning with Nikto started"
nikto -host $DOMAIN -Plugins "apacheusers(enumerate,dictionary:users.txt);report_xml" -output nikto-report.txt
echo "╔════════════════════════════════════════════════════════════════════════════════════╗"
echo "║ The output of nikto is saved in /src/nikto-report.html ║"
echo "╚════════════════════════════════════════════════════════════════════════════════════╝"
echo ""
echo "scanning with Nikto finished"
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ Web Application Firewall Scanning Finished ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo ""
echo ""
echo ""
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ XSS Scanning Starting ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo ""
echo "XssPy started"
python /src/XssPy/XssPy.py -e -v -u $DOMAIN > xss-report.txt
echo "╔════════════════════════════════════════════════════════════════════════════════════╗"
echo "║ The output of XssPy is saved in /src/xss-report.html ║"
echo "╚════════════════════════════════════════════════════════════════════════════════════╝"
echo ""
echo "XssPy finished"
echo ""
echo ""
echo "XSStrike started"
python3 /src/XSStrike/xsstrike.py -u "https://$DOMAIN?q=query" --console-log-level DEBUG > xsstrike-report.txt
echo "==============start xsstrike crawl==============" >> xsstrike-report.html
python3 /src/XSStrike/xsstrike.py -u "https://$DOMAIN" --crawl --console-log-level DEBUG >> xsstrike-report.txt
echo "==============finished xsstrike crawl==============" >> xsstrike-report.html
echo "==============start xsstrike params==============" >> xsstrike-report.html
python3 /src/XSStrike/xsstrike.py -u "https://$DOMAIN" --params --console-log-level DEBUG >> xsstrike-report.txt
echo "==============finished xsstrike params==============" >> xsstrike-report.html
echo "==============start xsstrike fuzzer==============" >> xsstrike-report.html
python3 /src/XSStrike/xsstrike.py -u "https://$DOMAIN" --fuzzer --console-log-level DEBUG >> xsstrike-report.txt
echo "==============finished xsstrike fuzzer==============" >> xsstrike-report.html
echo "╔════════════════════════════════════════════════════════════════════════════════════╗"
echo "║ The output of XSStrike is saved in /src/xsstrike-report.html ║"
echo "╚════════════════════════════════════════════════════════════════════════════════════╝"
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ XSS Scanning Finished ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo ""
echo ""
echo ""
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ Web / CMS Vulnerability Scanning Starting ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo "starting WhatWeb - Next generation web scanner"
whatweb -v -a 3 $DOMAIN > whatweb-report.txt
echo "╔══════════════════════════════════════════════════════════════════════════════╗"
echo "║ The output of whatweb is saved in /src/whatweb-report.html ║"
echo "╚══════════════════════════════════════════════════════════════════════════════╝"
echo ""
echo ""
echo "Finished WhatWeb"
echo ""
echo ""
echo "starting Wapiti"
wapiti -u https://$DOMAIN/ -o wapiti_result -f html
echo "Finished Wapiti"
echo "╔══════════════════════════════════════════════════════════════════════════════╗"
echo "║ The output of Wapiti is saved in /src/wapiti_result/ ║"
echo "╚══════════════════════════════════════════════════════════════════════════════╝"
echo ""
echo ""
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ Scan Wordpress Starting ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo ""
echo ""
echo "Starting wpscan - is a black box WordPress vulnerability scanner"
wpscan --url http://$DOMAIN --enumerate u > wpscan-report.txt
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ Scan Wordpress Finished ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo ""
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ Scan Joomla Starting ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo "Starting Joomscan - joomla Vulnerability Scan"
joomscan -u http://$DOMAIN > joomscan-report.txt
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ Scan Joomla Finished ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ Scan Other CMS Starting ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo ""
echo ""
echo "scan drupal cms"
droopescan scan drupal -u http://$DOMAIN > droopescan-drupal.txt
echo "scan dupal cms finished next...."
echo ""
echo "scan silverstripe cms"
droopescan scan silverstripe -u http://$DOMAIN > droopescan-silverstripe.txt
echo "scan silverstripe cms finished next..... "
echo ""
echo "scan moodle cms"
droopescan scan moodle -u http://$DOMAIN > droopescan-moodle.txt
echo "scan moodle cms finished next..... "
echo ""
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ Scan Other CMS Finished ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ CMS Vulnerability Scanning Finished ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ SSL Vulnerability Scanning Starting ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo "starting sslscan"
sslscan $DOMAIN > sslscan-report.txt
echo "sslscan is finished"
echo ""
echo "starting sslyze - Fast and full-featured SSL scanner"
sslyze --regular $DOMAIN > sslyze-report.txt
echo "sslyze is finished"
echo ""
echo "A2SV Scanning started"
python /src/a2sv/a2sv.py -t $DOMAIN > a2sv-report.txt
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ SSL Vulnerability Scanning Finished ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo ""
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ Fuzz Scanning Starting ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo "starting fuzzing with wfuzz"
wfuzz -c -z file,/usr/share/wfuzz/wordlist/general/common.txt --hc 404 https://$DOMAIN/index.php?id=FUZZ > wfuzz-report.txt
echo "fuzzing finished"
echo ""
echo ""
#echo "starting .php web dir started"
#dirbuster -v -H -l /usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt -u https://$DOMAIN/index.php?url={dir}.php -e php -r /src/dirbuster-php -t 20
#echo "fuzzing .php web dir finished"
#echo ""
#echo ""
#echo "starting .html web dir started"
#dirbuster -v -H -l /usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt -u https://$DOMAIN/index.html?url={dir}.html -e html -r /src/dirbuster-html -t 20
#echo "fuzzing .html web dir finished"
#echo ""
#echo ""
#echo ""
#echo "starting .asp web dir started"
#dirbuster -v -H -l /usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt -u https://$DOMAIN/index.asp?url={dir}.net -e asp -r /src/dirbuster-asp -t 20
#echo "fuzzing .asp web dir finished"
echo "starting metagoofil – Tool designed for extracting metadata of public documents"
metagoofil -d $DOMAIN -t ALL -l 200 -n 50 -o /src -f -w
echo "metagoofil finished"
echo ""
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ Fuzz Scanning Finished ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo ""
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ Automated Pentest finished ║"
echo "╚════════════════════════════════════════════════════════════════╝"