BASH
root@oco:~$ enumWPAuthor.sh
#!/bin/bash
for i in {1..20}; do
res=$(curl -s -o /dev/null -w "%{http_code} %{redirect_url}" "http://blog.inlanefreight.local/?author=$i")
code=$(echo $res | cut -d' ' -f1)
if [[ $code == 200 || $code == 3* ]]; then
echo "Author ID $i => $res"
fi
done
* curl -s -L follows redirects silently
* -w "%{url_effective}" outputs the final URL after redirects
- if the ?author= parameter triggers a redirect (e.g., to /author/username/), then that username is usually the author’s login name
Last updated