-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoresc.sh
More file actions
executable file
·61 lines (47 loc) · 1.11 KB
/
oresc.sh
File metadata and controls
executable file
·61 lines (47 loc) · 1.11 KB
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
#!/bin/bash
# oresc is a open redirect scanner
url_flag=''
list_flag=''
print_usage() {
printf "Usage: \n -u url (e.g. https://example.com) \n -l list (e.g. urls.txt)"
}
YELLOW='\033[1;33m'
NO_COLOR='\033[0m'
no_args="true"
while getopts 'u:l:h' flag; do
case "${flag}" in
u) url_flag="${OPTARG}" ;;
l) list_flag="${OPTARG}" ;;
h) print_usage
exit 1 ;;
*) print_usage
exit 1 ;;
esac
no_args="false"
done
if [ "$no_args" == "true" ]
then
print_usage
exit
fi
if [ ! -z "$url_flag" ]
then
echo "$url_flag" > oresc-urls-to-check.txt
elif [ ! -z "$list_flag" ]
then
cat "$list_flag" > oresc-urls-to-check.txt
fi;
cat oresc-urls-to-check.txt | hakrawler -d 3 -dr -insecure -subs -timeout 1000 -u > urls.txt
cat oresc-urls-to-check.txt | waybackurls >> urls.txt
cat urls.txt \
| grep -a -i \=http \
| qsreplace "http://google.com" \
| while read target_url
do
if curl -s -L $target_url -I | grep -e "google.com" -e "HTTP" | grep -q " 301\| 302"
then
printf "${YELLOW}[:Vulnerable:]${NO_COLOR} $target_url \n"
fi
done;
rm oresc-urls-to-check.txt hakrawler.txt urls.txt
exit