-
Notifications
You must be signed in to change notification settings - Fork 0
/
stellar.sh
65 lines (54 loc) · 2.33 KB
/
stellar.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
echo " ########## ########### ######### # # ## ######### "
echo " # # # # # # # # # "
echo " # # # # # # # # # "
echo " # # # # # # # # # "
echo " ########## # ######### # # ########## ######### "
echo " # # # # # # # # # "
echo " # # # # # # # # # "
echo " ########## # ######### ######### ######## # # # # "
parameter=$1
function getting_collaburl(){
echo "enter your collaborator URL"
read collaburl
}
if [[ $parameter == "" || $parameter == "-h" ]]; then
echo "Usage: to scan a single domain: ./stellar.sh https://www.domain.com/"
echo "Usage: to scan a list of domains ./stellar.sh -L domains.txt "
echo "Usage: to forcefully find status code of domain ./stellar.sh -f https://www.domain.com/"
echo "usage: to forcefully find the status code of a list of domains ./stellar.sh -g domains.txt"
exit 1
fi
if [[ $parameter == http* ]]; then
getting_collaburl
while read -r header; do
content_length=$(curl -s $parameter --head -H $header: $collaburl| grep -i "content-length")
echo "the header is $header and the $content_length"
done < headers.txt
fi
if [[ $parameter == "-L" ]]; then
getting_collaburl
while read -r names; do
while read -r header; do
content_length=$(curl -s $names --head -H $header: $collaburl| grep -i "content-length")
echo "performing for $names"
echo "the header is $header and the $content_length"
done < headers.txt
done < $2
fi
if [[ $parameter == "-f" ]]; then
getting_collaburl
while read -r headers; do
getting_length=$(curl -s $2 --head -H $headers: $collaburl | wc -c)
echo "the header is $headers and the length is $getting_length"
done < headers.txt
fi
if [[ $parameter == "-g" ]]; then
getting_collaburl
while read -r names; do
while read -r header; do
content_length=$(curl -s $names --head -H $header: $collaburl| wc -c)
echo "performing for $names"
echo "the header is $header and the content length is:$content_length"
done < headers.txt
done < $2
fi