Skip to content

Instantly share code, notes, and snippets.

@xyzkab
Created August 10, 2020 04:18
Show Gist options
  • Save xyzkab/df4abdd18368436d928ccc346340b3ef to your computer and use it in GitHub Desktop.
Save xyzkab/df4abdd18368436d928ccc346340b3ef to your computer and use it in GitHub Desktop.
Just a quick check for what methods allowed in http directory when hunting for webdav
#!/bin/bash
function help() {
echo "Usage: $0 [target-url|target-url-file]"
echo "Example: $0 http://example.com/test/"
echo " $0 enumeration/gobuster/port_80_initial.txt"
}
[ ! -f /usr/share/seclists/Discovery/Web-Content/web-extensions.txt ] && echo "Error: We need https://github.com/danielmiessler/SecLists/blob/master/Discovery/Web-Content/web-extensions.txt" && exit 0
[ -z "$1" ] || [ ! -f "$1" ] && help && exit 0
[ -f "$1" ] && targets=$(cat $1 | sort -u)
exts=$(cat /usr/share/seclists/Discovery/Web-Content/web-extensions.txt)
for target in $(echo "$targets" | awk '{print $1}'); do
target=${target%/}
ext=$(awk -F'/' '{print $NF}' <<< $target | awk -F'.' '{print $NF}')
[ -n "$(grep -w $ext <<< $exts)" ] && continue
methods=$(curl -sIXOPTIONS $target/ | grep 'Allow: ' | awk '{print $NF}')
methods=${methods:-"None"}
echo "$target | $methods"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment