-
Notifications
You must be signed in to change notification settings - Fork 826
/
multiTabs.sh
executable file
·135 lines (113 loc) · 2.91 KB
/
multiTabs.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
#!/usr/bin/env bash
# by Lee Baird (@discoverscripts)
f_runlocally
clear
f_banner
# Check if Firefox is running
if pgrep firefox > /dev/null; then
echo
echo "[!] Close Firefox before running script."
echo
exit 1
fi
echo -e "${BLUE}Open multiple tabs in Firefox with:${NC}"
echo
echo "1. List"
echo "2. Files in a directory"
echo "3. Directories in robots.txt"
echo "4. Previous menu"
echo
echo -n "Choice: "
read -r CHOICE
case "$CHOICE" in
1)
f_location
echo
echo -n "Use an https prefix? (y/N) "
read -r PREFIX
if [ -z "$PREFIX" ]; then
while read -r i; do
xdg-open http://"$i" &
sleep 2
done < "$LOCATION"
elif [ "$PREFIX" == "y" ]; then
while read -r i; do
xdg-open https://"$i" &
sleep 2
done < "$LOCATION"
else
f_error
fi
exit
;;
2)
echo
echo "$MEDIUM"
echo
echo -n "Enter the location of your directory: "
read -r LOCATION
# Check for no answer
if [ -z "$LOCATION" ]; then
f_error
fi
# Check for wrong answer
if [ ! -d "$LOCATION" ]; then
f_error
fi
cd "$LOCATION"
# option 1
for i in $(ls -l | awk '{print $9}'); do
xdg-open "$i" &
sleep 2
done
exit
;;
3)
echo
echo "$MEDIUM"
echo
echo "Usage: target.com or target-IP"
echo
echo -n "Domain: "
read -r DOMAIN
# Check for no answer
if [ -z "$DOMAIN" ]; then
f_error
fi
curl -kLs "$DOMAIN"/robots.txt -o robots.txt
if ! curl -kLs "$DOMAIN"/robots.txt -o robots.txt; then
echo
echo -e "${RED}[!] Failed to connect to $DOMAIN.${NC}"
echo
exit 1
fi
# # Check if the file is empty
# if [ ! -s robots.txt ]; then
# echo
# echo -e "${RED}$MEDIUM${NC}"
# echo
# echo -e "${RED}[*] No robots.txt file discovered.${NC}"
# echo
# echo -e "${RED}$MEDIUM${NC}"
# echo
# exit 1
# fi
grep -i 'disallow' robots.txt | awk '{print $2}' | grep -iv disallow | sort -u > tmp
while read -r i; do
xdg-open "https://$DOMAIN$i" &
sleep 2
done < tmp
rm robots.txt
mv tmp "$HOME"/data/"$DOMAIN"-robots.txt
echo
echo "$MEDIUM"
echo
echo "[*] Scan complete."
echo
echo -e "The new report is located at ${YELLOW}$HOME/data/$DOMAIN-robots.txt${NC}"
echo
exit
;;
4) f_main ;;
*) echo; echo -e "${RED}[!] Invalid choice or entry, try again.${NC}"; echo; sleep 2; "$DISCOVER"/multiTabs.sh ;;
esac