-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathauto-recon.sh
executable file
·1821 lines (1738 loc) · 101 KB
/
auto-recon.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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env bash
banner1() {
echo -e "\e[1;94m _____________ ____ ________________ \e[0m"
echo -e "\e[1;94m /___/___ \ / / | /___/__ \ _____ \e[0m"
echo -e "\e[1;94m / / _ \______/__/ |______|__|_____ * \_________________/__/ |___ \e[0m"
echo -e "\e[1;94m __/__/ /_\ \ | | \ __\/ _ \| | __/ __ \_/ ___\/ _ \| | \e[0m"
echo -e "\e[1;94m | | ___ \| | /| | ( |_| ) | | \ ___/\ \__( |_| ) | | \e[0m"
echo -e "\e[1;94m |___|____/\__\____|____/_|__|\_\____/|__|____|_ /\___ |\___ \____/|___| / \e[0m"
echo -e "\e[1;94m \___\/ \__\/ \___\/ \___\/ \e[0mv4.0"
echo -e "\e[1;77m\e[45m AUTO RECON by github.com/Knowledge-Wisdom-Understanding \e[0m"
echo -e ""
}
DOPE='\e[1;32;92m[+]\e[0m'
NOTDOPE='\e[31m[+]\e[0m'
MANUALCMD='\e[1;32;93m[+]\e[0m'
TEAL='\e[96m'
YELLOW='\e[93m'
END='\e[0m'
helpFunction() {
echo -e "${DOPE} Usage: $0 [options...] <Target-IP>"
echo " "
echo " -h, --help Show Usage and command arguments"
echo " "
echo " -t, --target Scan a single host"
echo " "
echo " -a, --all Scan The Entire Subnet!"
echo " "
echo " -H, --HTB Scan Single Target and check for .htb domains"
echo " "
echo " -f, --file Scan all hosts from a file of IP Addresses separated 1 per line"
echo " "
echo " -v, --version Show Version Information"
if [ -n "$1" ]; then
exit "$1"
fi
}
exitFunction() {
echo "ERROR: Unrecognized argument: $1" >&2
helpFunction 1
}
# Error Cases
arg=("$@")
if [ -z $1 ]; then
exitFunction
elif [ "$#" -lt 1 ]; then
exitFunction
elif [ "$#" -gt 2 ]; then
exitFunction
else
rhost=${arg[1]}
fi
SECONDS=0
validate_IP() {
if [[ $rhost =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
:
else
echo -e "\e[31m[+]\e[0m NOT A VALID IP ADDRESS"
exit 1
fi
}
# Function Definitions
getUpHosts() {
baseip=$(echo $rhost | cut -d "." -f1-3)
cidr_range=$(echo $baseip".0")
echo -e "${DOPE} Scanning Subnet..."
nmap -sn $cidr_range/24 -oG /tmp/live-hosts.txt >/dev/null
cat /tmp/live-hosts.txt | grep "Up" | cut -d " " -f2 >live-hosts-ip.txt
rm /tmp/live-hosts.txt
echo -e "${DOPE} Live Hosts Recon On $cidr_range/24 Done!"
cat live-hosts-ip.txt
}
Open_Ports_Scan() {
echo -e "${DOPE} Scanning $rhost"
create_nmap_dir() {
if [ -d nmap ]; then
:
else
mkdir -p nmap
fi
}
create_nmap_dir
create_wordlists_dir() {
if [ -d wordlists ]; then
:
else
mkdir -p wordlists
fi
}
create_wordlists_dir
create_manual_dir() {
if [ -d manual-commands ]; then
:
else
mkdir -p manual-commands
fi
}
create_manual_dir
create_web_dir() {
if [ -d WEB ]; then
:
else
mkdir -p WEB
fi
}
create_web_dir
nmap -vv -Pn -sV -T3 --max-retries 1 --max-scan-delay 20 --top-ports 10000 -oA nmap/top-ports-$rhost $rhost
grep -v "filtered" nmap/top-ports-$rhost.nmap | grep open | cut -d "/" -f 1 >top-open-ports.txt
grep -v "filtered" nmap/top-ports-$rhost.nmap | grep open >top-open-services.txt
}
Enum_Web() {
grep -v "ssl" top-open-services.txt | grep -v "proxy" | grep -v "RPC" | grep -v "(SSDP/UPnP)" | grep -E "http|BaseHTTPServer" | cut -d "/" -f 1 >httpports-$rhost.txt
if [[ -s httpports-$rhost.txt ]]; then
portfilename=httpports-$rhost.txt
# echo $portfilename
httpPortsLines=$(cat $portfilename)
cwd=$(pwd)
if grep -q "|_http-title: Did not follow redirect" nmap/http-vuln-enum-scan.nmap; then
redirect_domain=$(grep -i "|_http-title: Did not follow redirect" nmap/http-vuln-enum-scan.nmap | cut -d " " -f 7 | sed -e "s/[^/]*\/\/\([^@]*@\)\?\([^:/]*\).*/\2/")
echo -e "${DOPE} Target is redirecting to domain: $redirect_domain"
echo -e "${DOPE} Creating backup of /etc/hosts file in $cwd"
cat /etc/hosts >etc-hosts-backup
echo -e "${DOPE} Adding $redirect_domain to /etc/hosts file"
if grep -q "$rhost" /etc/hosts; then
:
else
sed -i $"3i$rhost\t$redirect_domain" /etc/hosts
fi
unset rhost
rhost=$redirect_domain
else
:
fi
for port in $httpPortsLines; do
wordlist="/usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt"
wordlist3="/usr/share/wordlists/dirbuster/directory-list-2.3-small.txt"
# wordlist2="/usr/share/seclists/Discovery/Web-Content/common.txt"
echo -e "${DOPE} Running The Following Commands"
# echo -e "${DOPE} gobuster dir -u http://$rhost:$port -w $wordlist -l -t 50 -x .html,.php,.asp,.aspx,.txt -e -k | tee gobuster-$rhost-$port.txt"
# echo -e "${DOPE} uniscan -u http://$rhost:$port/ -qweds"
echo -e "${DOPE} whatweb -v -a 3 http://$rhost:$port | tee whatweb-color-$rhost-$port.log"
whatweb -v -a 3 http://$rhost:$port | tee whatweb-color-$rhost-$port.log
# Removing color from output log
sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" whatweb-color-$rhost-$port.log >whatweb-$rhost-$port.log && rm whatweb-color-$rhost-$port.log
echo -e "${DOPE} Checking for Web Application Firewall... wafw00f http://$rhost:$port/"
wafw00f http://$rhost:$port/ | tee wafw00f-color-$rhost-$port.log
# Removing color from output log
sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" wafw00f-color-$rhost-$port.log >wafw00f-$rhost-$port.log
rm wafw00f-color-$rhost-$port.log
echo -e "${DOPE} curl -sSik http://$rhost:$port/robots.txt -m 10 -o robots-$rhost-$port.txt &>/dev/null"
curl -sSik http://$rhost:$port/robots.txt -m 10 -o robots-$rhost-$port.txt &>/dev/null
# gobuster dir -u http://$rhost:$port -w $wordlist -l -t 50 -x .html,.php,.asp,.aspx,.txt -e -k -o gobuster-$rhost-$port.txt 2>/dev/null
####################################################################################
mkdir -p eyewitness-report-"$rhost"-"$port" && cd /opt/EyeWitness
echo http://"$rhost":"$port" >eyefile.txt
echo -e "${DOPE} ./EyeWitness.py --threads 5 --ocr --no-prompt --active-scan --all-protocols --web -f eyefile.txt -d $cwd/eyewitness-report-$rhost-$port"
./EyeWitness.py --threads 5 --ocr --no-prompt --active-scan --all-protocols --web -f eyefile.txt -d $cwd/eyewitness-report-$rhost-$port
cd - &>/dev/null
##################################################################################
echo -e "${DOPE} python3 /opt/dirsearch/dirsearch.py -u http://$rhost:$port -t 80 -e php,asp,aspx,txt-x 403 -f --plain-text-report dirsearch-$rhost-$port.log"
python3 /opt/dirsearch/dirsearch.py -u http://$rhost:$port -t 80 -e php,asp,aspx,txt -x 403 -f --plain-text-report dirsearch-$rhost-$port.log
echo -e "${DOPE} python3 /opt/dirsearch/dirsearch.py -u http://$rhost:$port -t 80 -e php,asp,aspx,txt,html -w $wordlist -x 403 --plain-text-report dirsearch-dlistmedium-$rhost-$port.log"
python3 /opt/dirsearch/dirsearch.py -u http://$rhost:$port -t 80 -e php,asp,aspx,txt,html -w $wordlist -x 403 --plain-text-report dirsearch-dlistmedium-$rhost-$port.log
echo -e "${DOPE} Running nikto as a background process to speed things up."
echo -e "${DOPE} nikto -ask=no -host http://$rhost:$port >niktoscan-$rhost-$port.txt 2>&1 &"
nikto -ask=no -host http://$rhost:$port >niktoscan-$rhost-$port.txt 2>&1 &
# uniscan -u http://$rhost:$port -qweds
echo -e "${DOPE} Further Web enumeration Commands to Run: "
echo -e "${MANUALCMD} uniscan -u http://$rhost:$port -qweds" | tee -a manual-commands.txt
# echo -e "${MANUALCMD} python3 /opt/dirsearch/dirsearch.py -u http://$rhost:$port -w $wordlist -e php,asp,aspx,html,txt,js -x 403 -t 80 --plain-text-report dirsearch-dlistmedium-$rhost-$port.log" | tee -a manual-commands.txt
wp1=$(grep -i "WordPress" whatweb-$rhost-$port.log 2>/dev/null)
wp2=$(grep -i "wp-" nmap/http-vuln-enum-scan.nmap)
if [[ $wp1 ]] || [[ $wp2 ]]; then
echo -e "${DOPE} Found WordPress! Running wpscan --no-update --url http://$rhost:$port/ --wp-content-dir wp-content --enumerate vp,vt,cb,dbe,u,m --plugins-detection aggressive | tee -a wpscan-$rhost-$port.log"
wpscan --no-update --url http://$rhost:$port/ --wp-content-dir wp-content --enumerate vp,vt,cb,dbe,u,m --plugins-detection aggressive | tee wpscan-$rhost-$port.log
# echo -e "${DOPE} 1 sleeping for 5 seconds to wait for wpscan process id :)"
echo -e "${DOPE} Creating manual WordPress Brute-Force Script!"
cat >wpBrute.sh <<EOF
#!/bin/bash
if [[ -n \$(grep -i "User(s) Identified" wpscan-$rhost-$port.log) ]]; then
grep -w -A 100 "User(s)" wpscan-$rhost-$port.log | grep -w "[+]" | cut -d " " -f 2 | head -n -7 >wp-users.txt
# create wordlist from web-page with cewl
cewl http://$rhost:$port/ -m 3 -w cewl-list.txt
sleep 10
# add john rules to cewl wordlist
echo -e "${DOPE} Adding John Rules to Cewl Wordlist!"
john --rules --wordlist=cewl-list.txt --stdout >john-cool-list.txt
# brute force again with wpscan
sleep 3
wpscan --url http://$rhost:$port/ --wp-content-dir wp-login.php -U wp-users.txt -P cewl-list.txt threads 50 | tee wordpress-cewl-brute.txt
sleep 5
if grep -i "No Valid Passwords Found" wordpress-cewl-brute.txt 2>/dev/null; then
if [ -s john-cool-list.txt ]; then
wpscan --url http://$rhost:$port/ --wp-content-dir wp-login.php -U wp-users.txt -P john-cool-list.txt threads 50 | tee wordpress-john-cewl-brute.txt
else
echo "john wordlist is empty :("
fi
fi
sleep 5
if grep -i "No Valid Passwords Found" wordpress-john-cewl-brute.txt 2>/dev/null; then
wpscan --url http://$rhost:$port/ --wp-content-dir wp-login.php -U wp-users.txt -P /usr/share/wordlists/fasttrack.txt threads 50 | tee wordpress-fasttrack-brute.txt
fi
fi
EOF
chmod +x wpBrute.sh
elif grep -i "Drupal" whatweb-$rhost-$port.log 2>/dev/null; then
echo -e "${DOPE} Found Drupal! Running droopescan scan drupal -u http://$rhost -t 32 | tee drupalscan-$rhost-$port.log"
droopescan scan drupal -u http://$rhost:$port/ -t 32 | tee drupalscan-$rhost-$port.log
elif grep -i "Joomla" whatweb-$rhost-$port.log 2>/dev/null; then
echo -e "${DOPE} Found Joomla! Running joomscan --url http://$rhost/ -ec | tee joomlascan-$rhost-$port.log"
joomscan --url http://$rhost:$port/ -ec | tee joomlascan-$rhost-$port.log
elif [[ $(grep -i "WebDAV" whatweb-$rhost-$port.log 2>/dev/null) ]] || [[ $(grep -w "PUT" nmap/http-vuln-enum-scan.nmap) ]]; then
echo -e "${DOPE} Found WebDAV! Running davtest -move -sendbd auto -url http://$rhost:$port/ | tee davtestscan-$rhost-$port.log"
davtest -move -sendbd auto -url http://$rhost:$port/ | tee davtestscan-$rhost-$port.log
echo -e "${DOPE} nmap -Pn -v -sV -p $port --script=http-iis-webdav-vuln.nse -oA nmap/webdav $rhost"
nmap -Pn -v -sV -p $port --script=http-iis-webdav-vuln.nse -oA nmap/webdav $rhost
elif grep -i "tomcat" top-open-services.txt 2>/dev/null; then
grep -i "tomcat" top-open-services.txt | cut -d "/" -f 1 >current-tomcat-port.txt
tcatportFile=current-tomcat-port.txt
tcatport=$(cat $tcatportFile)
gtcatport=$(echo $tcatport)
if [[ $port -eq "$gtcatport" ]]; then
echo -e "${DOPE} Found TomCat! Running: gobuster dir -u http://$rhost:$port -w /usr/share/seclists/Discovery/Web-Content/tomcat.txt -l -t 50 -x .html,.php,.asp,.aspx,.txt,.js -e -k -o gobuster-$rhost-$port.txt"
gobuster dir -u http://$rhost:$port -w /usr/share/seclists/Discovery/Web-Content/tomcat.txt -l -t 50 -x .html,.php,.asp,.aspx,.txt,.js -e -k -o gobuster-$rhost-$port.txt
rm current-tomcat-port.txt
else
:
fi
elif grep -i "magento" whatweb-$rhost-$port.log 2>/dev/null; then
echo -e "${DOPE} Found Magento! Running /opt/magescan/bin/magescan scan:all http://$rhost/ | tee magescan-$rhost-$port.log"
cd /opt/magescan
bin/magescan scan:all http://$rhost:$port/ | tee magento-$rhost-$port.log
cd - &>/dev/null
echo -e "${MANUALCMD} Consider crawling site: python3 /opt/dirsearch/dirsearch.py -u http://$rhost:$port -w /usr/share/seclists/Discovery/Web-Content/CMS/sitemap-magento.txt -e php,asp,aspx,txt,html -t 80 -x 403,401,404,500 --plain-text-report dirsearch-magento-$rhost-$port.log" | tee -a manual-commands.txt
else
:
fi
done
if [[ -n $redirect_domain ]]; then
unset rhost
rhost=${arg[1]}
else
:
fi
fi
}
Web_Vulns() {
grep -v "ssl" top-open-services.txt | grep -v "proxy" | grep -v "RPC" | grep -v "UPnP" | grep -E "http|BaseHTTPServer" | cut -d "/" -f 1 >openports-web-$rhost.txt
if [[ -s openports-web-$rhost.txt ]]; then
echo -e "${DOPE} Running nmap http vuln-scan on all open http ports!"
nmap -vv -Pn -sC -sV -p $(tr '\n' , <openports-web-$rhost.txt) -oA nmap/http-vuln-enum-scan $rhost
fi
}
Web_Proxy_Scan() {
grep -v "ssl" top-open-services.txt | grep -E "http-proxy|Squid" | cut -d "/" -f 1 >openports-webproxies-$rhost.txt
proxyPort=$(grep -v "ssl" top-open-services.txt | grep -E "http-proxy|Squid" | cut -d "/" -f 1)
if [[ -s openports-webproxies-$rhost.txt ]]; then
echo -e "${DOPE} Found http-proxy at http://$rhost:$proxyPort"
echo -e "${DOPE} Adding proxy port to /etc/proxychains.conf"
if grep -i "$rhost" /etc/proxychains.conf; then
:
else
echo "http $rhost $proxyPort" >>/etc/proxychains.conf
fi
echo -e "${DOPE} Running NMAP scan through http proxy"
echo -e "${DOPE} proxychains nmap -vv -Pn -sV -T3 --max-retries 1 --max-scan-delay 20 --top-ports 10000 -oA nmap/proxychainScanTopPorts 127.0.0.1"
proxychains nmap -vv -sT -Pn -sV -T3 --max-retries 1 --max-scan-delay 20 --top-ports 10000 -oA nmap/proxychainScanTopPorts 127.0.0.1
grep -v "filtered" nmap/proxychainScanTopPorts.nmap | grep open | cut -d "/" -f 1 >top-proxy-open-ports.txt
grep -v "filtered" nmap/proxychainScanTopPorts.nmap | grep open >top-proxy-open-services.txt
echo -e "${DOPE} proxychains nmap -vv -sT -Pn -sC -sV -p $(tr '\n' , <top-proxy-open-ports.txt) -oA nmap/proxychainServiceScan 127.0.0.1"
proxychains nmap -vv -sT -Pn -sC -sV -p $(tr '\n' , <top-proxy-open-ports.txt) -oA nmap/proxychainServiceScan 127.0.0.1
grep -v "ssl" top-proxy-open-services.txt | grep -v "proxy" | grep -v "RPC" | grep -v "(SSDP/UPnP)" | grep -E "http|BaseHTTPServer" | cut -d "/" -f 1 >http-proxy-ports-$rhost.txt
proxyPortfilename=http-proxy-ports-$rhost.txt
httpProxyPortsLines=$(cat $proxyPortfilename)
if [[ -s http-proxy-ports-$rhost.txt ]]; then
for webPort in $httpProxyPortsLines; do
echo -e "${DOPE} whatweb -v -a 3 --proxy $rhost:$proxyPort http://127.0.0.1:$webPort/"
whatweb -v -a 3 --proxy $rhost:$proxyPort http://127.0.0.1:$webPort/ | tee whatweb-color-proxy-$rhost-$webPort.log
sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" whatweb-color-proxy-$rhost-$webPort.log >whatweb-proxy-$rhost-$webPort.log && rm whatweb-color-proxy-$rhost-$webPort.log
echo -e "${DOPE} python3 /opt/dirsearch/dirsearch.py -e php,asp,aspx,html,txt -x 403 -t 50 --proxy $rhost:$proxyPort -u http://127.0.0.1:$webPort/ --plain-text-report proxy-default-crawl-$rhost-$webPort-$proxyPort.log"
python3 /opt/dirsearch/dirsearch.py -e php,asp,aspx,txt -f -x 403 -t 50 --proxy $rhost:$proxyPort -u http://127.0.0.1:$webPort/ --plain-text-report proxy-default-crawl-$rhost-$webPort-$proxyPort.log
echo -e "${DOPE} python3 /opt/dirsearch/dirsearch.py -e php,asp,aspx,html,txt -x 403 -t 50 --proxy $rhost:$proxyPort -u http://127.0.0.1:$webPort/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt --plain-text-report proxy-dlistsmall-$rhost-$webPort-$proxyPort.log"
python3 /opt/dirsearch/dirsearch.py -e php,asp,aspx,html,txt -x 403 -t 50 --proxy $rhost:$proxyPort -u http://127.0.0.1:$webPort/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt --plain-text-report proxy-dlistsmall-$rhost-$webPort-$proxyPort.log
echo -e "${DOPE} nikto -ask=no -host http://127.0.0.1:$webPort/ -useproxy http://$rhost:$proxyPort/ -output nikto-$rhost-$webPort-scan.txt"
nikto -ask=no -host http://127.0.0.1:$webPort/ -useproxy http://$rhost:$proxyPort/ -output nikto-$rhost-$webPort-scan.txt
wp3=$(grep -i "wordpress" proxy-big-crawl-$rhost-$webPort-$proxyPort.log)
wp4=$(grep -i "wordpress" whatweb-proxy-$rhost-$webPort.log)
wordpressURL=$(grep -i "wordpress" proxy-big-crawl-$rhost-$webPort-$proxyPort.log | awk '{print $3}' | head -n 1)
if [[ $wp3 ]] || [[ $wp4 ]]; then
echo -e "${DOPE} Found WordPress!"
if [[ -n $wordpressURL ]]; then
echo -e "${DOPE} wpscan --no-update --url $wordpressURL --enumerate vp,vt,cb,dbe,u,m --plugins-detection aggressive --proxy http://$rhost:$proxyPort"
wpscan --no-update --url $wordpressURL --enumerate vp,vt,cb,dbe,u,m --plugins-detection aggressive --proxy http://$rhost:$proxyPort | tee wpscan-$rhost-$webPort-$proxyPort.log
else
echo -e "${DOPE} wpscan --no-update --url http://127.0.0.1:$webPort/ --enumerate vp,vt,cb,dbe,u,m --plugins-detection aggressive --proxy http://$rhost:$proxyPort"
wpscan --no-update --url http://127.0.0.1:$webPort/ --enumerate vp,vt,cb,dbe,u,m --plugins-detection aggressive --proxy http://$rhost:$proxyPort | tee wpscan-$rhost-$webPort-$proxyPort.log
fi
elif grep -i "Drupal" whatweb-proxy-$rhost-$webPort.log 2>/dev/null; then
echo -e "${DOPE} Found Drupal! Running droopescan scan drupal -u http://127.0.0.1:$webPort/ -t 32 | tee drupalscan-$rhost-$webPort.log"
proxychains droopescan scan drupal -u http://127.0.0.1:$webPort/ -t 32 | tee drupalscan-$rhost-$webPort.log
elif grep -i "Joomla" whatweb-proxy-$rhost-$webPort.log 2>/dev/null; then
echo -e "${DOPE} Found Joomla! Running joomscan --url http://$rhost/ -ec | tee joomlascan-$rhost-$webPort.log"
joomscan --url http://127.0.0.1:$webPort/ -ec --proxy http://$rhost:$proxyPort | tee joomlascan-$rhost-$webPort.log
elif [[ $(grep -i "WebDAV" whatweb-proxy-$rhost-$webPort.log 2>/dev/null) ]] || [[ $(grep -w "PUT" nmap/proxychainServiceScan.nmap) ]]; then
echo -e "${DOPE} Found WebDAV! Running davtest -move -sendbd auto -url http://$rhost:$webPort/ | tee davtestscan-$rhost-$webPort.log"
proxychains davtest -move -sendbd auto -url http://127.0.0.1:$webPort/ | tee davtestscan-$rhost-$webPort.log
echo -e "${DOPE} nmap -Pn -v -sV -p $webPort --script=http-iis-webdav-vuln.nse -oA nmap/webdav $rhost"
proxychains nmap -sT -Pn -v -sV -p $webPort --script=http-iis-webdav-vuln.nse -oA nmap/webdav $rhost
elif grep -i "magento" whatweb-proxy-$rhost-$webPort.log 2>/dev/null; then
echo -e "${DOPE} Found Magento! Running /opt/magescan/bin/magescan scan:all http://$rhost/ | tee magescan-$rhost-$webPort.log"
cd /opt/magescan
proxychains bin/magescan scan:all -n http://127.0.0.1:$webPort/ | tee magento-$rhost-$webPort.log
cd - &>/dev/null
echo -e "${DOPE} Consider crawling site [+]"
echo -e "${DOPE} python3 /opt/dirsearch/dirsearch.py -u http://$rhost:$webPort -w /usr/share/seclists/Discovery/Web-Content/CMS/sitemap-magento.txt -e php,asp,aspx,txt,html -t 80 -x 403,401,404,500 --plain-text-report dirsearch-magento-$rhost-$webPort.log"
else
:
fi
done
cat proxy*.log | grep -Ev "500|403|400|401|503" | awk '{print $3}' | sort -u >snProxyURLs.txt
urlProxyPorts=$(cat http-proxy-ports-$rhost.txt | tr '\n' ',')
formattedUrlProxyPorts=$(echo "${urlProxyPorts::-1}")
cat snProxyURLs.txt | aquatone -ports $formattedUrlProxyPorts -proxy http://$rhost:$proxyPort -out proxy_aquatone -screenshot-timeout 40000
rm snProxyURLs.txt
fi
fi
}
ssl_dns_enum() {
cwd=$(pwd)
echo -e "${DOPE} dig -x $rhost"
dig -x $rhost @"$rhost" | tee dig-$rhost-$port.txt
cat sslscan-$rhost-$port.log | grep "Subject" | awk '{print $2}' >domain.txt
domainName=$(grep "Subject" sslscan-$rhost-$port.log | awk '{print $2}')
altDomainNames=$(grep "Altnames" sslscan-$rhost-$port.log | grep "Altnames" | sed 's/, DNS:/ /g' | sed -n -e 's/^.*DNS://p')
if [[ -n $altDomainNames ]] && [[ -n $domainName ]]; then
echo -e "$domainName $altDomainNames" | tr ' ' '\n' >domains.txt
cp -r domains.txt domains.txt.bak
allDomains2=$(echo -e "$domainName $altDomainNames" | tr ' ' '\n')
fi
if [[ -s domain.txt ]] && [[ -s domains.txt ]]; then
wildcards=('*' '?' '|')
for wildcard in "${wildcards[@]}"; do
for dnsname in $allDomains2; do
if [[ $dnsname == *"${wildcard}"* ]]; then
domainNoWildcard=$(echo "${dnsname#'*.'}")
sed -i "s/$dnsname/$domainNoWildcard/g" domains.txt
else
:
fi
done
if [[ $domainName == *"${wildcard}"* ]]; then
domainNoWildcard=$(echo "${domainName#'*.'}")
echo -e "${DOPE} Removing wildcard from $domainName .. Setting domain to $domainNoWildcard"
unset domainName
domainName="$domainNoWildcard"
else
:
fi
done
allDomainsFile=domains.txt
loopAllDomainsFile=$(cat $allDomainsFile)
for dnsname2 in $loopAllDomainsFile; do
if [[ $dnsname2 == "$domainName" ]]; then
:
elif grep -e "$rhost.*$dnsname2" /etc/hosts; then
:
elif [[ $rhost == 127.0.0.1 ]]; then
:
elif ! grep -q "$rhost" /etc/hosts; then
sed -i $"3i$rhost\t$domainName" /etc/hosts
sed -i "/$domainName/ s/$/ $dnsname2/" /etc/hosts
else
echo -e "${DOPE} Adding $dnsname2 to /etc/hosts file"
sed -i "/$domainName/ s/$/ $dnsname2/" /etc/hosts
fi
done
for dnsname3 in $loopAllDomainsFile; do
if [[ $dnsname3 == "$domainName" ]]; then
:
else
echo -e "${MANUALCMD} Creating Manual DNS Enum Bash Script for $dnsname3"
cat >enum-$dnsname3.sh <<EOF
#!/bin/bash
echo -e "${DOPE} whatweb -v -a 3 https://$dnsname3:$port | tee whatweb-color-$dnsname3-$port.log"
whatweb -v -a 3 https://$dnsname3:$port | tee whatweb-color-$dnsname3-$port.log
sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" whatweb-color-$dnsname3-$port.log >whatweb-ssl-$dnsname3-$port.log && rm whatweb-color-$dnsname3-$port.log
curl -sSik https://$dnsname3:$port/robots.txt -m 10 -o robots-$dnsname3-$port.txt &>/dev/null
echo -e "${DOPE} python3 /opt/dirsearch/dirsearch.py -u https://$dnsname3:$port -t 80 -e php,asp,aspx,txt,html -f -x 403 --plain-text-report SSL-dirsearch-$dnsname3-$port.log"
python3 /opt/dirsearch/dirsearch.py -u https://$dnsname3:$port -t 80 -e php,asp,aspx,txt -f -x 403 --plain-text-report SSL-dirsearch-$dnsname3-$port.log
echo -e "${DOPE} python3 /opt/dirsearch/dirsearch.py -u https://$dnsname3:$port -t 80 -e php,asp,aspx,txt,html -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt -x 403 --plain-text-report SSL-dirsearch-dlistsmall-$dnsname3-$port.log"
python3 /opt/dirsearch/dirsearch.py -u https://$dnsname3:$port -t 80 -e php,asp,aspx,txt,html -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt -x 403 --plain-text-report SSL-dirsearch-dlistsmall-$dnsname3-$port.log
echo -e "${DOPE} Running nikto as a background process to speed things up"
echo -e "${DOPE} nikto -ask=no -host https://$dnsname3:$port -ssl >niktoscan-$dnsname3-$port.txt 2>&1 &"
nikto -ask=no -host https://$dnsname3:$port -ssl >niktoscan-$dnsname3-$port.txt 2>&1 &
echo -e "${DOPE} gobuster dns -d $dnsname3 -w /usr/share/seclists/Discovery/DNS/subdomains-top1mil-5000.txt -t 80 -o gobust-$dnsname3.log"
gobuster dns -d $dnsname3 -w /usr/share/seclists/Discovery/DNS/subdomains-top1mil-5000.txt -t 80 -o gobust-$dnsname3.log
EOF
chmod +x enum-$dnsname3.sh
fi
done
elif [[ -s domain.txt ]] && [[ ! -s domains.txt ]]; then
wildcards=('*' '?' '|')
for wildcard in "${wildcards[@]}"; do
if [[ $domainName == *"${wildcard}"* ]]; then
domainNoWildcard=$(echo "${domainName#'*.'}")
echo -e "${DOPE} Removing wildcard from $domainName .. Setting domain to $domainNoWildcard"
unset domainName
domainName="$domainNoWildcard"
else
:
fi
done
fi
if [[ -s domain.txt ]] && [[ -n $domainName ]] && [[ $domainName != "localhost" ]]; then
set -- $domainName
echo -e "${DOPE} Target has domain: $domainName"
echo -e "${DOPE} Creating backup of /etc/hosts file in $cwd"
cat /etc/hosts >etc-hosts-backup2.txt
if [[ $rhost == 127.0.0.1 ]]; then
:
elif grep -e "$rhost.*$domainName" /etc/hosts; then
:
else
echo -e "${DOPE} Adding $domainName to /etc/hosts file"
sed -i $"3i$rhost\t$domainName" /etc/hosts
fi
echo -e "${DOPE} Checking for Zone Transfer on $rhost:$port $domainName"
echo -e "${DOPE} dig axfr @$rhost $domainName"
dig axfr @$rhost $domainName | tee zone-transfer-$rhost-$port-$domainName.txt
if grep -q "$domainName" zone-transfer-$rhost-$port-$domainName.txt; then
grep -v ";" zone-transfer-$rhost-$port-$domainName.txt | grep -v -e '^[[:space:]]*$' >filtered-zone-transfer-$rhost-$port-$domainName.txt
allDomains=$(cat filtered-zone-transfer-$rhost-$port-$domainName.txt | awk '{print $1}')
domainDot=$(echo $domainName".")
for dmain in $allDomains; do
if [[ $domainDot == "$dmain" ]]; then
:
else
dmainMinusDot=$(echo "${dmain:0:-1}")
if grep -q "$dmainMinusDot" /etc/hosts; then
:
elif [[ $rhost == 127.0.0.1 ]]; then
:
else
sed -i "/$domainName/ s/$/ $dmainMinusDot/" /etc/hosts
fi
fi
done
echo -e "${YELLOW}#################################################################################################### ${END}"
cat /etc/hosts
fi
curl -sSik https://$rhost:$port -m 10 -o homepage-source.html &>/dev/null
sed -n 's/.*href="\([^"]*\).*/\1/p' homepage-source.html >links.txt
cat links.txt | sed -e "s/[^/]*\/\/\([^@]*@\)\?\([^:/]*\).*/\2/" >urls.txt
urlsList=urls.txt
loopUrlsList=$(cat $urlsList)
if [[ -s urls.txt ]]; then
for url in $loopUrlsList; do
if [[ $url == *".htb" ]]; then
echo "${DOPE} found .htb domain: $url "
if grep -e "$rhost.*$domainName" /etc/hosts; then
if grep -q "$url" /etc/hosts; then
:
else
echo "${DOPE} Adding $url to /etc/hosts file"
sed -i "/$domainName/ s/$/ $url/" /etc/hosts
fi
else
:
fi
else
:
fi
done
echo -e "${YELLOW}#################################################################################################### ${END}"
cat /etc/hosts
fi
if [[ $domainName == *".htb"* ]]; then
if [[ $(grep "domain" top-open-services.txt) ]] || [[ $(grep -w "53" top-open-ports.txt) ]]; then
echo -e "${DOPE} dnsrecon -d $domainName"
dnsrecon -d $domainName | tee dnsrecon-$rhost-$domainName.log
echo -e "${DOPE} dnsenum --dnsserver $rhost --enum -f /usr/share/seclists/Discovery/DNS/subdomains-top1mil-5000.txt -r $domainName"
dnsenum --dnsserver $rhost --enum -f /usr/share/seclists/Discovery/DNS/subdomains-top1mil-5000.txt -r $domainName | tee dnsenum-$rhost-$domainName.log
fi
echo -e "${DOPE} gobuster dns -d $domainName -w /usr/share/seclists/Discovery/DNS/subdomains-top1mil-5000.txt -t 80 -o gobust-$domainName.log"
gobuster dns -d $domainName -w /usr/share/seclists/Discovery/DNS/subdomains-top1mil-5000.txt -t 80 -o gobust-$domainName.log
echo -e "${MANUALCMD} wfuzz -c -w /usr/share/seclists/Discovery/DNS/subdomains-top1mil-5000.txt -u $domainName -H 'Host: FUZZ.$domainName' " | tee -a manual-commands.txt
# wfuzz -c -w /usr/share/seclists/Discovery/DNS/subdomains-top1mil-5000.txt -u $domainName -H "Host: FUZZ.$domainName" --hw 717 --hc 404 -o raw | tee wfuzz-dns-$domainName.txt
else
echo -e "${DOPE} Running DNS Enumeration on $domainName"
echo -e "${DOPE} dnsrecon -d $domainName | tee dnsrecon-$rhost-$domainName.log"
dnsrecon -d $domainName | tee dnsrecon-$rhost-$domainName.log
reconDir=$(echo $cwd)
echo -e "${DOPE} sublist3r.py -d $domainName -o $reconDir/subdomains-$rhost-$port-$domainName.log"
cd /opt/Sublist3r && python3 sublist3r.py -d $domainName -o $reconDir/subdomains-$rhost-$port-$domainName.log
cd - &>/dev/null
echo -e "${DOPE} subfinder -d $domainName -o "$domainName"-subfinder.log"
subfinder -d $domainName -o "$domainName"-subfinder.log
echo -e "${DOPE} gobuster dns -d $domainName -w /usr/share/seclists/Discovery/DNS/sortedcombined-knock-dnsrecon-fierce-reconng.txt -t 80 -o gobust-$domainName.log"
gobuster dns -d $domainName -w /usr/share/seclists/Discovery/DNS/sortedcombined-knock-dnsrecon-fierce-reconng.txt -t 80 -o gobust-$domainName.log
fi
fi
if [[ -n "$domainName" ]] && [[ $domainName != "localhost" ]]; then
unset rhost
rhost=$domainName
else
:
fi
}
Enum_Web_SSL() {
grep -E 'https|ssl/http|ssl/unknown' top-open-services.txt | cut -d "/" -f 1 >openportsSSL-$rhost.txt
if [[ -s openportsSSL-$rhost.txt ]]; then
portfilenameSSL=openportsSSL-$rhost.txt
# echo $portfilenameSSL
httpPortsLinesSSL=$(cat $portfilenameSSL)
cwd=$(pwd)
for port in $httpPortsLinesSSL; do
set -- $port
wordlist="/usr/share/seclists/Discovery/Web-Content/common.txt"
wordlist2="/usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt"
wordlist4="/usr/share/wordlists/dirbuster/directory-list-2.3-small.txt"
echo -e "${DOPE} Running The Following Commands"
echo -e "${DOPE} sslscan https://$rhost:$port | tee sslscan-$rhost-$port.log"
sslscan https://$rhost:$port | tee sslscan-color-$rhost-$port.log
sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" sslscan-color-$rhost-$port.log >sslscan-$rhost-$port.log
rm sslscan-color-$rhost-$port.log
ssl_dns_enum
echo -e "${DOPE} whatweb -v -a 3 https://$rhost:$port | tee whatweb-color-$rhost-$port.log"
whatweb -v -a 3 https://$rhost:$port | tee whatweb-color-$rhost-$port.log
# Removing color from output log
sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" whatweb-color-$rhost-$port.log >whatweb-ssl-$rhost-$port.log && rm whatweb-color-$rhost-$port.log
echo -e "${DOPE} Checking for Web Application Firewall... wafw00f https://$rhost:$port/"
wafw00f https://$rhost:$port/ | tee wafw00f-color-$rhost-$port.log
sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" wafw00f-color-$rhost-$port.log >wafw00f-$rhost-$port.log
rm wafw00f-color-$rhost-$port.log
echo -e "${DOPE} curl -sSik https://$rhost:$port/robots.txt -m 10 -o robots-$rhost-$port.txt"
curl -sSik https://$rhost:$port/robots.txt -m 10 -o robots-$rhost-$port.txt &>/dev/null
############## EYE-WITNESS ##########################################
mkdir -p eyewitness-report-"$rhost"-"$port" && cd /opt/EyeWitness
echo https://"$rhost":"$port" >eyefile.txt
echo -e "${DOPE} ./EyeWitness.py --threads 5 --ocr --no-prompt --active-scan --all-protocols --web -f eyefile.txt -d $cwd/eyewitness-report-$rhost-$port"
./EyeWitness.py --threads 5 --ocr --no-prompt --active-scan --all-protocols --web -f eyefile.txt -d $cwd/eyewitness-report-$rhost-$port
cd - &>/dev/null
echo -e "${DOPE} python3 /opt/dirsearch/dirsearch.py -u https://$rhost:$port -t 80 -e php,asp,aspx,txt,html -f -x 403 --plain-text-report SSL-dirsearch-$rhost-$port.log"
python3 /opt/dirsearch/dirsearch.py -u https://$rhost:$port -t 80 -e php,asp,aspx,txt -f -x 403 --plain-text-report SSL-dirsearch-$rhost-$port.log
echo -e "${DOPE} python3 /opt/dirsearch/dirsearch.py -u https://$rhost:$port -t 80 -e php,asp,aspx,txt,html -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x 403 --plain-text-report SSL-dirsearch-dlistmedium-$rhost-$port.log"
python3 /opt/dirsearch/dirsearch.py -u https://$rhost:$port -t 80 -e php,asp,aspx,txt,html -w $wordlist2 -x 403 --plain-text-report SSL-dirsearch-dlistmedium-$rhost-$port.log
echo -e "${DOPE} Running nikto as a background process to speed things up"
echo -e "${DOPE} nikto -ask=no -host https://$rhost:$port -ssl >niktoscan-$rhost-$port.txt 2>&1 &"
nikto -ask=no -host https://$rhost:$port -ssl >niktoscan-$rhost-$port.txt 2>&1 &
# uniscan -u https://$rhost:$port -qweds
echo -e "${DOPE} Further Web enumeration Commands to Run: "
echo -e "${MANUALCMD} uniscan -u https://$rhost:$port -qweds" | tee -a manual-commands.txt
# echo -e "${MANUALCMD} gobuster dir -u https://$rhost:$port -w $wordlist2 -l -t 80 -x .html,.php,.asp,.aspx,.txt -e -k" | tee -a manual-commands.txt
if [ $(grep -i "WordPress" whatweb-ssl-$rhost-$port.log 2>/dev/null) ]; then
echo -e "${DOPE} Found WordPress! Running wpscan --no-update --disable-tls-checks --url https://$rhost:$port/ --wp-content-dir wp-content --enumerate vp,vt,cb,dbe,u,m --plugins-detection aggressive | tee wpscan2-$rhost-$port.log"
wpscan --no-update --disable-tls-checks --url https://$rhost:$port/ --wp-content-dir wp-content --enumerate vp,vt,cb,dbe,u,m --plugins-detection aggressive | tee wpscan2-$rhost-$port.log
sleep 1
echo -e "${DOPE} Creating manual brute force script!"
cat >wordpressBrute.sh <<EOF
#!/bin/bash
if [[ -n \$(grep -i "User(s) Identified" wpscan2-$rhost-$port.log) ]]; then
grep -w -A 100 "User(s)" wpscan2-$rhost-$port.log | grep -w "[+]" | cut -d " " -f 2 | head -n -7 >wp-users2.txt
# create wordlist from web-page with cewl
cewl https://$rhost:$port/ -m 3 -w cewl-list2.txt
sleep 10
# add john rules to cewl wordlist
echo "Adding John Rules to Cewl Wordlist!"
john --rules --wordlist=cewl-list2.txt --stdout >john-cool-list2.txt
sleep 3
# brute force again with wpscan
wpscan --no-update --disable-tls-checks --url https://$rhost:$port/ --wp-content-dir wp-login.php -U wp-users2.txt -P cewl-list.txt threads 50 | tee wordpress-cewl-brute2.txt
sleep 1
if grep -i "No Valid Passwords Found" wordpress-cewl-brute2.txt; then
if [ -s john-cool-list2.txt ]; then
wpscan --no-update --disable-tls-checks --url https://$rhost:$port/ --wp-content-dir wp-login.php -U wp-users2.txt -P john-cool-list2.txt threads 50 | tee wordpress-john-cewl-brute2.txt
else
echo "John wordlist is empty :("
fi
# if password not found then run it again with fasttrack.txt
sleep 1
if grep -i "No Valid Passwords Found" wordpress-john-cewl-brute2.txt; then
wpscan --no-update --disable-tls-checks --url https://$rhost:$port/ --wp-content-dir wp-login.php -U wp-users2.txt -P /usr/share/wordlists/fasttrack.txt threads 50 | tee wordpress-fasttrack-brute2.txt
fi
fi
fi
EOF
chmod +x wordpressBrute.sh
elif grep -i "Drupal" whatweb-ssl-$rhost-$port.log 2>/dev/null; then
echo -e "${DOPE} Found Drupal! Running droopescan scan drupal -u https://$rhost -t 32 | tee drupalscan-$rhost-$port.log"
droopescan scan drupal -u https://$rhost:$port/ -t 32 | tee -a drupalscan.log
elif grep -i "Joomla" whatweb-ssl-$rhost-$port.log 2>/dev/null; then
echo -e "${DOPE} Found Joomla! Running joomscan --url https://$rhost/ -ec | tee joomlascan-$rhost-$port.log"
joomscan --url https://$rhost:$port/ -ec | tee -a joomlascan-$rhost-$port.log
elif grep -i "WebDAV" whatweb-ssl-$rhost-$port.log 2>/dev/null; then
echo -e "${DOPE} Found WebDAV! Running davtest -move -sendbd auto -url https://$rhost:$port/ | tee davtestscan-$rhost-$port.log"
davtest -move -sendbd auto -url https://$rhost:$port/ | tee -a davtestscan-$rhost-$port.log
elif grep -i "magento" whatweb-ssl-$rhost-$port.log 2>/dev/null; then
echo -e "${DOPE} Found Magento! Running /opt/magescan/bin/magescan scan:all --insecure https://$rhost/ | tee magescan-$rhost-$port.log"
cd /opt/magescan
bin/magescan scan:all -n --insecure https://$rhost:$port/ | tee magento-$rhost-$port.log
cd - &>/dev/null
echo -e "${DOPE} Consider crawling site: python3 /opt/dirsearch/dirsearch.py -u https://$rhost:$port -w /usr/share/seclists/Discovery/Web-Content/CMS/sitemap-magento.txt -e php,asp,aspx,txt,html -t 80 -x 403,401,404,500 --plain-text-report dirsearch-magento-$rhost-$port.log"
else
:
fi
done
if [[ -n $redirect_domain ]]; then
unset rhost
rhost=${arg[1]}
elif [[ -n $domainName ]]; then
unset rhost
rhost=${arg[1]}
else
:
fi
if [[ -s domains.txt ]]; then
urldomains2=$(cat domains.txt)
for urldomain2 in $urldomains2; do
echo "https://$urldomain2" >>aquaurls2.txt
done
fi
if [[ -s aquaurls2.txt ]]; then
urlSSLPorts2=$(cat openportsSSL-$rhost.txt | tr '\n' ',')
formattedSSLUrlPorts2=$(echo "${urlSSLPorts2::-1}")
cat aquaurls2.txt | sort -u | aquatone -ports $formattedSSLUrlPorts2 -out dns_aquatone
fi
fi
}
ftp_scan() {
grep -w "ftp" top-open-services.txt | cut -d "/" -f 1 >openportsFTP-$rhost.txt
portfilenameFTP=openportsFTP-$rhost.txt
# echo $portfilenameSSL
PortsLinesFTP=$(cat $portfilenameFTP)
if [[ -s openportsFTP-$rhost.txt ]]; then
for ftp_port in $PortsLinesFTP; do
echo -e "${DOPE} Running nmap ftp script scan on port: $ftp_port"
nmap -sV -Pn -p $ftp_port --script=ftp-anon,ftp-bounce,ftp-libopie,ftp-proftpd-backdoor,ftp-vsftpd-backdoor,ftp-vuln-cve2010-4221,ftp-syst -v -oA nmap/ftp-enum $rhost
done
fi
}
smtp_enum() {
grep -i "smtp" top-open-services.txt | cut -d "/" -f 1 >openportsSMTP-$rhost.txt
portfilenameSMTP=openportsSMTP-$rhost.txt
# echo $portfilenameSSL
PortsLinesSMTP=$(cat $portfilenameSMTP)
if [[ -s openportsSMTP-$rhost.txt ]]; then
for smtp_port in $PortsLinesSMTP; do
echo -e "${DOPE} Found SMTP! ENUMERATING USERS"
echo -e "${DOPE} smtp-user-enum -M VRFY -U /usr/share/metasploit-framework/data/wordlists/unix_users.txt -t $rhost -p $smtp_port 2>&1 | tee smtp-users-$rhost-$smtp_port.log"
smtp-user-enum -M VRFY -U /usr/share/metasploit-framework/data/wordlists/unix_users.txt -t $rhost -p $smtp_port 2>&1 | tee smtp-users-$rhost-$smtp_port.log
done
fi
}
rpc_enum() {
if [[ $(grep -E "msrpc|rpcbind|erpc" top-open-services.txt) ]]; then
if [[ ! -s smb-scan-$rhost.log ]]; then
echo -e "${DOPE} Found RPC!" | tee -a rpc-color-scan-$rhost.log
echo -e "${DOPE} enum4linux -av $rhost" | tee -a rpc-color-scan-$rhost.log
enum4linux -av $rhost | tee -a rpc-color-scan-$rhost.log
sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" rpc-color-scan-$rhost.log >rpc-scan-$rhost.log
if type -p impacket-rpcdump >/dev/null; then
echo -e "${DOPE} impacket-rpcdump @$rhost"
impacket-rpcdump @$rhost >>rpc-scan-$rhost.log
fi
rm rpc-color-scan-$rhost.log
fi
fi
}
ldap_enum() {
if [[ $(grep -w "ldap" top-open-services.txt) ]] || [[ $(grep -w "389" top-open-ports.txt) ]]; then
echo -e "${DOPE} Found LDAP! Running nmap ldap scripts"
echo -e "${DOPE} nmap -vv -Pn -sV -p 389 --script='(ldap* or ssl*) and not (brute or broadcast or dos or external or fuzzer)' -oA nmap/ldap-$rhost $rhost"
nmap -vv -Pn -sV -p 389 --script='(ldap* or ssl*) and not (brute or broadcast or dos or external or fuzzer)' -oA nmap/ldap-$rhost $rhost
echo -e "${DOPE} ldapsearch -x -h $rhost -s base namingcontexts"
ldapsearch -x -h $rhost -s base namingcontexts | tee ldap-namingcontexts-$rhost.log
dcList=$(sed -n -e 's/^.*namingContexts: //p' ldap-namingcontexts-$rhost.log)
# dcList=$(sed -n -e 's/^.*namingContexts: //p' ldap-namingcontexts-$rhost.log | tr ',' '\n' | cut -d '=' -f 2)
echo -e "${DOPE} ldapsearch -x -h $rhost -s base -b $dcList"
ldapsearch -x -h $rhost -s base -b $dcList | tee ldap-base-$rhost.log
echo -e "${DOPE} ldapsearch -x -h $rhost -s sub -b $dcList"
ldapsearch -x -h $rhost -s sub -b $dcList | tee ldap-sub-$rhost.log
ldapUserNames=$(sed -n -e 's/^.*uid=//p' nmap/ldap-$rhost.nmap | cut -d ',' -f 1)
sambaNTPassword=$(sed -n -e 's/^.*sambaNTPassword: //p' nmap/ldap-$rhost.nmap)
ldapUserPasswords=$(sed -n -e 's/^.*userPassword: //p' nmap/ldap-$rhost.nmap)
sortUsers() {
for user in $ldapUserNames; do
if [[ -n $sambaNTPassword ]]; then
if (($(grep -c . <<<"$sambaNTPassword") > 1)); then
for hash in $sambaNTPassword; do
echo -e "${DOPE} smbmap -u $user -p "$hash:$hash" -H $rhost -R"
smbmap -u $user -p "$hash:$hash" -H $rhost -R
done
else
echo -e "${DOPE} smbmap -u $user -p "$sambaNTPassword:$sambaNTPassword" -H $rhost -R"
smbmap -u $user -p "$sambaNTPassword:$sambaNTPassword" -H $rhost -R
fi
fi
done
}
sortUsers
if [[ ! -s smb-scan-$rhost.log ]]; then
echo -e "${DOPE} Found LDAP! Running Enum4Linux"
enum4linux -a -l -v $rhost | tee ldapenum-$rhost.txt
fi
fi
if ! grep -q "389" top-open-ports.txt; then
grep -v "filtered" nmap/udp-$rhost.nmap | grep "open" | cut -d "/" -f 1 >udp-scan2-$rhost.txt
if grep -q "137" udp-scan2-$rhost.txt; then
if [[ ! -s smb-scan-$rhost.log ]]; then
echo -e "${DOPE} Found LDAP UDP port! Running Enum4Linux"
enum4linux -a -M -l -d $rhost | tee ldapenum-$rhost.txt
rm udp-scan2-$rhost.txt
fi
else
rm udp-scan2-$rhost.txt
fi
fi
}
cups_enum() {
if [[ $(grep -w "ipp" top-open-services.txt) ]] || [[ $(grep -w "631" top-open-ports.txt) ]]; then
echo -e "${DOPE} Found ipp cups Running nmap command:"
echo -e "${DOPE} nmap -v -sV -Pn --script=cups-info.nse,cups-queue-info.nse -p 631 -oA nmap/cups-enum-$rhost $rhost"
nmap -v -sV -Pn --script=cups-info.nse,cups-queue-info.nse -p 631 -oA nmap/cups-enum-$rhost $rhost
fi
}
nfs_enum() {
grep -w "rpcbind" top-open-services.txt | cut -d "/" -f 1 >openports-nfs.txt
if grep -q "111" openports-nfs.txt; then
echo -e "${DOPE} nmap -v -sV -Pn -p 111 --script=nfs-ls.nse,nfs-statfs.nse,nfs-showmount.nse -oA nmap/nfs-$rhost $rhost"
nmap -v -sV -Pn -p 111 --script=nfs-ls.nse,nfs-statfs.nse,nfs-showmount.nse -oA nmap/nfs-$rhost $rhost
showmount -e $rhost 2>&1 | tee nfs-showmount-$rhost.txt
fi
}
java_rmi_scan() {
if [[ $(grep -w "rmiregistry" top-open-services.txt) ]] || [[ $(grep -w "1099" top-open-ports.txt) ]]; then
echo -e "${DOPE} Found Java-Rmi-Registry! Running nmap command:"
echo -e "${DOPE} nmap -v -sV -Pn --script=rmi-vuln-classloader.nse -p 1099 -oA nmap/java-rmi-$rhost $rhost"
nmap -v -sV -Pn --script=rmi-vuln-classloader.nse -p 1099 -oA nmap/java-rmi-$rhost $rhost
fi
if [[ $(grep -w "java-rmi" top-open-services.txt) ]] || [[ $(grep -w "1100" top-open-ports.txt) ]]; then
echo -e "${DOPE} Found Java-RMI! Running nmap command:"
echo -e "${DOPE} nmap -v -sV -Pn --script=rmi-vuln-classloader.nse -p 1099 -oA nmap/java-rmi-$rhost $rhost"
nmap -v -sV -Pn --script=rmi-dumpregistry.nse -p 1099 -oA nmap/java-rmi-dump-$rhost $rhost
fi
}
Intense_Nmap_UDP_Scan() {
printf "\e[93m################### RUNNING NMAP TOP UDP PORTS ##################################################### \e[0m\n"
echo -e "${DOPE} nmap -sUV -v --reason -T4 --max-retries 3 --max-rtt-timeout 150ms -pU:53,67-69,111,123,135,137-139,161-162,445,500,514,520,631,998,1434,1701,1900,4500,5353,49152,49154 -oA nmap/udp-$rhost $rhost"
nmap -sUV -v --reason -T4 --max-retries 3 --max-rtt-timeout 150ms -pU:53,67-69,111,123,135,137-139,161-162,445,500,514,520,631,998,1434,1701,1900,4500,5353,49152,49154 -oA nmap/udp-$rhost $rhost
}
Enum_SMB() {
if [[ $(grep -i "netbios-ssn" top-open-services.txt) ]] || [[ $(grep -i "microsoft-ds" top-open-services.txt) ]]; then
echo -e "${DOPE} Found Samba!" | tee -a smb-color-scan-$rhost.log
echo -e "${DOPE} Running SMBCLIENT, Checking shares" | tee -a smb-color-scan-$rhost.log
echo -e "${DOPE} smbclient -L //$rhost -U 'guest'%" | tee -a smb-color-scan-$rhost.log
smbclient -L //$rhost -U "guest"% | tee -a smb-color-scan-$rhost.log
echo -e "${DOPE} Running ENUM4LINUX" | tee -a smb-color-scan-$rhost.log
echo -e "${DOPE} enum4linux -av $rhost" | tee -a smb-color-scan-$rhost.log
enum4linux -av $rhost | tee -a smb-color-scan-$rhost.log
echo -e "${DOPE} Running NMBLOOKUP" | tee -a smb-color-scan-$rhost.log
echo -e "${DOPE} nmblookup -A $rhost" | tee -a smb-color-scan-$rhost.log
nmblookup -A $rhost | tee -a smb-color-scan-$rhost.log
echo -e "${DOPE} Running All SMB nmap Vuln / Enum checks" | tee -a smb-color-scan-$rhost.log
echo -e "${DOPE} nmap -vv -sV -Pn -p139,445 --script smb-enum-domains.nse,smb-enum-groups.nse,smb-enum-processes.nse,smb-enum-sessions.nse,smb-enum-shares.nse,smb-enum-users.nse,smb-ls.nse,smb-mbenum.nse,smb-os-discovery.nse,smb-print-text.nse,smb-psexec.nse,smb-security-mode.nse,smb-server-stats.nse,smb-system-info.nse,smb-vuln-conficker.nse,smb-vuln-cve2009-3103.nse,smb-vuln-ms06-025.nse,smb-vuln-ms07-029.nse,smb-vuln-ms08-067.nse,smb-vuln-ms10-054.nse,smb-vuln-ms10-061.nse,smb-vuln-ms17-010.nse --script-args=unsafe=1 -oA nmap/smbvulns-$rhost $rhost" | tee -a smb-color-scan-$rhost.log
nmap -vv -sV -Pn -p139,445 --script smb-enum-domains.nse,smb-enum-groups.nse,smb-enum-processes.nse,smb-enum-sessions.nse,smb-enum-shares.nse,smb-enum-users.nse,smb-ls.nse,smb-mbenum.nse,smb-os-discovery.nse,smb-print-text.nse,smb-psexec.nse,smb-security-mode.nse,smb-server-stats.nse,smb-system-info.nse,smb-vuln-conficker.nse,smb-vuln-cve2009-3103.nse,smb-vuln-ms06-025.nse,smb-vuln-ms07-029.nse,smb-vuln-ms08-067.nse,smb-vuln-ms10-054.nse,smb-vuln-ms10-061.nse,smb-vuln-ms17-010.nse --script-args=unsafe=1 -oA nmap/smbvulns-$rhost $rhost | tee -a smb-color-scan-$rhost.log
echo -e "${DOPE} Running NBTSCAN" | tee -a smb-color-scan-$rhost.log
echo -e "${DOPE} nbtscan -rvh $rhost" | tee -a smb-color-scan-$rhost.log
nbtscan -rvh $rhost | tee -a smb-color-scan-$rhost.log
echo -e "${DOPE} Running smbmap" | tee -a smb-color-scan-$rhost.log
echo -e "${DOPE} smbmap -H $rhost" | tee -a smb-color-scan-$rhost.log
smbmap -H $rhost | tee -a smb-color-scan-$rhost.log
echo -e "${DOPE} smbmap -H $rhost -R" | tee -a smb-color-scan-$rhost.log
smbmap -H $rhost -R | tee -a smb-color-scan-$rhost.log
echo -e "${DOPE} smbmap -u null -p '' -H $rhost" | tee -a smb-color-scan-$rhost.log
smbmap -u null -p "" -H $rhost | tee -a smb-color-scan-$rhost.log
echo -e "${DOPE} smbmap -u null -p '' -H $rhost -R" | tee -a smb-color-scan-$rhost.log
smbmap -u null -p "" -H $rhost -R | tee -a smb-color-scan-$rhost.log
echo -e "${DOPE} All checks completed Successfully" | tee -a smb-color-scan-$rhost.log
sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" smb-color-scan-$rhost.log >smb-scan-$rhost.log
rm smb-color-scan-$rhost.log
fi
}
Enum_SNMP() {
cwd=$(pwd)
# echo $cwd
cd $cwd
if grep -q "199" top-open-ports.txt; then
printf "\e[93m################### RUNNING SNMP-ENUMERATION ################################################################# \e[0m\n"
echo -e "${DOPE} Running: onesixtyone -c /usr/share/doc/onesixtyone/dict.txt $rhost | tee -a snmpenum-$rhost.log "
onesixtyone -c /usr/share/doc/onesixtyone/dict.txt $rhost | tee -a snmpenum-$rhost.log
echo -e "${DOPE} Running: snmp-check -c public -v 1 -d $rhost | tee -a snmpenum-$rhost.log "
# echo -e "${DOPE} Running: snmp-check -c public -v 2 -d $rhost | tee -a snmpenum-scan.log "
snmp-check -c public -v 1 -d $rhost | tee -a snmpenum-$rhost.log
# apt install snmp-mibs-downloader # then comment out mibs : in /etc/snmp/snmp.conf
if grep -q "timeout" snmpenum-$rhost.log; then
echo -e "${DOPE} SNMP version 1 timed-out. Trying version 2."
echo -e "${DOPE} snmpwalk -c public -v2c $rhost | tee -a snmpenum-$rhost.log"
snmpwalk -c public -v2c $rhost | tee -a snmpenum-$rhost.log
else
:
fi
fi
if ! grep -q "199" top-open-ports.txt; then
grep -v "filtered" nmap/udp-$rhost.nmap | grep "open" | cut -d "/" -f 1 >udp-scan-$rhost.txt
if grep -q "161" udp-scan-$rhost.txt; then
printf "\e[93m################### RUNNING SNMP-ENUMERATION ############################################################# \e[0m\n"
echo -e "${DOPE} Running: onesixtyone -c /usr/share/doc/onesixtyone/dict.txt $rhost | tee -a snmpenum-$rhost.log "
onesixtyone -c /usr/share/doc/onesixtyone/dict.txt $rhost | tee -a snmpenum-$rhost.log
echo -e "${DOPE} Running: snmp-check -c public -v 1 -d $rhost | tee -a snmpenum-$rhost.log "
# echo -e "${DOPE} Running: snmp-check -c public -v 2 -d $rhost | tee -a snmpenum-scan.log "
snmp-check -c public -v 1 -d $rhost | tee -a snmpenum-$rhost.log
# apt install snmp-mibs-downloader # then comment out mibs : in /etc/snmp/snmp.conf
lines_output=$(cat snmpenum-$rhost.log | wc -l)
if [[ $(grep -i "timeout" snmpenum-$rhost.log) ]] || [[ $lines_output -lt 40 ]]; then
echo -e "${DOPE} SNMP version 1 timed-out or didn't output enough information. Trying version 2."
echo -e "${DOPE} snmpwalk -c public -v2c $rhost | tee -a snmpenum-$rhost.log"
snmpwalk -c public -v2c $rhost | tee -a snmpenum-$rhost.log
else
:
fi
fi
fi
}
FULL_TCP_GOOD_MEASUERE_VULN_SCAN() {
cwd=$(pwd)
echo -e "${DOPE} Running Full Nmap TCP port Scan"
echo -e "${DOPE} nmap -vv -Pn -A -p- -T4 --script-timeout 2m -oA nmap/full-tcp-scan-$rhost $rhost"
nmap -vv -Pn -A -p- -T4 --script-timeout 2m -oA nmap/full-tcp-scan-$rhost $rhost
echo -e "${YELLOW}#################################################################################################### ${END}"
echo -e "${TEAL}########################### Checking Vulnerabilities ############################################## ${END}"
echo -e "${YELLOW}#################################################################################################### ${END}"
cd /opt/ReconScan && python3 vulnscan.py $cwd/nmap/full-tcp-scan-$rhost.xml
cd - &>/dev/null
}
dnsCheckHTB() {
if grep -q ".htb" nmap/full-tcp-scan-$rhost.nmap; then
htbdomains=$(grep "htb" nmap/full-tcp-scan-"$rhost".nmap | sed -n -e "s/^.*commonName=//p" | cut -d "/" -f 1 | sort -u)
htbdomains2=$(grep "htb" nmap/full-tcp-scan-"$rhost".nmap | sed -n -e "s/^.*Name: //p" | sort -u)
htbdomains8=$(sed -n -e 's/^.*Domain: //p' nmap/full-tcp-scan-"$rhost".nmap | cut -d ',' -f 1 | sort -u)
htbdomains3=$(grep "htb" nmap/full-tcp-scan-"$rhost".nmap | sed 's/^.*| Subject Alternative Name: //p' | sed 's/, DNS:/ /g' | sed -n -e 's/^.*DNS://p' | sort -u)
htbdomains6=$(grep -i ".htb" nmap/full-tcp-scan-"$rhost".nmap | grep -v "SF" | sed -n -e "s/^.*http://p" | sed -e "s/[^/]*\/\/\([^@]*@\)\?\([^:/]*\).*/\2/" | sort -u)
htbdomains4=$(echo -e "$htbdomains\n$htbdomains2\n$htbdomains3\n$htbdomains6\n$htbdomains8" | grep -v "DNS:" | tr ' ' '\n')
for htbdomain in $htbdomains4; do
if [[ -n $htbdomain ]] && [[ $htbdomain == *"htb"* ]]; then
if [[ $htbdomain == *"www."* ]]; then
echo $htbdomain >/tmp/www-$htbdomain.txt
wwwRemoved=$(sed -n -e 's/^.*www.//p' /tmp/www-$htbdomain.txt)
if grep -q "$rhost" /etc/hosts; then
if [[ $rhost == 127.0.0.1 ]]; then
:
elif grep -e "$rhost.*$wwwRemoved" /etc/hosts; then
:
else
echo -e "${DOPE} adding $wwwRemoved to hosts file"
sed -i $"/$rhost/ s/$/\t$wwwRemoved/" /etc/hosts
fi
else
echo -e "${DOPE} adding $wwwRemoved to hosts file"
sed -i $"3i$rhost\t$wwwRemoved" /etc/hosts
fi
fi
if grep -q "$rhost" /etc/hosts; then
if [[ $rhost == 127.0.0.1 ]]; then
:
elif grep -e "$rhost.*$htbdomain" /etc/hosts; then
:
else
echo -e "${DOPE} adding $htbdomain to hosts file"
sed -i $"/$rhost/ s/$/\t$htbdomain/" /etc/hosts
fi
else
sed -i $"3i$rhost\t$htbdomain" /etc/hosts
fi
fi
done
fi
portfilename=httpports-$rhost.txt
httpPortsLines2=$(cat $portfilename)
if [[ -s httpports-$rhost.txt ]]; then
for port1 in $httpPortsLines2; do
curl -sSik http://$rhost:$port1 -m 10 -o homepage-source2.html &>/dev/null
if [[ -s homepage-source2.html ]]; then
if grep -q ".htb" homepage-source2.html; then
htbsourcedomains=$(grep '.htb' homepage-source2.html | tr ' ' '\n' | grep ".htb" | sed -e "s/[^/]*\/\/\([^@]*@\)\?\([^:/]*\).*/\2/" | sort -u)
for htbsourcedomain in $htbsourcedomains; do
if [[ -n $htbsourcedomain ]]; then
if grep -q "$rhost" /etc/hosts; then
if grep -q "$htbsourcedomain" /etc/hosts; then
:
else
echo -e "adding $htbsourcedomain to hosts file"
sed -i $"/$rhost/ s/$/\t$htbsourcedomain/" /etc/hosts
fi
else
sed -i $"3i$rhost\t$htbsourcedomain" /etc/hosts
fi
fi
done
fi
fi
if [[ $rhost == 127.0.0.1 ]]; then
:
elif grep -q "$rhost" /etc/hosts; then
htbdomains5=$(grep $rhost /etc/hosts | awk '{$1= ""; print $0}')
remwildcardDomains=$(echo $htbdomains5 | tr ' ' '\n')
for wcDomain in $remwildcardDomains; do
wildcards=('*' '?' '|')
for wildcard in "${wildcards[@]}"; do
if [[ $wcDomain == *"${wildcard}"* ]]; then
:
else
domainNoWildcard2=$(echo "${wcDomain#'*.'}")
echo $domainNoWildcard2 | tee -a htbdomainslist.txt
fi
done
done
htbdomains7=$(cat htbdomainslist.txt | sort -u)
if [[ -s htbdomainslist.txt ]]; then
for htbdomain2 in $htbdomains7; do
if [[ $(grep "domain" top-open-services.txt) ]] || [[ $(grep -w "53" top-open-ports.txt) ]]; then
if [[ $htbdomain2 == *"www."* ]]; then
noWwwDomain=$(sed -n -e 's/^.*www.//p' htbdomainslist.txt | head -n 1)
echo -e "${DOPE} host -l $noWwwDomain $htbdomain2"
host -l $noWwwDomain $htbdomain2 | tee -a hostlookup-$rhost-$noWwwDomain.log
echo -e "${DOPE} dnsenum --dnsserver $rhost --enum -f /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -r $noWwwDomain"
dnsenum --dnsserver $rhost --enum -f /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -r $noWwwDomain | tee -a dsnenum-$rhost-$noWwwDomain.log
if [[ -s fierce-$rhost-$noWwwDomain.log ]]; then
:
else
echo -e "${DOPE} fierce.py --domain $noWwwDomain --dns-servers $rhost"
fierce.py --domain $noWwwDomain --dns-servers $rhost | tee fierce-$rhost-$noWwwDomain.log
fi
else
if [[ -s fierce-$rhost-$noWwwDomain.log ]]; then
:
else
baseDomain=$(cat htbdomainslist.txt | sed 's/.*\.\(.*\..*\)/\1/' | sort -u)
if [[ -n $baseDomain ]]; then
for uniqBaseDomain in $baseDomain; do
echo -e "${DOPE} dnsenum --dnsserver $rhost --enum -f /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -r $uniqBaseDomain"
dnsenum --dnsserver $rhost --enum -f /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -r $uniqBaseDomain | tee -a dsnenum-$rhost-$uniqBaseDomain.log
if [[ -s fierce-$rhost-$uniqBaseDomain.log ]]; then
:
else
echo -e "${DOPE} fierce.py --domain $uniqBaseDomain --dns-servers $rhost"
fierce.py --domain $uniqBaseDomain --dns-servers $rhost | tee fierce-$rhost-$uniqBaseDomain.log
fi
done
fi
fi
fi
fi
echo -e "${MANUALCMD} Manual Command to Run: wfuzz "