Skip to content

Instantly share code, notes, and snippets.

@greg-randall
Last active December 9, 2021 15:31
Show Gist options
  • Select an option

  • Save greg-randall/d6b5d7fc826832d1d3d300d23b9966c9 to your computer and use it in GitHub Desktop.

Select an option

Save greg-randall/d6b5d7fc826832d1d3d300d23b9966c9 to your computer and use it in GitHub Desktop.
Scans a list of domains for their WordPress version and outputs a CSV.
FILENAME="domains.txt"
LINES=$(cat $FILENAME)
echo "Domain, Version" > domains_with_versions.csv
for LINE in $LINES
do
CHECKLOCATION="${LINE}/feed/"
VERSION=` curl -s $CHECKLOCATION | grep -i "<generator>" | grep -E "\d+\.\d+\.\d+" --only-matching `
echo "$LINE, $VERSION"
echo "$LINE, $VERSION" >> domains_with_versions.csv
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment