|
Directory : /scripts2/ |
#!/bin/bash
# This script renames exploit-vulnerable xmlrpc.php files in WP sites to disable them.
# Config file routes
EXCLUDE_FILE="/etc/sitioshispanos/keep_xmlrpc"
# Probably faster to have this in memory this way
EXCLUDE_LIST=$(cat $EXCLUDE_FILE)
whmapi1 listaccts --output=jsonpretty | jq -r '.data.acct[].user' |
{ while read user; do
if echo "$EXCLUDE_LIST" | grep -qx "$user"; then
continue
else
find /home/"$user"/public_html -maxdepth 1 -name xmlrpc.php -exec mv -v {} {}.bak \;
fi
done
}