📁
SKYSHELL MANAGER
PHP v8.3.31
Create
Create
Path:
root
/
home
/
firadelllibrepro
/
alsahwanet.net
/
Name
Size
Perm
Actions
📁
.well-known
-
0755
🗑️
🏷️
🔒
📁
cgi-bin
-
0755
🗑️
🏷️
🔒
📁
wp-admin
-
0755
🗑️
🏷️
🔒
📁
wp-content
-
0555
🗑️
🏷️
🔒
📁
wp-includes
-
0755
🗑️
🏷️
🔒
📄
.htaccess
0.78 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
.htaccess.bak.20250916123008
0.89 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
403.shtml
0.2 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
404.shtml
0.2 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
500.shtml
0.24 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
cp_errordocument.shtml
10.43 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
index.php
0.4 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
license.txt
19.44 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
readme.181cd17672105da14ef50304b037da0e.html
7.23 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
robots.txt
0.2 KB
0664
🗑️
🏷️
⬇️
✏️
🔒
📄
robots.txt.bak
0.05 KB
0664
🗑️
🏷️
⬇️
✏️
🔒
📄
wordfence-waf.php
0.32 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-activate.php
7.2 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-blog-header.php
0.34 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-comments-post.php
2.27 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-config-sample.php
3.26 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-config.php
3.52 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-cron.php
5.49 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-links-opmI.php
0 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-links-opml.php
2.43 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-load.php
3.84 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-login.php
50.63 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-mail.php
8.52 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-settings.php
31.88 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-signup.php
33.81 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-trackback.php
5.09 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
xmlrpc.php
3.13 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
Edit: wp-admin-replace.log
#!/usr/bin/env bash # import-wordfence-settings.sh # Bulk-import Wordfence settings using export token, with options to restrict # to a nominated domain or a specific site path. Supports custom plugin dir # wp-content/plugiins and skips /home/virtfs. set -euo pipefail shopt -s nullglob usage() { cat <<'EOF' Usage: sudo ./import-wordfence-settings.sh -t "<WordfenceExportToken>" [options] Options: -t, --token STRING (required) Wordfence export token from Tools > Import/Export --dry-run Discover + print targets only; do not activate/import --account NAME Limit scan to a single /home/ACCOUNT --domain DOMAIN Only process this domain's folder(s), e.g. example.com Matches: /home/*/example.com and /home/*/public_html/example.com (For primary domains in /home/*/public_html, use --path.) --path DIR Exact site root (absolute), e.g. /home/user/public_html -h, --help Show help Notes: - Scans /home/*/DOMAIN.TLD, /home/*/public_html, and /home/*/public_html/* (domain-like) - Skips /home/virtfs - Works with both wp-content/plugins and wp-content/plugiins - Uses WP-CLI if available; otherwise PHP fallback EOF } TOKEN="" DRYRUN=0 ONLY_ACCOUNT="" ONLY_DOMAIN="" ONLY_PATH="" while (( "$#" )); do case "${1:-}" in -t|--token) TOKEN="${2:-}"; shift 2;; --dry-run) DRYRUN=1; shift;; --account) ONLY_ACCOUNT="${2:-}"; shift 2;; --domain) ONLY_DOMAIN="${2:-}"; shift 2;; --path) ONLY_PATH="${2:-}"; shift 2;; -h|--help) usage; exit 0;; *) echo "[ERR] Unknown argument: $1" >&2; usage; exit 2;; esac done [[ -n "$TOKEN" ]] || { echo "[ERR] Missing --token"; usage; exit 2; } is_domainlike_dir() { local bn="$1" [[ "$bn" == *.* && "$bn" != "public_html" ]] } have_wpcli=0 command -v wp >/dev/null 2>&1 && have_wpcli=1 # ---- If --path is provided, use it directly (after quick checks) ------------ if [[ -n "$ONLY_PATH" ]]; then if [[ "$ONLY_PATH" == /home/virtfs* ]]; then echo "[ERR] --path points into /home/virtfs, refusing." >&2 exit 2 fi if [[ ! -d "$ONLY_PATH" ]]; then echo "[ERR] --path not found: $ONLY_PATH" >&2 exit 2 fi if [[ ! -f "$ONLY_PATH/wp-config.php" ]]; then echo "[ERR] --path does not look like a WP root (missing wp-config.php): $ONLY_PATH" >&2 exit 2 fi roots=( "$ONLY_PATH" ) else # ---- Discovery across accounts (unless --account is set) ------------------ accounts=() if [[ -n "$ONLY_ACCOUNT" ]]; then accounts=( "/home/$ONLY_ACCOUNT" ) else for d in /home/*; do [[ -d "$d" ]] || continue [[ "$d" == "/home/virtfs" || "$d" == /home/virtfs/* ]] && continue accounts+=( "$d" ) done fi roots=() for acc in "${accounts[@]}"; do # /home/ACCOUNT/DOMAIN.TLD for d in "$acc"/*; do [[ -d "$d" ]] || continue bn="${d##*/}" [[ "$bn" == "virtfs" ]] && continue is_domainlike_dir "$bn" && roots+=( "$d" ) done # /home/ACCOUNT/public_html if [[ -d "$acc/public_html" ]]; then roots+=( "$acc/public_html" ) # /home/ACCOUNT/public_html/DOMAIN.TLD for d in "$acc/public_html"/*; do [[ -d "$d" ]] || continue bn="${d##*/}" is_domainlike_dir "$bn" && roots+=( "$d" ) done fi done fi # ---- Filter to WordPress roots and apply --domain if provided --------------- declare -A seen uniq_roots=() for r in "${roots[@]}"; do [[ "$r" == "/home/virtfs" || "$r" == /home/virtfs/* ]] && continue [[ -f "$r/wp-config.php" ]] || continue if [[ -n "$ONLY_DOMAIN" ]]; then bn="${r##*/}" parent="${r%/*}" parent_bn="${parent##*/}" if [[ "$bn" != "$ONLY_DOMAIN" && ! ( "$parent_bn" == "public_html" && "$bn" == "$ONLY_DOMAIN" ) ]]; then # Not a direct domain folder or public_html/domain match; skip. continue fi fi [[ -z "${seen[$r]+x}" ]] && { uniq_roots+=( "$r" ); seen[$r]=1; } done echo "[INFO] Candidate WordPress roots found: ${#uniq_roots[@]}" printf ' - %s\n' "${uniq_roots[@]:-}" (( DRYRUN )) && { echo "[DRY-RUN] Stopping before import."; exit 0; } ok=0; skipped=0; errors=0 for root in "${uniq_roots[@]}"; do owner="$(stat -c '%U' "$root" 2>/dev/null || stat -f '%Su' "$root" 2>/dev/null || echo root)" echo "------------------------------------------------------------------" echo "[INFO] Site: $root (owner: $owner)" # Ensure Wordfence is present (and active if we have WP-CLI) if (( have_wpcli )); then if sudo -u "$owner" wp --path="$root" plugin is-installed wordfence >/dev/null 2>&1; then if ! sudo -u "$owner" wp --path="$root" plugin is-active wordfence >/dev/null 2>&1; then echo "[INFO] Activating Wordfence..." if ! sudo -u "$owner" wp --path="$root" plugin activate wordfence; then echo "[ERR] Could not activate Wordfence at $root" errors=$((errors+1)); continue fi fi else echo "[WARN] Wordfence not installed at $root. Skipping." skipped=$((skipped+1)); continue fi else # No WP-CLI: presence check in both standard and custom plugin dirs if [[ ! -d "$root/wp-content/plugins/wordfence" && ! -d "$root/wp-content/plugiins/wordfence" ]]; then echo "[WARN] Wordfence plugin not found under plugins/plugiins. Skipping." skipped=$((skipped+1)); continue fi fi # Try WP-CLI eval first if (( have_wpcli )); then echo "[INFO] Importing Wordfence settings via WP-CLI..." if sudo -u "$owner" wp --path="$root" eval "if (class_exists('wordfence')) { wordfence::importSettings('${TOKEN//\'/\'\"\'\"\'}'); echo 'OK'; } else { echo 'NO_WF_CLASS'; }"; then echo "[OK] Import completed at $root" ok=$((ok+1)); continue else echo "[WARN] WP-CLI eval failed at $root. Trying PHP fallback..." fi fi # PHP fallback (with custom plugin-dir support) if [[ -f "$root/wp-load.php" ]]; then php -d detect_unicode=0 -r " define('WP_USE_THEMES', false); chdir('$root'); require_once 'wp-load.php'; if (!class_exists('wordfence')) { @include_once 'wp-content/plugins/wordfence/wordfence.php'; } if (!class_exists('wordfence')) { @include_once 'wp-content/plugiins/wordfence/wordfence.php'; } if (class_exists('wordfence')) { wordfence::importSettings('$(printf "%s" "$TOKEN" | sed "s/'/'\"'\"'/g")'); echo 'OK'; } else { fwrite(STDERR, 'Wordfence class not found after includes.'); exit(2); } " && { echo; echo "[OK] Import completed at $root (PHP fallback)"; ok=$((ok+1)); } || { echo; echo "[ERR] PHP fallback failed at $root" errors=$((errors+1)) } else echo "[ERR] wp-load.php not found; cannot run PHP fallback at $root" errors=$((errors+1)) fi done echo "------------------------------------------------------------------" echo "[SUMMARY] Sites OK: $ok, Skipped: $skipped, Errors: $errors" exit $(( errors>0 ? 1 : 0 ))
Save