-
Notifications
You must be signed in to change notification settings - Fork 0
/
methodCheck.sh
42 lines (29 loc) · 1.07 KB
/
methodCheck.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
#### DEPRECATED AS OF 05/05/24 - Look for MethodCheck2.sh for the best latest version
#
# methodCheck.sh
# Purpose - check all possible URI and protocols for each method
#!/bin/bash
echo "trying CURL 100x for various methods on $1:"; echo
for i in {1..5}; do
curl -sI -X OPTIONS https://$1/|grep -i "allow:";
curl -sI -X OPTIONS http://$1/|grep -i "allow:";
curl -sI -X OPTIONS http://www.$1/|grep -i "allow:";
curl -sI -X OPTIONS https://www.$1/|grep -i "allow:";
done
--- Example output
/bashchk.sh alaska.gov
trying CURL 100x for various methods on alaska.gov:
Allow: OPTIONS, TRACE, GET, HEAD, POST
Allow: OPTIONS, TRACE, GET, HEAD, POST
Allow: OPTIONS, TRACE, GET, HEAD, POST
Allow: OPTIONS, TRACE, GET, HEAD, POST
Allow: OPTIONS, TRACE, GET, HEAD, POST
Allow: OPTIONS, TRACE, GET, HEAD, POST
Allow: OPTIONS, TRACE, GET, HEAD, POST
Allow: OPTIONS, TRACE, GET, HEAD, POST
./bashchk.sh rit.edu
trying CURL 100x for various methods on rit.edu:
allow: GET, POST, DELETE, PATCH
allow: GET, POST, DELETE, PATCH
çallow: GET, POST, DELETE, PATCH
allow: GET, POST, DELETE, PATCH