Sh3ll



Directory :  /scripts2/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

Current File : //scripts2/cpanel_clean_xmlrpc.sh
#!/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
}

Sh3LL