Skip to content

Instantly share code, notes, and snippets.

@deadbok
Created June 16, 2016 13:33
Show Gist options
  • Save deadbok/5ac8645383440902fd699c911326a144 to your computer and use it in GitHub Desktop.
Save deadbok/5ac8645383440902fd699c911326a144 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# Try to dertermine if a site is driven by WordPress
#
# 2016 by Martin Bo Kristensen Grønholdt
echo -n "" > $2
while read url
do
curl -s ${url} > index.tmp
#Test for "Wordpress" on the index page
if grep "WordPress" index.tmp > /dev/null
then
echo "${url}" >> $2
echo "WordPress: ${url}"
else
#Test for "Divi" on the index page
if grep "Divi" index.tmp > /dev/null
then
echo "${url}" >> $2
echo "Divi: ${url}"
else
#Test for wp-core-ui css on the Worpress Login page
curl -s -L ${url}/wp-admin > index.tmp
if grep "wp-core-ui" index.tmp > /dev/null
then
echo "${url}" >> $2
echo "WordPress login: ${url}"
else
echo "Unknown: ${url}"
fi
fi
fi
done < $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment