-
Notifications
You must be signed in to change notification settings - Fork 2
/
force.sh
99 lines (87 loc) · 2.29 KB
/
force.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
#!/bin/bash
r='\033[0;31m' # red
g='\033[0;32m' # green
b='\033[0;34m' # blue
n='\033[0m' # no color
show_usage() {
echo "usage: $0 [options]"
echo "-h, --help [show help message]"
echo "-i, --information [show information tools]"
echo
}
show_information() {
echo "information:"
echo "name: X-Force"
echo "version: 1.0.0"
echo "author: msverse.site"
echo "homepage: https://www.msverse.site"
echo
}
show_target_arguments() {
echo "target arguments:"
echo "-u, --url [target url]"
echo "-w, --wordlist [wordlist file]"
echo "-t, --thread [numbers of threading (default: 5)]"
echo
}
DOMAIN=""
WORDLIST=""
THREAD=5
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-u|--url)
DOMAIN="$2"
shift 2
;;
-w|--wordlist)
WORDLIST="$2"
shift 2
;;
-t|--thread)
THREAD="$2"
shift 2
;;
-h|--help)
show_usage
show_target_arguments
exit 0
;;
-i|--information)
show_information
exit 0
;;
*)
shift
;;
esac
done
if [[ -z $DOMAIN ]] || [[ -z $WORDLIST ]]; then
show_usage
exit 1
fi
clear
echo -e "${b}
____ ___ ___________
\ \/ / \_ _____/__________ ____ ____
\ / ______ | __)/ _ \_ __ \_/ ___\/ __ \
/ \ /_____/ | \( <_> ) | \/\ \__\ ___/
/___/\ \ \___ / \____/|__| \___ >___ >
\_/ \/ \/ \/${n} "
echo -e "${r}[${g} $DOMAIN ${r}] ${n}|| ${r}[${g} $WORDLIST ${r}] ${n}|| ${r}[${g} $THREAD ${r}]${n}"
start_time=$(date +"%Y-%m-%d %H:%M:%S")
echo -e "${r}[${g} $start_time ${r}]${n} starting program"
found_file="found.txt"
notfound_file="notfound.txt"
while IFS= read -r word; do
url="https://$DOMAIN/$word"
result=$(curl -s -o /dev/null -w "%{http_code}" "$url")
if [[ $result -eq 200 ]]; then
echo "$url => found" >> "$found_file"
else
echo "$url => notfound" >> "$notfound_file"
fi
done < "$WORDLIST"
end_time=$(date +"%Y-%m-%d %H:%M:%S")
echo -e "${r}[${g} $end_time ${r}]${n} status complete"
echo -e "${r}[${g} $end_time ${r}]${n} data save ${r}[${g} $found_file ${r}] ${n}|| ${r}[${g} $notfound_file ${r}]${n}"