forked from leebaird/discover
-
Notifications
You must be signed in to change notification settings - Fork 0
/
multiTabs.sh
executable file
·121 lines (101 loc) · 2.21 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
#!/usr/bin/bash
f_runlocally
clear
f_banner
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 choice
case $choice in
1)
f_location
echo
echo -n "Use an https prefix? (y/N) "
read prefix
if [ -z $prefix ]; then
for i in $(cat $location); do
xdg-open http://$i &
sleep 1
done
elif [ "$prefix" == "y" ]; then
for i in $(cat $location); do
xdg-open https://$i &
sleep 1
done
else
f_error
fi
exit
;;
2)
echo
echo $medium
echo
echo -n "Enter the location of your directory: "
read -e 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
for i in $(ls -l | awk '{print $9}'); do
xdg-open $i &
sleep 1
done
exit
;;
3)
echo
echo $medium
echo
echo "Usage: target.com or target-IP"
echo
echo -n "Domain: "
read domain
# Check for no answer
if [ -z $domain ]; then
f_error
fi
curl -kLs $domain/robots.txt -o robots.txt
# 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}"
sleep 2
f_main
fi
grep -i 'disallow' robots.txt | grep -v '*' | awk '{print $2}' > tmp
for i in $(cat tmp); do
xdg-open http://$domain$i &
sleep 1
done
rm robots.txt
mv tmp $home/data/$domain-robots.txt
echo
echo $medium
echo
echo "***Scan complete.***"
echo
echo
echo -e "The new report is located at ${YELLOW}$home/data/$domain-robots.txt${NC}\n"
echo
echo
exit
;;
4) f_main;;
*) f_error;;
esac
}