forked from gwen001/pentest-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebdav-bruteforce.sh
More file actions
executable file
·63 lines (45 loc) · 883 Bytes
/
webdav-bruteforce.sh
File metadata and controls
executable file
·63 lines (45 loc) · 883 Bytes
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
#!/bin/bash
source myutils.sh
function usage() {
echo "Usage: "$0" <url> <wordlist>"
if [ -n "$1" ] ; then
echo "Error: "$1"!"
fi
exit
}
function test() {
local url=$1
local wordlist=$2
for w in $(cat $2) ; do
read -t 0.1 -s -r -n 1
if [ "$REPLY" = "n" ] ; then
echo
echo "Skipping directory..."
return
fi
ww=`echo $w | tr "/" "-"`
current=$url"/"$ww
echo
_print "Testing: "$current
res=`davtest -url $current 2>/dev/null`
found=`echo $res | grep SUCCEED | wc -w`
if [ ! $found -eq 0 ] ; then
_print " FOUND!" RED
test $current $wordlist
fi
done
}
if [ ! $# -eq 2 ] ; then
usage
fi
url=$1
wordlist=$2
if ! [ -f $wordlist ] ; then
usage "wordlist not found"
fi
url="${url%"${url##*[![:space:]]}"}"
url="${url%"${url##*[!/]}"}"
test $url $wordlist
echo
echo
exit