-
Notifications
You must be signed in to change notification settings - Fork 1
/
automatedrecon.sh
1353 lines (1124 loc) · 68.5 KB
/
automatedrecon.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
#!/bin/bash
# Function to handle errors with manual installation solutions
handle_error_with_solution() {
echo -e "${RED}Error occurred during the execution of $1. Exiting step but continuing with the next installation.${NC}"
echo "Error during: $1" >> error.log
echo -e "${YELLOW}Possible Solution for manual installation:${NC}"
echo -e "${BOLD_WHITE}$2${NC}"
}
# Copy katana, waybackurls, and gau to /usr/bin and /usr/local/bin
for file in katana waybackurls gau; do
if [ -f "$file" ]; then
sudo cp "$file" /usr/bin || echo "Failed to copy $file to /usr/bin"
sudo cp "$file" /usr/local/bin || echo "Failed to copy $file to /usr/local/bin"
echo "Copied $file to /usr/bin and /usr/local/bin"
else
echo "File $file not found in the current directory."
fi
done
# Define colors
BOLD_WHITE='\033[1;97m'
BOLD_BLUE='\033[1;34m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
# Function to handle errors
handle_error() {
echo -e "${RED}Error occurred during the execution of $1. Exiting.${NC}"
echo "Error during: $1" >> error.log
exit 1
}
# Function to show progress with emoji
show_progress() {
echo -e "${BOLD_BLUE}Current process: $1...⌛️${NC}"
}
# Function to check if a command exists and is executable
check_command() {
if ! command -v "$1" &> /dev/null; then
echo -e "${RED}$1 could not be found or is not installed correctly.${NC}"
handle_error "$1 installation check"
else
echo -e "${BOLD_BLUE}$1 installed correctly.${NC}"
fi
}
# Clear the terminal
clear
# Display banner
echo -e "${BOLD_BLUE}HERE WE GO${NC}"
# Function to display options
display_options() {
echo -e "${BOLD_BLUE}Please select an option:${NC}"
echo -e "${RED}1: Install all tools${NC}"
echo -e "${RED}2: Enter a domain name of the target${NC}"
echo -e "${YELLOW}3: Enumerate and filter domains${NC}"
echo -e "${YELLOW}4: Crawl and filter URLs${NC}"
echo -e "${YELLOW}5: Filtering all${NC}"
echo -e "${YELLOW}6: Create new separated file for Arjun & SQLi testing${NC}"
echo -e "${YELLOW}7: Getting ready for XSS & URLs with query strings${NC}"
echo -e "${YELLOW}8: xss0r RUN${NC}"
echo -e "${YELLOW}9: Exit${NC}"
echo -e "${YELLOW}10: VPS server xss0r help${NC}"
echo -e "${YELLOW}11: Path-based XSS${NC}" # New Option 11 added here
}
# Function to display VPS server xss0r help information with better formatting and crystal-like color
show_vps_info() {
echo -e "${CYAN}To run xss0r continuously on bug bounty programs and keep it running in the background, a VPS server is highly recommended.${NC}"
echo -e "${CYAN}I personally recommend Contabo, which I've been using for the past three years. It has performed reliably without any restrictions.${NC}"
echo -e "${CYAN}Additionally, the pricing is very competitive.${NC}\n"
echo -e "${CYAN}Here is the link to purchase the Contabo VPS 2 server Debian OS:${NC}"
echo -e "${CYAN}Make sure to select under OS settings to be DEBIAN OS 12:${NC}"
echo -e "${CYAN}https://contabo.com/en/vps/cloud-vps-2/?image=debian.329&qty=1&contract=1&storage-type=vps2-400-gb-sdd${NC}\n"
echo -e "${CYAN}You can select any plan from Contabo Hosting https://contabo.com/en/vps/${NC}\n"
echo -e "${CYAN}After completing the purchase, you can expect to receive your credentials via email within 15 minutes to 3 hours.${NC}\n"
echo -e "${CYAN}Next, update your VPS and install tmux to allow xss0r to run in the background.${NC}\n"
echo -e "${CYAN}Below are the essential tmux commands:${NC}\n"
echo -e "${CYAN}#### Start a new tmux session:${NC}"
echo -e "${CYAN}apt install tmux # Install tmux${NC}"
echo -e "${CYAN}tmux new-session -s xss0r # Create a new tmux session${NC}"
echo -e "${CYAN}tmux attach-session -t xss0r # Reattach to an existing tmux session from another terminal tab${NC}"
echo -e "${CYAN}tmux detach -s xss0r # Detach from the tmux session${NC}"
echo -e "${CYAN}tmux kill-session -t xss0r # Terminate the xss0r tmux session${NC}"
echo -e "${CYAN}tmux kill-server # Terminate all tmux sessions${NC}"
echo -e "${CYAN}tmux ls # List all active tmux sessions${NC}\n"
echo -e "${CYAN}#### Install and Configure Cockpit https://YourVpsIP:9090${NC}"
echo -e "${CYAN}#### Cockpit it WEB GUI for SSH with many features like Navigator (File Manmager) for quick upload/download files:${NC}"
echo -e "${CYAN}sudo apt install cockpit cockpit-podman -y # Install Cockpit and Podman support${NC}"
echo -e "${CYAN}sudo systemctl start cockpit # Start Cockpit service${NC}"
echo -e "${CYAN}sudo systemctl enable cockpit # Enable Cockpit to start on boot${NC}"
echo -e "${CYAN}sudo apt install ufw -y # Install UFW firewall${NC}"
echo -e "${CYAN}sudo ufw enable # Enable UFW firewall${NC}"
echo -e "${CYAN}sudo ufw allow 9090 # Allow Cockpit access on port 9090${NC}"
echo -e "${CYAN}sudo ufw allow 80 # Allow HTTP access${NC}"
echo -e "${CYAN}sudo ufw allow 22 # Allow SSH access${NC}"
echo -e "${CYAN}sudo ufw allow 3389 # Allow RDP access${NC}"
echo -e "${CYAN}sudo ufw reload # Reload UFW rules${NC}\n"
echo -e "${CYAN}sudo ufw allow 22/tcp # Allow ssh over tcp${NC}\n"
echo -e "${CYAN}sudo ufw allow ssh # Allow ssh
echo -e "${CYAN}#### Configure Cockpit to Allow Unencrypted Access and Root Login:${NC}"
echo -e "${CYAN}sudo nano /etc/cockpit/cockpit.conf # Add settings to cockpit.conf${NC}"
echo -e "${CYAN}[WebService]\nAllowUnencrypted = true\nLogin= root\n" # Configuration content for cockpit.conf
echo -e "${CYAN}sudo systemctl restart cockpit # Restart Cockpit service to apply changes${NC}"
echo -e "${CYAN}sudo apt-get upgrade cockpit # Upgrade Cockpit${NC}"
echo -e "${CYAN}sudo nano /etc/cockpit/disallowed-users # Delete 'root' user from disallowed-users${NC}"
echo -e "${CYAN}sudo nano /etc/pam.d/cockpit # Comment pam_listfile.so item=user sense=deny line${NC}"
echo -e "${CYAN}sudo mkdir -p /etc/cockpit/ws-certs.d # Create directory for certificates${NC}"
echo -e "${CYAN}sudo rm /etc/cockpit/ws-certs.d/0-self-signed.cert # Remove self-signed cert${NC}"
echo -e "${CYAN}sudo systemctl restart cockpit # Restart Cockpit service${NC}\n"
echo -e "${CYAN}#### Install Cockpit Navigator Plugin & ZIP archive:${NC}"
echo -e "${CYAN}sudo apt-get install rsync zip # Install rsync zip${NC}"
echo -e "${CYAN}sudo apt-get install unzip # Install unzip ${NC}"
echo -e "${CYAN}sudo apt-get install p7zip-full # Install p7zip${NC}"
echo -e "${CYAN}wget https://github.com/45Drives/cockpit-navigator/releases/download/v0.5.10/cockpit-navigator_0.5.10-1focal_all.deb # Download Cockpit Navigator${NC}"
echo -e "${CYAN}sudo dpkg -i cockpit-navigator_0.5.10-1focal_all.deb # Install Cockpit Navigator${NC}"
echo -e "${CYAN}Navigate to https://YourVpsIP:9090/navigator # Access Cockpit Navigator in your browser${NC}\n"
echo -e "${CYAN}#### Install and Configure RDP:${NC}"
echo -e "${CYAN}sudo apt install xrdp -y # Install xrdp for RDP functionality${NC}"
echo -e "${CYAN}sudo adduser ibrahim # Add a new user 'ibrahim'${NC}"
echo -e "${CYAN}sudo usermod -aG ssl-cert ibrahim # Add user to ssl-cert group${NC}"
echo -e "${CYAN}sudo usermod -aG adm ibrahim # Add user to adm group${NC}"
echo -e "${CYAN}sudo usermod -aG www-data ibrahim # Add user to www-data group${NC}"
echo -e "${CYAN}sudo usermod -aG sudo ibrahim # Add user to sudo group${NC}"
echo -e "${CYAN}sudo usermod -aG root ibrahim # Add user to root group${NC}"
echo -e "${CYAN}sudo usermod -aG systemd-journal ibrahim # Add user to systemd-journal group${NC}"
echo -e "${CYAN}sudo usermod -aG users ibrahim # Add user to users group${NC}\n"
echo -e "${CYAN}#### Configure Firewall for RDP and SSH:${NC}"
echo -e "${CYAN}sudo ufw allow 3389/tcp # Allow RDP${NC}"
echo -e "${CYAN}sudo ufw allow 22/tcp # Allow SSH${NC}"
echo -e "${CYAN}sudo ufw reload # Reload UFW rules${NC}"
echo -e "${CYAN}sudo iptables -A INPUT -p tcp --dport 3389 -j ACCEPT # Allow RDP via iptables${NC}"
echo -e "${CYAN}sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT # Allow SSH via iptables${NC}"
echo -e "${CYAN}sudo systemctl restart xrdp # Restart xrdp service${NC}"
echo -e "${CYAN}sudo systemctl enable xrdp # Enable xrdp to start on boot${NC}\n"
echo -e "${CYAN}#### Install and Configure Desktop Environment for RDP or down below you have for Kali Linux (Prefered):${NC}"
echo -e "${CYAN}sudo apt install gnome -y # Install GNOME Desktop Environment${NC}"
echo -e "${CYAN}sudo apt-get install mate-desktop-environment-extras mate-themes -y # Install MATE Desktop${NC}"
echo -e "${CYAN}sudo apt-get install xfce4 xfce4-goodies -y # Install XFCE Desktop${NC}"
echo -e "${CYAN}gsettings set org.mate.interface gtk-theme 'Menta' # Set theme for MATE${NC}"
echo -e "${CYAN}gsettings set org.gnome.desktop.interface gtk-theme 'Menta' # Set theme for GNOME${NC}"
echo -e "${CYAN}xfconf-query -c xsettings -p /Net/ThemeName -s 'Xfce' # Set theme for XFCE${NC}\n"
echo -e "${CYAN}sudo reboot # Update changes to VPS server${NC}\n"
echo -e "${CYAN}#### Configure Desktop Session for RDP:${NC}"
echo -e "${CYAN}echo 'xfce4-session' > ~/.xsession # Configure XFCE session${NC}"
echo -e "${CYAN}echo 'gnome-session' > ~/.xsession # Configure GNOME session${NC}"
echo -e "${CYAN}chmod 755 /root/.xsession # Set permissions for .xsession${NC}"
echo -e "${CYAN}sudo systemctl restart sshd # Restart SSH service${NC}"
echo -e "${CYAN}sudo ufw allow 3389 # Ensure RDP is allowed through firewall${NC}"
echo -e "${CYAN}sudo systemctl restart xrdp # Restart xrdp service${NC}"
echo -e "${CYAN}rdesktop YourVpsIP # Connect to VPS via RDP${NC}"
echo -e "${CYAN}sudo reboot # Reboot system${NC}\n"
echo -e "${CYAN}#### Troubleshooting RDP Issues:${NC}"
echo -e "${CYAN}If RDP doesn't work, try reconfiguring xrdp:${NC}"
echo -e "${CYAN}sudo dpkg-reconfigure xrdp # Reconfigure xrdp settings${NC}\n"
echo -e "${CYAN}#### Install Kali Linux and Desktop Environment:${NC}"
echo -e "${CYAN}sudo nano /etc/apt/sources.list # Add Kali repository to sources.list${NC}"
echo -e "${CYAN}deb http://http.kali.org/kali kali-rolling main contrib non-free non-free-firmware\n"
echo -e "${CYAN}wget -q -O - https://archive.kali.org/archive-key.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/kali-archive-keyring.gpg # Import Kali keyring${NC}"
echo -e "${CYAN}sudo apt update # Update package list${NC}"
echo -e "${CYAN}sudo apt upgrade # Upgrade packages${NC}"
echo -e "${CYAN}sudo apt full-upgrade # Full system upgrade${NC}"
echo -e "${CYAN}sudo apt dist-upgrade # Distribution upgrade${NC}"
echo -e "${CYAN}sudo apt -y install kali-linux-everything # Install all Kali tools${NC}"
echo -e "${CYAN}sudo apt install kali-desktop-gnome # Install Kali GNOME Desktop${NC}"
echo -e "${CYAN}sudo apt install kali-linux-default # Install default Kali packages${NC}"
echo -e "${CYAN}sudo apt update --fix-missing # Fix missing dependencies${NC}"
echo -e "${CYAN}sudo apt --fix-broken install # Fix broken installations${NC}"
echo -e "${CYAN}sudo dpkg --configure -a # Reconfigure dpkg${NC}"
echo -e "${CYAN}sudo update-alternatives --config x-session-manager # Configure session manager${NC}"
echo -e "${CYAN}sudo apt -y install kali-root-login # Enable root login${NC}"
echo -e "${CYAN}sudo passwd # Set root password${NC}"
echo -e "${CYAN}sudo apt autoremove # Remove unnecessary packages${NC}"
echo -e "${CYAN}sudo apt clean # Clean up package cache${NC}\n"
echo -e "${CYAN}sudo reboot # Update changes to VPS server${NC}\n"
echo -e "${CYAN}#### Switching from RDP User to Root:${NC}"
echo -e "${CYAN}sudo su - # Switch to root user${NC}\n"
echo -e "${CYAN}For more information about VPS configuration, please visit the official Contabo page or reach out to support.${NC}"
# Steps for installing xss0r on VPS
echo -e "${CYAN}#### Steps for installing xss0r on VPS:${NC}"
echo -e "${CYAN}1. Install Cockpit ${NC} # Install Cockpit for VPS management"
echo -e "${CYAN}2. Install Debian ${NC} # Install the Debian OS"
echo -e "${CYAN}3. nano /etc/apt/sources.list ${NC} # Edit source list in Debian OS"
echo -e "${CYAN}4. deb http://asi-fs-d.contabo.net/debian bookworm main non-free-firmware ${NC} # Change 'bookworm' to 'testing'"
echo -e "${CYAN}5. deb-src http://asi-fs-d.contabo.net/debian bookworm main non-free-firmware ${NC} # Change 'bookworm' to 'testing'"
echo -e "${CYAN}6. Update & Upgrade ${NC} # sudo apt install gnome -y"
echo -e "${CYAN}7. Install Kali OS ${NC} # Not needed any changes except updates & upgrades"
echo -e "${CYAN}8. Upload all files to your VPS ${NC} # Upload xss0r + xss0rRecon files"
echo -e "${CYAN}9. chmod +x xss-checker ${NC} # Add execute permission to the xss0r tool"
echo -e "${CYAN}10. chmod +x chromedriver ${NC} # Add execute permission to chromedriver"
echo -e "${CYAN}11. Install required Chrome version from the eBook ${NC} # Install the required Chrome version as outlined in the eBook"
echo -e "${CYAN}12. Run xss0r and enter API License ${NC} # Run xss0r tool and enter your API license"
echo -e "${CYAN}13. Run xss0rRecon and install all tools ${NC} # Run xss0rRecon and install necessary tools"
echo -e "${CYAN}14. Ensure all files in the same folder ${NC} # Make sure all files are inside the same folder"
echo -e "${CYAN}15. Add --no-sandbox option to Chrome ${NC} # Add the --no-sandbox option to Google Chrome"
echo -e "${CYAN}16. Run RDP GUI, launch Chrome, set default browser ${NC} # Run RDP GUI, run Chrome from terminal, set as default and open any site"
echo -e "${CYAN}17. Exit from RDP GUI and back to Cockpit terminal ${NC} # Close RDP and back to your terminal"
echo -e "${CYAN}18. Run xss0r tool ${NC} # Launch and run xss0r tool"
}
# Initialize a variable for the domain name
domain_name=""
last_completed_option=1
skip_order_check_for_option_4=false
total_merged_urls=0
# Function to run step 1 (Install all tools)
install_tools() {
# Find the current directory path
CURRENT_DIR=$(pwd)
echo -e "${BOLD_WHITE}You selected: Install all tools${NC}"
show_progress "Installing dependencies"
sudo apt update
sudo apt-mark hold google-chrome-stable
sudo apt-get install -y rsync zip unzip p7zip-full wget golang-go
sudo apt-get install terminator
sudo apt remove python3-structlog
# Set full permissions for the xss0rRecon folder and its contents
sudo chmod -R 777 "$CURRENT_DIR/xss0rRecon"
# Step 1: Install Python3 virtual environment and structlog in venv
show_progress "Installing python3-venv and setting up virtual environment"
sudo pip install structlog --break-system-packages --root-user-action=ignore
pip install requests --break-system-packages --root-user-action=ignore
sudo apt install python3-full python3-pip
sudo apt install pipx
export PATH="$PATH:/root/.local/bin"
sleep 3
# Step 2: Install the latest version of pip
show_progress "Installing/Upgrading pip"
sudo apt update && sudo apt install python3-pip -y
sudo pip3 install --upgrade pip --root-user-action=ignore
sleep 3
# Step 3: Install Go
show_progress "Installing Go"
wget https://go.dev/dl/go1.22.5.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.22.5.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
go version
sudo rm -r go1.22.5.linux-amd64.tar.gz
sleep 3
# Step 4: Install Dnsbruter (Skip if the folder already exists)
if [ ! -d "Dnsbruter" ]; then
show_progress "Installing Dnsbruter"
# Update and upgrade the system
sudo apt update && sudo apt upgrade -y
# Install Python 3.12
sudo apt install python3.12 -y
# Install pip for Python 3.12
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3.12 get-pip.py
# Install pipx and ensure it's in the PATH
pip install pipx==1.7.1 --break-system-packages --root-user-action=ignore
pipx ensurepath
# Verify Python, pip, and pipx installations
python3 --version
pip --version
pipx --version
# Install Dnsbruter with pip (no dependencies and force reinstall)
sudo pip install --no-deps --force-reinstall --break-system-packages git+https://github.com/RevoltSecurities/Dnsbruter.git
# Optionally try installing with pipx as well
sudo pipx install git+https://github.com/RevoltSecurities/Dnsbruter.git --break-system-packages
sudo pipx install dnsbruter --force
# Clone the repository (optional if you want the source code locally)
sudo git clone https://github.com/RevoltSecurities/Dnsbruter.git
cd Dnsbruter
sudo pip install . --break-system-packages --root-user-action=ignore
cd ..
sudo rm -rf Dnsbruter
# Ensure that dnsbruter is accessible globally
if command -v dnsbruter &> /dev/null; then
echo "Dnsbruter is successfully installed and globally available."
else
echo "Dnsbruter installation failed. Please check the installation steps."
fi
# Final check to ensure dnsbruter is installed correctly
if command -v dnsbruter &> /dev/null; then
echo "Dnsbruter is ready to use. You can run 'dnsbruter -h' to confirm."
dnsbruter -h
else
echo "Dnsbruter installation failed. Please check the installation steps."
fi
sleep 3
else
show_progress "Dnsbruter is already installed. Skipping installation."
fi
# Step 5: Install Subdominator (Skip if the folder already exists)
if [ ! -d "Subdominator" ]; then
show_progress "Installing Subdominator"
# Install Subdominator directly from the GitHub repository
sudo pip install git+https://github.com/RevoltSecurities/Subdominator.git --break-system-packages --root-user-action=ignore
# Clone the repository (optional if you need the source code locally)
sudo git clone https://github.com/RevoltSecurities/Subdominator.git
cd Subdominator
# Install from local cloned repository
sudo pip install . --break-system-packages --root-user-action=ignore
# Clean up by removing the cloned directory after installation
cd ..
sudo rm -rf Subdominator
show_progress "Subdominator installation complete."
sleep 3
else
show_progress "Subdominator is already installed. Skipping installation."
fi
# Step 6: Install SubProber (Skip if the folder already exists)
if [ ! -d "SubProber" ]; then
show_progress "Installing SubProber"
# Install SubProber directly from the GitHub repository
sudo pip install git+https://github.com/RevoltSecurities/Subprober.git --break-system-packages --root-user-action=ignore
# Clone the repository (optional if you need the source code locally)
sudo git clone https://github.com/RevoltSecurities/Subprober.git
cd Subprober
# Install from local cloned repository
sudo pip install . --break-system-packages --root-user-action=ignore
# Clean up by removing the cloned directory after installation
cd ..
rm -rf Subprober
show_progress "SubProber installation complete."
sleep 3
else
show_progress "SubProber is already installed. Skipping installation."
fi
# Step 7: Install GoSpider
show_progress "Installing GoSpider"
sudo apt install -y gospider
GO111MODULE=on sudo go install github.com/jaeles-project/gospider@latest
sleep 3
# Step 8: Install Hakrawler
show_progress "Installing Hakrawler"
sudo apt install -y hakrawler
sleep 3
# Step 9: Install Katana
show_progress "Installing Katana"
sudo go install github.com/projectdiscovery/katana/cmd/katana@latest
# Copy Katana to /usr/local/bin and /usr/bin
sudo cp ~/go/bin/katana /usr/local/bin/
sudo cp ~/go/bin/katana /usr/bin/
sudo cp ~/go/bin/gau /usr/local/bin/
sudo cp ~/go/bin/gau /usr/bin/
sudo cp ~/go/bin/waybackurls /usr/local/bin/
sudo cp ~/go/bin/waybackurls /usr/bin/
sleep 3
# Step 10: Install Waybackurls
show_progress "Installing Waybackurls"
sudo go install github.com/tomnomnom/waybackurls@latest
sudo cp ~/go/bin/waybackurls /usr/local/bin/
sudo cp ~/go/bin/waybackurls /usr/bin/
sleep 3
# Step 11: Install Gau
show_progress "Installing Gau"
sudo go install github.com/lc/gau/v2/cmd/gau@latest
sudo cp ~/go/bin/gau /usr/local/bin/
sudo cp ~/go/bin/gau /usr/bin/
sudo bash -c 'echo -e "[gau]\nwayback = true\ncommoncrawl = true\notx = false" > /root/.gau.toml'
sleep 3
# Step 12: Install Uro
show_progress "Installing Uro"
sudo pip install uro --break-system-packages --root-user-action=ignore
sudo uro --help # Ensure Uro runs with sudo
sleep 3
# Step 13: Install Arjun
show_progress "Installing Arjun"
sudo apt install -y arjun
sudo pip3 install arjun --break-system-packages --root-user-action=ignore
sudo pip install alive_progress --break-system-packages --root-user-action=ignore
sudo pip install ratelimit --break-system-packages --root-user-action=ignore
sudo mv /usr/lib/python3.12/EXTERNALLY-MANAGED /usr/lib/python3.12/EXTERNALLY-MANAGED.bak
sleep 3
# Step 14: Install Tmux
show_progress "Installing Tmux"
sudo apt install -y tmux
sudo apt --fix-broken install
sudo apt update
sleep 3
# Set specific permissions for installed tools
sudo chmod 755 /usr/local/bin/waybackurls
sudo chmod 755 /usr/local/bin/katana
sudo chmod 755 /usr/local/bin/gau
sudo chmod 755 /usr/local/bin/uro
# Display installed tools
echo -e "${BOLD_BLUE}All tools have been successfully installed.${NC}"
# Checking each tool with -h for verification
echo -e "${BOLD_WHITE}Checking installed tools...${NC}"
echo -e "${BOLD_WHITE}1. Dnsbruter:${NC}"
dnsbruter -h > /dev/null 2>&1 && echo "Dnsbruter is installed" || echo "Dnsbruter is not installed correctly"
echo -e "${BOLD_WHITE}2. Subdominator:${NC}"
subdominator -h > /dev/null 2>&1 && echo "Subdominator is installed" || echo "Subdominator is not installed correctly"
echo -e "${BOLD_WHITE}3. SubProber:${NC}"
subprober -h > /dev/null 2>&1 && echo "SubProber is installed" || echo "SubProber is not installed correctly"
echo -e "${BOLD_WHITE}4. GoSpider:${NC}"
gospider -h > /dev/null 2>&1 && echo "GoSpider is installed" || echo "GoSpider is not installed correctly"
echo -e "${BOLD_WHITE}5. Hakrawler:${NC}"
hakrawler --help > /dev/null 2>&1 && echo "Hakrawler is installed" || echo "Hakrawler is not installed correctly"
echo -e "${BOLD_WHITE}6. Katana:${NC}"
katana -h > /dev/null 2>&1 && echo "Katana is installed" || echo "Katana is not installed correctly"
echo -e "${BOLD_WHITE}7. Waybackurls:${NC}"
waybackurls -h > /dev/null 2>&1 && echo "Waybackurls is installed" || echo "Waybackurls is not installed correctly"
echo -e "${BOLD_WHITE}8. Gau:${NC}"
gau -h > /dev/null 2>&1 && echo "Gau is installed" || echo "Gau is not installed correctly"
echo -e "${BOLD_WHITE}9. Uro:${NC}"
uro -h > /dev/null 2>&1 && echo "Uro is installed" || echo "Uro is not installed correctly"
echo -e "${BOLD_WHITE}10. Arjun:${NC}"
arjun -h > /dev/null 2>&1 && echo "Arjun is installed" || echo "Arjun is not installed correctly"
echo -e "${BOLD_WHITE}11. Tmux:${NC}"
echo "Tmux is installed (skipping check)"
# Cyan and White message with tool links for manual installation
echo -e "\n${BOLD_CYAN}If you encounter any issues or are unable to run any of the tools,${NC}"
echo -e "${BOLD_WHITE}please refer to the following links for manual installation:${NC}"
echo -e "${BOLD_WHITE}Waybackurls:${NC} https://github.com/tomnomnom/waybackurls"
echo -e "${BOLD_WHITE}Gau:${NC} https://github.com/lc/gau"
echo -e "${BOLD_WHITE}Uro:${NC} https://github.com/s0md3v/uro"
echo -e "${BOLD_WHITE}Katana:${NC} https://github.com/projectdiscovery/katana"
echo -e "${BOLD_WHITE}Hakrawler:${NC} https://github.com/hakluke/hakrawler"
echo -e "${BOLD_WHITE}GoSpider:${NC} https://github.com/jaeles-project/gospider"
echo -e "${BOLD_WHITE}Arjun:${NC} https://github.com/s0md3v/Arjun"
echo -e "${BOLD_WHITE}Dnsbruter:${NC} https://github.com/RevoltSecurities/Dnsbruter"
echo -e "${BOLD_WHITE}SubProber:${NC} https://github.com/RevoltSecurities/SubProber"
echo -e "${BOLD_WHITE}Subdominator:${NC} https://github.com/RevoltSecurities/Subdominator"
# Adding extra space for separation
echo -e "\n\n"
# Bold blue message surrounded by a rectangle of lines with extra spacing
echo -e "${BOLD_BLUE}=============================================================================================${NC}"
echo -e "${BOLD_BLUE}| |${NC}"
echo -e "${BOLD_BLUE}| NOTE: To use this tool, you must have the xss-checker tool, which is an XSS detection |${NC}"
echo -e "${BOLD_BLUE}| and exploitation tool for all types of XSS attacks, in the same directory. |${NC}"
echo -e "${BOLD_BLUE}| |${NC}"
echo -e "${BOLD_BLUE}| Alongside the xss-checker tool, you'll also need two wordlists and a Python reflection |${NC}"
echo -e "${BOLD_BLUE}| detection tool. All of these can be found in any of the XSS plans available on the site. |${NC}"
echo -e "${BOLD_BLUE}| |${NC}"
echo -e "${BOLD_BLUE}| You can get them by visiting: https://ibrahimxss.store/ and purchasing any plan that |${NC}"
echo -e "${BOLD_BLUE}| fits your needs. |${NC}"
echo -e "${BOLD_BLUE}| |${NC}"
echo -e "${BOLD_BLUE}| If you already have a plan, simply copy the xss-checker tool, the wordlists, and the |${NC}"
echo -e "${BOLD_BLUE}| reflection detection tool into the same folder where your xss0rRecon tool is located. |${NC}"
echo -e "${BOLD_BLUE}| |${NC}"
echo -e "${BOLD_BLUE}| Alternatively, if you don't have a plan or the tools, you can use the PRO plan for free |${NC}"
echo -e "${BOLD_BLUE}| for 5 days each month from the 10th to the 15th. |${NC}"
echo -e "${BOLD_BLUE}| |${NC}"
echo -e "${BOLD_BLUE}| The release of the key is posted on the homepage banner at ibrahimxss.store, but this |${NC}"
echo -e "${BOLD_BLUE}| option is only available for those who have not yet tested the tool. |${NC}"
echo -e "${BOLD_BLUE}| |${NC}"
echo -e "${BOLD_BLUE}=============================================================================================${NC}"
echo -e "\n\n"
}
# Function to run step 3 (Enumerate and filter domains)
run_step_3() {
echo -e "${BOLD_WHITE}You selected: Enumerate and filter domains for $domain_name${NC}"
# Step 1: Passive FUZZ domains with wordlist
show_progress "Passive FUZZ domains with wordlist"
dnsbruter -d "$domain_name" -w subs-dnsbruter-small.txt -c 200 -wt 100 -o output-dnsbruter.txt -ws wild.txt || handle_error "dnsbruter"
sleep 5
# Step 2: Active brute crawling domains
show_progress "Active brute crawling domains"
subdominator -d "$domain_name" -o output-subdominator.txt || handle_error "subdominator"
sleep 5
# Step 3: Checking if output-dnsbruter.txt was created
if [ ! -f "output-dnsbruter.txt" ]; then
echo "Error: output-dnsbruter.txt not found. The dnsbruter command may have failed."
# If dnsbruter failed, use only subdominator output
if [ -f "output-subdominator.txt" ]; then
echo "Moving output-subdominator.txt to ${domain_name}-domains.txt"
mv output-subdominator.txt "${domain_name}-domains.txt"
else
echo "Error: output-subdominator.txt not found. The subdominator command may have also failed."
exit 1
fi
else
# Check if output-subdominator.txt exists, and if both exist, merge the results
if [ -f "output-subdominator.txt" ]; then
# Step 4: Merging passive and active results into one file
show_progress "Merging passive and active results into one file"
cat output-dnsbruter.txt output-subdominator.txt > "${domain_name}-domains.txt" || handle_error "Merging domains"
else
echo "Error: output-subdominator.txt not found. Proceeding with output-dnsbruter.txt only."
mv output-dnsbruter.txt "${domain_name}-domains.txt"
fi
fi
# Show total subdomains after merging
total_subdomains=$(wc -l < "${domain_name}-domains.txt")
echo -e "${RED}Total subdomains after processing: $total_subdomains${NC}"
sleep 5
# Step 5: Removing old temporary files
show_progress "Removing old temporary files"
if [ -f "output-dnsbruter.txt" ]; then
rm output-dnsbruter.txt || handle_error "Removing output-dnsbruter.txt"
fi
if [ -f "output-subdominator.txt" ]; then
rm output-subdominator.txt || handle_error "Removing output-subdominator.txt"
fi
sleep 3
# Step 6: Removing duplicate domains
show_progress "Removing duplicate domains"
initial_count=$(wc -l < "${domain_name}-domains.txt")
awk '{sub(/^https?:\/\//, "", $0); sub(/^www\./, "", $0); if (!seen[$0]++) print}' "${domain_name}-domains.txt" > "unique-${domain_name}-domains.txt" || handle_error "Removing duplicates"
final_count=$(wc -l < "unique-${domain_name}-domains.txt")
removed_count=$((initial_count - final_count))
echo -e "${RED}Removed $removed_count duplicate domains.${NC}"
sleep 3
# Step 6: Removing old domain list
show_progress "Removing old domain list"
rm -r "${domain_name}-domains.txt" || handle_error "Removing old domain list"
sleep 3
# Step 7: Filtering ALIVE domain names
show_progress "Filtering ALIVE domain names"
subprober -f "unique-${domain_name}-domains.txt" -sc -ar -o "subprober-${domain_name}-domains.txt" -nc -mc 200 301 302 307 308 403 401 -c 50 || handle_error "subprober"
sleep 5
# Step 8: Filtering valid domain names
show_progress "Filtering valid domain names"
grep -oP 'http[^\s]*' "subprober-${domain_name}-domains.txt" > output-domains.txt || handle_error "grep valid domains"
sleep 3
# Step 9: Removing old unique domain list
show_progress "Removing old unique domain list"
rm -r "unique-${domain_name}-domains.txt" || handle_error "Removing old unique domain list"
sleep 3
# Step 10: Removing old subprober domains file
show_progress "Removing old subprober domains file"
rm -r "subprober-${domain_name}-domains.txt" || handle_error "Removing old subprober domains file"
sleep 3
# Step 11: Renaming final output
show_progress "Renaming final output to new file"
mv output-domains.txt "${domain_name}-domains.txt" || handle_error "Renaming output file"
sleep 3
# Step 12: Final filtering of unique domain names
show_progress "Last step filtering domains"
awk '{sub(/^https?:\/\//, "http://", $0); sub(/^www\./, "", $0); domain = $0; if (!seen[domain]++) print domain}' "${domain_name}-domains.txt" > "final-${domain_name}-domains.txt" || handle_error "Final filtering"
sleep 5
# Step 13: Renaming final file to new file
show_progress "Renaming final file to new file"
mv "final-${domain_name}-domains.txt" "${domain_name}-domains.txt" || handle_error "Renaming output file"
sleep 3
echo -e "${BOLD_BLUE}Enumeration and filtering process completed successfully. Final output saved as ${domain_name}-domains.txt.${NC}"
# New message for the user with Y/N option
read -p "$(echo -e "${BOLD_WHITE}Your domain file has been created. Would you like to continue scanning your target domain, including all its subdomains? If so, please enter 'Y'. If you prefer to modify the domain file first, so you can delete these and add your domains, enter 'N', and you can manually proceed with step 4 afterwards. Do you want to continue scanning with all subdomains (Y/N)?: ${NC}")" continue_scan
if [[ "$continue_scan" =~ ^[Yy]$ ]]; then
skip_order_check_for_option_4=true
echo -e "${BOLD_BLUE}Automatically continuing with step 4: Crawl and filter URLs...${NC}"
run_step_4 # Automatically continue to step 4
else
echo -e "${BOLD_WHITE}Please edit your file ${domain_name}-domains.txt and remove any unwanted subdomains before continuing.${NC}"
skip_order_check_for_option_4=true
fi
}
# Function to run step 4 (Crawl and filter URLs)
run_step_4() {
echo -e "${BOLD_WHITE}You selected: Crawl and filter URLs for $domain_name${NC}"
# Step 1: Crawling with GoSpider
show_progress "Crawling links with GoSpider"
gospider -S "${domain_name}-domains.txt" -c 10 -d 5 | tee -a "${domain_name}-gospider.txt" || handle_error "GoSpider crawl"
sleep 3
# Step 2: Crawling with Hakrawler
show_progress "Crawling links with Hakrawler"
cat "${domain_name}-domains.txt" | hakrawler -d 3 | tee -a "${domain_name}-hakrawler.txt" || handle_error "Hakrawler crawl"
sleep 3
# Step 3: Crawling with Katana
show_progress "Crawling links with Katana"
cat "${domain_name}-domains.txt" | katana | tee -a "${domain_name}-katana.txt" || handle_error "Katana crawl"
sleep 3
# Step 4: Crawling with Waybackurls
show_progress "Crawling links with Waybackurls"
cat "${domain_name}-domains.txt" | waybackurls | tee -a "${domain_name}-waybackurls.txt" || handle_error "Waybackurls crawl"
sleep 3
# Step 5: Crawling with Gau
show_progress "Crawling links with Gau"
rm -r /root/.gau.toml
cat "${domain_name}-domains.txt" | gau | tee -a "${domain_name}-gau.txt" || handle_error "Gau crawl"
sleep 3
echo -e "${BOLD_BLUE}Crawling and filtering URLs completed successfully. Output files created for each tool.${NC}"
# Step 6: Filter invalid links on Gospider and Hakrawler
show_progress "Filtering invalid links on Gospider and Hakrawler"
grep -oP 'http[^\s]*' "${domain_name}-gospider.txt" > "${domain_name}-gospider1.txt"
grep -oP 'http[^\s]*' "${domain_name}-hakrawler.txt" > "${domain_name}-hakrawler1.txt"
sleep 3
# Step 7: Remove old Gospider and Hakrawler files
show_progress "Removing old Gospider and Hakrawler files"
rm -r "${domain_name}-gospider.txt" "${domain_name}-hakrawler.txt"
sleep 3
# Step 8: Filter similar URLs with URO tool
show_progress "Filtering similar URLs with URO tool"
uro -i "${domain_name}-gospider1.txt" -o urogospider.txt &
uro_pid_gospider=$!
uro -i "${domain_name}-hakrawler1.txt" -o urohakrawler.txt &
uro_pid_hakrawler=$!
uro -i "${domain_name}-katana.txt" -o urokatana.txt &
uro_pid_katana=$!
uro -i "${domain_name}-waybackurls.txt" -o urowaybackurls.txt &
uro_pid_waybackurls=$!
uro -i "${domain_name}-gau.txt" -o urogau.txt &
uro_pid_gau=$!
# Monitor the processes
while kill -0 $uro_pid_gospider 2> /dev/null || kill -0 $uro_pid_hakrawler 2> /dev/null || \
kill -0 $uro_pid_katana 2> /dev/null || kill -0 $uro_pid_waybackurls 2> /dev/null || \
kill -0 $uro_pid_gau 2> /dev/null; do
echo -e "${BOLD_BLUE}URO tool is still running...⌛️${NC}"
sleep 30 # Check every 30 seconds
done
echo -e "${BOLD_BLUE}URO processing completed. Files created successfully.${NC}"
sleep 3
# Step 9: Remove all previous files
show_progress "Removing all previous files"
sudo rm -r "${domain_name}-gospider1.txt" "${domain_name}-hakrawler1.txt" "${domain_name}-katana.txt" "${domain_name}-waybackurls.txt" "${domain_name}-gau.txt"
sleep 3
# Step 10: Merge all URO files into one final file
show_progress "Merging all URO files into one final file"
cat urogospider.txt urohakrawler.txt urokatana.txt urowaybackurls.txt urogau.txt > "${domain_name}-links-final.txt"
# Create new folder 'urls' and assign permissions
show_progress "Creating 'urls' directory and setting permissions"
sudo mkdir -p urls
sudo chmod 777 urls
# Copy the final file to the 'urls' folder
show_progress "Copying ${domain_name}-links-final.txt to 'urls' directory"
sudo cp "${domain_name}-links-final.txt" urls/
# Display professional message about the URLs
echo -e "${BOLD_WHITE}All identified URLs have been successfully saved in the newly created 'urls' directory.${NC}"
echo -e "${CYAN}These URLs represent potential targets that were not filtered out during the previous steps.${NC}"
echo -e "${CYAN}You can use the file 'urls/${domain_name}-links-final.txt' for further vulnerability testing with tools like Nuclei or any other inspection frameworks to identify additional vulnerabilities.${NC}"
echo -e "${CYAN}We are now continuing with our main purpose of XSS filtration and vulnerability identification.${NC}"
# Display the number of URLs in the final merged file
total_merged_urls=$(wc -l < "${domain_name}-links-final.txt")
echo -e "${BOLD_WHITE}Total URLs merged: ${RED}${total_merged_urls}${NC}"
sleep 3
# Step 11: Remove all 5 previous files
show_progress "Removing all 5 previous files"
sudo rm -r urokatana.txt urohakrawler.txt urowaybackurls.txt urogau.txt urogospider.txt
sleep 3
# Automatically start step 5 after completing step 4
run_step_5
}
# Function to run step 5 (Filtering all)
run_step_5() {
echo -e "${BOLD_WHITE}You selected: Filtering extensions from the URLs for $domain_name${NC}"
# Step 14: Filtering extensions from the URLs
show_progress "Filtering extensions from the URLs"
cat ${domain_name}-links-final.txt | grep -E -v '\.css($|\s|\?|&|#|/|\.)|\.js($|\s|\?|&|#|/|\.)|\.jpg($|\s|\?|&|#|/|\.)|\.JPG($|\s|\?|&|#|/|\.)|\.PNG($|\s|\?|&|#|/|\.)|\.GIF($|\s|\?|&|#|/|\.)|\.avi($|\s|\?|&|#|/|\.)|\.dll($|\s|\?|&|#|/|\.)|\.pl($|\s|\?|&|#|/|\.)|\.webm($|\s|\?|&|#|/|\.)|\.c($|\s|\?|&|#|/|\.)|\.py($|\s|\?|&|#|/|\.)|\.bat($|\s|\?|&|#|/|\.)|\.tar($|\s|\?|&|#|/|\.)|\.swp($|\s|\?|&|#|/|\.)|\.tmp($|\s|\?|&|#|/|\.)|\.sh($|\s|\?|&|#|/|\.)|\.deb($|\s|\?|&|#|/|\.)|\.exe($|\s|\?|&|#|/|\.)|\.zip($|\s|\?|&|#|/|\.)|\.mpeg($|\s|\?|&|#|/|\.)|\.mpg($|\s|\?|&|#|/|\.)|\.flv($|\s|\?|&|#|/|\.)|\.wmv($|\s|\?|&|#|/|\.)|\.wma($|\s|\?|&|#|/|\.)|\.aac($|\s|\?|&|#|/|\.)|\.m4a($|\s|\?|&|#|/|\.)|\.ogg($|\s|\?|&|#|/|\.)|\.mp4($|\s|\?|&|#|/|\.)|\.mp3($|\s|\?|&|#|/|\.)|\.bat($|\s|\?|&|#|/|\.)|\.dat($|\s|\?|&|#|/|\.)|\.cfg($|\s|\?|&|#|/|\.)|\.cfm($|\s|\?|&|#|/|\.)|\.bin($|\s|\?|&|#|/|\.)|\.jpeg($|\s|\?|&|#|/|\.)|\.JPEG($|\s|\?|&|#|/|\.)|\.ps.gz($|\s|\?|&|#|/|\.)|\.gz($|\s|\?|&|#|/|\.)|\.gif($|\s|\?|&|#|/|\.)|\.tif($|\s|\?|&|#|/|\.)|\.tiff($|\s|\?|&|#|/|\.)|\.csv($|\s|\?|&|#|/|\.)|\.png($|\s|\?|&|#|/|\.)|\.ttf($|\s|\?|&|#|/|\.)|\.ppt($|\s|\?|&|#|/|\.)|\.pptx($|\s|\?|&|#|/|\.)|\.ppsx($|\s|\?|&|#|/|\.)|\.doc($|\s|\?|&|#|/|\.)|\.woff($|\s|\?|&|#|/|\.)|\.xlsx($|\s|\?|&|#|/|\.)|\.xls($|\s|\?|&|#|/|\.)|\.mpp($|\s|\?|&|#|/|\.)|\.mdb($|\s|\?|&|#|/|\.)|\.json($|\s|\?|&|#|/|\.)|\.woff2($|\s|\?|&|#|/|\.)|\.icon($|\s|\?|&|#|/|\.)|\.pdf($|\s|\?|&|#|/|\.)|\.docx($|\s|\?|&|#|/|\.)|\.svg($|\s|\?|&|#|/|\.)|\.txt($|\s|\?|&|#|/|\.)|\.jar($|\s|\?|&|#|/|\.)|\.0($|\s|\?|&|#|/|\.)|\.1($|\s|\?|&|#|/|\.)|\.2($|\s|\?|&|#|/|\.)|\.3($|\s|\?|&|#|/|\.)|\.4($|\s|\?|&|#|/|\.)|\.m4r($|\s|\?|&|#|/|\.)|\.kml($|\s|\?|&|#|/|\.)|\.pro($|\s|\?|&|#|/|\.)|\.yao($|\s|\?|&|#|/|\.)|\.gcn3($|\s|\?|&|#|/|\.)|\.PDF($|\s|\?|&|#|/|\.)|\.egy($|\s|\?|&|#|/|\.)|\.par($|\s|\?|&|#|/|\.)|\.lin($|\s|\?|&|#|/|\.)|\.yht($|\s|\?|&|#|/|\.)' > filtered-extensions-links.txt
sleep 5
# Step 15: Renaming filtered extensions file
show_progress "Renaming filtered extensions file"
mv filtered-extensions-links.txt "${domain_name}-links-clean.txt"
sleep 3
# Step 16: Filtering unwanted domains from the URLs
show_progress "Filtering unwanted domains from the URLs"
grep -E "^(https?://)?([a-zA-Z0-9.-]+\.)?${domain_name}" "${domain_name}-links-clean.txt" > "${domain_name}-links-clean1.txt"
sleep 3
# Step 17: Removing old filtered file
show_progress "Removing old filtered file"
rm -r ${domain_name}-links-clean.txt ${domain_name}-links-final.txt
sleep 3
# Step 18: Renaming new filtered file
show_progress "Renaming new filtered file"
mv ${domain_name}-links-clean1.txt ${domain_name}-links-clean.txt
sleep 3
# Step 19: Running URO tool again to filter duplicate and similar URLs
show_progress "Running URO tool again to filter duplicate and similar URLs"
uro -i "${domain_name}-links-clean.txt" -o "${domain_name}-uro.txt" &
uro_pid_clean=$!
# Monitor the URO process
while kill -0 $uro_pid_clean 2> /dev/null; do
echo -e "${BOLD_BLUE}URO tool is still running for clean URLs...⌛️${NC}"
sleep 30 # Check every 30 seconds
done
echo -e "${BOLD_BLUE}URO processing completed. Files created successfully.${NC}"
sleep 3
# Display the number of URLs in the URO output file
echo -e "${BOLD_WHITE}Total URLs in final output: ${RED}$(wc -l < "${domain_name}-uro.txt")${NC}"
sleep 3
# Step 20: Removing old file
show_progress "Removing old file"
rm -r "${domain_name}-links-clean.txt"
sleep 3
# Step 21: Removing 99% similar parameters with bash command
show_progress "Removing 99% similar parameters with bash command"
filtered_output="filtered_output.txt"
if [[ ! -f "${domain_name}-uro.txt" ]]; then
echo "File not found! Please check the path and try again."
exit 1
fi
awk -F'[?&]' '{gsub(/:80/, "", $1); base_url=$1; params=""; for (i=2; i<=NF; i++) {split($i, kv, "="); if (kv[1] != "id") {params = params kv[1]; if (i < NF) {params = params "&";}}} full_url=base_url"?"params; if (!seen[full_url]++) {print $0 > "'"$filtered_output"'";}}' "${domain_name}-uro.txt"
sleep 5
# Display the number of URLs in the filtered output file
echo -e "${BOLD_WHITE}Total filtered URLs: ${RED}$(wc -l < "$filtered_output")${NC}"
sleep 3
# Step 22: Removing old file
show_progress "Removing old file"
rm -r "${domain_name}-uro.txt"
sleep 3
# Step 23: Rename to new file
show_progress "Rename to new file"
mv filtered_output.txt "${domain_name}-links.txt"
sleep 3
# Step 24: Filtering ALIVE domain names
show_progress "Filtering ALIVE domain names"
subprober -f "${domain_name}-links.txt" -sc -ar -o "${domain_name}-links.txt1337" -nc -mc 200 301 302 307 308 403 -c 50 || handle_error "subprober"
sleep 5
# Step 25: Removing old file
show_progress "Removing old file"
rm -r ${domain_name}-links.txt
sleep 3
# Step 26: Filtering valid domain names
show_progress "Filtering valid domain names"
grep -oP 'http[^\s]*' "${domain_name}-links.txt1337" > ${domain_name}-links.txt1338 || handle_error "grep valid domains"
sleep 5
# Step 27: Removing intermediate file and renaming final output
show_progress "Final cleanup and renaming"
rm -r ${domain_name}-links.txt1337
mv ${domain_name}-links.txt1338 ${domain_name}-links.txt
sleep 3
echo -e "${BOLD_BLUE}Filtering process completed successfully. Final output saved as ${domain_name}-links.txt.${NC}"
# Automatically start step 6 after completing step 5
run_step_6
}
# Function to run step 6 (Create new separated file for Arjun & SQLi testing)
run_step_6() {
echo -e "${BOLD_WHITE}You selected: Create new separated file for Arjun & SQLi testing for $domain_name${NC}"
# Step 1: Preparing URLs with clean extensions
show_progress "Preparing URLs with clean extensions, created 2 files: arjun-urls.txt and output-php-links.txt"
cat "${domain_name}-links.txt" | grep -E "\.php($|\s|\?|&|#|/|\.)|\.asp($|\s|\?|&|#|/|\.)|\.aspx($|\s|\?|&|#|/|\.)|\.cfm($|\s|\?|&|#|/|\.)|\.jsp($|\s|\?|&|#|/|\.)" | awk '{if ($0 !~ /\?/) print > "arjun-urls.txt"; else print > "output-php-links.txt";}'
sleep 3
# Check if Arjun generated any files
if [ ! -s arjun-urls.txt ] && [ ! -s output-php-links.txt ]; then
echo -e "${RED}Arjun did not find any new links or did not create any files.${NC}"
echo -e "${BOLD_BLUE}Renaming ${domain_name}-links.txt to urls-ready.txt and continuing...${NC}"
mv "${domain_name}-links.txt" urls-ready.txt || handle_error "Renaming ${domain_name}-links.txt"
sleep 3
run_step_7 # Automatically proceed to step 7
return
fi
echo -e "${BOLD_BLUE}URLs prepared successfully and files created.${NC}"
echo -e "${BOLD_BLUE}arjun-urls.txt and output-php-links.txt have been created.${NC}"
# Step 2: Running Arjunhe on clean URLs if arjun-urls.txt is present
if [ -s arjun-urls.txt ]; then
show_progress "Running Arjun on clean URLs"
arjun -i arjun-urls.txt -oT arjun_output.txt -t 10 -w parametri.txt || handle_error "Arjun command"
sleep 5
# Count the number of new links discovered by Arjun
if [ -f arjun_output.txt ]; then
new_links_count=$(wc -l < arjun_output.txt)
echo -e "${BOLD_BLUE}Arjun has completed running on the clean URLs.${NC}"
echo -e "${BOLD_RED}Arjun discovered ${new_links_count} new links.${NC}"
# Step 3: Check if output-php-links.txt exists before merging
if [ -f output-php-links.txt ]; then
show_progress "Merging Arjun output with PHP links"
cat arjun_output.txt output-php-links.txt > arjun-final.txt || handle_error "Merging Arjun output"
else
echo -e "${YELLOW}Warning: output-php-links.txt not found. Renaming arjun_output.txt to arjun-final.txt and proceeding.${NC}"
mv arjun_output.txt arjun-final.txt || handle_error "Renaming arjun_output.txt to arjun-final.txt"
fi
sleep 5
else
echo -e "${RED}Arjun output file was not created. Checking for output-php-links.txt.${NC}"
if [ -s output-php-links.txt ]; then
mv output-php-links.txt arjun-final.txt || handle_error "Renaming output-php-links.txt"
else
echo -e "${RED}No files found to rename or merge. Please check the input files or conditions that create them.${NC}"
fi
fi
else
echo -e "${RED}Arjun did not find any links to process.${NC}"
if [ -s output-php-links.txt ]; then
mv output-php-links.txt arjun-final.txt || handle_error "Renaming output-php-links.txt"
else
echo -e "${RED}No output-php-links.txt to rename.${NC}"
fi
fi
# Step 4: Cleaning up temporary files if Arjun was successful
show_progress "Cleaning up temporary files"
if [[ -f arjun-urls.txt || -f arjun_output.txt || -f output-php-links.txt ]]; then
[[ -f arjun-urls.txt ]] && rm -r arjun-urls.txt
[[ -f arjun_output.txt ]] && rm -r arjun_output.txt
[[ -f output-php-links.txt ]] && rm -r output-php-links.txt
sleep 3
else
echo -e "${RED}No Arjun files to remove.${NC}"
fi
echo -e "${BOLD_BLUE}Files merged and cleanup completed. Final output saved as arjun-final.txt.${NC}"
# Step 5: Creating a new file for XSS testing
if [ -f arjun-final.txt ]; then
show_progress "Creating a new file for XSS testing"
cat "${domain_name}-links.txt" arjun-final.txt > urls-ready.txt || handle_error "Creating XSS testing file"
sleep 3
# Removing the previous links file
show_progress "Removing the previous links file"
rm -r "${domain_name}-links.txt" || handle_error "Removing previous links file"
sleep 3
echo -e "${BOLD_RED}XSS testing file created successfully as urls-ready.txt.${NC}"
else
echo -e "${RED}Skipping XSS testing file creation due to missing Arjun output.${NC}"
mv "${domain_name}-links.txt" urls-ready.txt || handle_error "Renaming ${domain_name}-links.txt"
fi
# Automatically start step 7 after completing step 6
run_step_7
}
# Function to run step 7 (Getting ready for XSS & URLs with query strings)
run_step_7() {
echo -e "${BOLD_WHITE}You selected: Getting ready for XSS & URLs with query strings for $domain_name${NC}"
# Step 1: Filtering URLs with query strings
show_progress "Filtering URLs with query strings"
grep '=' urls-ready.txt > "$domain_name-query.txt"
sleep 5
echo -e "${BOLD_BLUE}Filtering completed. Query URLs saved as ${domain_name}-query.txt.${NC}"
# Step 2: Renaming the remaining URLs
show_progress "Renaming remaining URLs"
mv urls-ready.txt "$domain_name-ALL-links.txt"
sleep 3
echo -e "${BOLD_BLUE}All-links URLs saved as ${domain_name}-ALL-links.txt.${NC}"
# Step 3: Analyzing and reducing the query URLs based on repeated parameters
show_progress "Analyzing query strings for repeated parameters"
# Start the analysis in the background and get the process ID (PID)
(> ibro-xss.txt; > temp_param_names.txt; > temp_param_combinations.txt; while read -r url; do base_url=$(echo "$url" | cut -d'?' -f1); extension=$(echo "$base_url" | grep -oiE '\.php|\.asp|\.aspx|\.cfm|\.jsp'); if [[ -n "$extension" ]]; then echo "$url" >> ibro-xss.txt; else params=$(echo "$url" | grep -oE '\?.*' | tr '?' ' ' | tr '&' '\n'); param_names=$(echo "$params" | cut -d'=' -f1); full_param_string=$(echo "$url" | cut -d'?' -f2); if grep -qx "$full_param_string" temp_param_combinations.txt; then continue; else new_param_names=false; for param_name in $param_names; do if ! grep -qx "$param_name" temp_param_names.txt; then new_param_names=true; break; fi; done; if $new_param_names; then echo "$url" >> ibro-xss.txt; echo "$full_param_string" >> temp_param_combinations.txt; for param_name in $param_names; do echo "$param_name" >> temp_param_names.txt; done; fi; fi; fi; done < "${domain_name}-query.txt"; echo "Processed URLs with unique parameters: $(wc -l < ibro-xss.txt)") &
# Save the process ID (PID) of the background task
analysis_pid=$!
# Monitor the process in the background
while kill -0 $analysis_pid 2> /dev/null; do
echo -e "${BOLD_BLUE}Analysis tool is still running...⌛️${NC}"
sleep 30 # Check every 30 seconds
done
# When finished
echo -e "${BOLD_GREEN}Analysis completed. $(wc -l < ibro-xss.txt) URLs with repeated parameters have been saved.${NC}"
rm temp_param_names.txt temp_param_combinations.txt
sleep 3
# Step 4: Cleanup and rename the output file
show_progress "Cleaning up intermediate files and setting final output"
rm -r "${domain_name}-query.txt"
mv ibro-xss.txt "${domain_name}-query.txt"
echo -e "${BOLD_BLUE}Cleaned up and renamed output to ${domain_name}-query.txt.${NC}"
sleep 3
# Step 3: Checking page reflection on the URLs
if [ -f "reflection.py" ]; then
echo -e "${BOLD_WHITE}Checking page reflection on the URLs with command: python reflection.py ${domain_name}-query.txt --threads 2${NC}"
python reflection.py "${domain_name}-query.txt" --threads 2 || handle_error "reflection.py execution"
sleep 5