How to Scan a WordPress Site for Security Details: A Complete Technical Guide
To scan a WordPress site for security details, use remote scanners like WPScan or Sucuri SiteCheck to detect exposed software versions and public vulnerabilities, install server-side security plugins such as Wordfence or Patchstack for file integrity and malwa...
To scan a WordPress site for security details, use remote scanners like WPScan or Sucuri SiteCheck to detect exposed software versions and public vulnerabilities, install server-side security plugins such as Wordfence or Patchstack for file integrity and malware analysis, and execute WP-CLI commands to verify core system checksums against official repositories.
Contents
Understanding WordPress Security Scanning: Remote vs. Internal Scans
A comprehensive WordPress security audit requires evaluating both what is visible to the public internet and what exists on the hosting server. Security scanning generally falls into two distinct operational categories: remote (black-box) scanning and internal (white-box or server-side) scanning. Both approaches uncover critical security details, but they operate from different vantage points and reveal different classes of risk.
Remote security tools simulate an external attacker. They interact with your website exclusively over HTTP and HTTPS requests, analyzing server headers, visible HTML source code, public JavaScript files, exposed REST API endpoints, and cookie structures. These tools determine your WordPress core version, detect active themes and plugins, identify known public vulnerabilities listed in databases like the NVD (National Vulnerability Database), and flag misconfigured HTTP security headers. Remote scans carry virtually no risk of breaking a website and require zero installation, making them an ideal starting point for initial assessments. However, remote scans cannot examine server-side PHP code execution, hidden backdoor files, database contents, or file permission structures.
Internal scans, by contrast, run directly inside your WordPress environment or on the web hosting server. These methods use security plugins, web server log analyzers, or command-line interfaces like WP-CLI to audit file systems and database entries. Server-side scanners inspect the actual code of installed plugins and themes against signature databases of known malware, compute cryptographic checksums of core WordPress files to spot unauthorized modifications, and analyze active database tables for injected malicious scripts or compromised administrator accounts. While internal scans provide complete technical depth, they require administrative access and consume server CPU and memory resources during execution.
Prerequisites Before Scanning a WordPress Site
Before initiating any deep technical scan, complete essential preparatory steps to protect site availability, avoid false alarms, and stay within legal boundaries.
- Verify Scanning Authorization: Only perform intrusive scans on websites you own or have explicit, documented authorization to test. Unauthorized automated scanning against third-party servers can violate web host terms of service, trigger automatic IP blocks by hosting firewalls, or infringe upon computer fraud legislation.
- Create a Full Web Application Backup: Server-side scanning, file checksum verification, and automated malware cleanups involve reading and potentially modifying system files. Ensure you have a complete, off-site backup of your WordPress database and the entire
wp-content,wp-includes, andwp-admindirectory trees before installing internal scanning engines. - Whitelist Scanning IP Addresses: If your website relies on a Web Application Firewall (WAF) such as Cloudflare, Sucuri, or Fastly, automated scanning requests may be blocked or rate-limited. Temporary IP whitelisting ensures the scanner can complete its audit without receiving false
403 Forbiddenor429 Too Many Requestsstatus codes. - Establish Baseline Server Resources: Check available PHP memory limits and server execution limits. Deep malware signature scanning on large uploads directories requires sufficient resource allocation (typically 256MB PHP memory limit or higher) to avoid execution timeouts.
Method 1: Scanning External Surface and Exposure (Remote Tools)
Remote security scanning identifies what an external actor can learn about your site without authenticating. This step reveals version disclosures, known software vulnerabilities, and web server configuration gaps.
Using WPScan for Automated Vulnerability Detection
WPScan is a dedicated vulnerability scanner maintained by Automattic that checks WordPress core, plugin, and theme files against an extensive database of known security flaws. It can be run as a command-line utility or integrated into automated CI/CD pipelines.
To execute a basic enumeration scan using the WPScan CLI, run the following command in your terminal:
wpscan --url https://example.com --enumerate p,t,u --api-token YOUR_WPSCAN_API_TOKEN
This command instructs the scanner to:
- Enumerate Plugins (
p): Scan for active and passive indicators of installed plugins, matching their version numbers against registered CVEs (Common Vulnerabilities and Exposures). - Enumerate Themes (
t): Identify active and fallback parent/child themes. - Enumerate Users (
u): Detect valid user accounts by probing author archives and the WordPress REST API endpoint (/wp-json/wp/v2/users).
WPScan flags outdated components with specific security ratings, identifying whether an installed plugin version contains arbitrary file upload, cross-site scripting (XSS), SQL injection (SQLi), or remote code execution (RCE) vulnerabilities.
Analyzing Web Server and HTTP Security Headers
Security details extend beyond application-level code to include web server header configurations. Tools like Sucuri SiteCheck and OWASP-aligned header checkers evaluate whether your server forces modern security protocols.
Key security headers to audit include:
- Strict-Transport-Security (HSTS): Enforces HTTPS connections and prevents man-in-the-middle downgrade attacks.
- Content-Security-Policy (CSP): Restricts the sources from which scripts, stylesheets, and images can load, neutralizing most reflective and stored XSS vectors.
- X-Frame-Options: Prevents your site from being embedded in
tags on external domains, mitigating clickjacking risks. - X-Content-Type-Options: Set to
nosniffto prevent browsers from MIME-sniffing response payloads into executable script types.
Method 2: Running Internal Server-Side and Database Scans
While remote scanners evaluate surface exposure, internal tools inspect code integrity, database safety, and hidden system backdoors.
File Integrity Verification via WP-CLI
The WordPress Command Line Interface (WP-CLI) provides an efficient way to verify core code integrity directly on the server without installing third-party plugins. WP-CLI compares local core files against original SHA-256 cryptographic hashes maintained in official WordPress repositories.
Connect to your server via SSH and execute the following core verification command:
wp core verify-checksums
If the core installation is clean, the command returns a success confirmation. If files have been modified, added, or deleted within core directories (wp-includes, wp-admin), WP-CLI outputs exact file paths and discrepancy details:
Warning: File doesn't verify against checksum: wp-includes/formatting.php Warning: File should not exist: wp-includes/malicious_backdoor.php
You can similarly verify installed plugins hosted on the official WordPress plugin repository by executing:
wp plugin verify-checksums --all
Any checksum mismatch in core or plugin files indicates either unauthorized code tampering, incomplete updates, or manual modifications that breach security best practices.
Plugin-Based Security Scans
For website administrators who prefer an integrated dashboard, server-side security plugins offer continuous file monitoring and automated signature matching.
- Wordfence Security: Features a built-in scanner that checks site files, core code integrity, theme files, and plugin files against known malware signatures, web shell patterns, and malicious URLs. It also monitors database tables for injected spam links.
- Patchstack: Focuses heavily on real-time vulnerability detection by cross-referencing your site's exact component state with verified plugin security advisories, alerting administrators before exploits affect production environments.
- Solid Security (formerly iThemes Security): Audits overall configuration health, checks file permission attributes (ensuring
.htaccessandwp-config.phpmaintain restricted0644or0600permissions), and monitors user account activity.
Comparing WordPress Security Scanning Approaches
Selecting the right scanning technique depends on your administrative access level, technical capability, and evaluation goals. The following table compares the primary scanning methodologies across key technical metrics:
| Scanning Category | Primary Tools | What It Detects | System Access Required | Performance Impact |
|---|---|---|---|---|
| Remote Surface Scanner | WPScan CLI, Sucuri SiteCheck | Public version leaks, known component CVEs, basic blacklist status, header flaws | Public URL only | Negligible (External HTTP requests) |
| Header & Protocol Analyzer | SecurityHeaders.com, SSL Labs | Missing HSTS, weak CSP, SSL/TLS protocol flaws, cipher suite weaknesses | Public Domain / IP | None |
| Server-Side File Integrity | WP-CLI (verify-checksums) |
Modified core files, unauthorized file additions, code drift | SSH / Server Terminal | Low (Fast CLI file comparison) |
| Plugin Malware Scanner | Wordfence, Patchstack, Solid Security | Web shells, injected obfuscated PHP scripts, database spam, unauthorized admin creation | WordPress Admin Dashboard | Moderate to High (Disk read & CPU usage) |
| Log & Behavior Analyzer | GoAccess, Server Access Logs (access.log) |
Brute-force attacks, directory traversal attempts, zero-day path probing | Server File System | Low (Asynchronous log reading) |
How to Interpret Security Scan Reports and Vulnerability Metrics
Security scan reports yield detailed technical data that must be prioritized based on threat severity. Standardized scoring systems help categorize findings so high-risk items are addressed first.
Understanding CVSS Scores
Most vulnerability scanners map findings to the Common Vulnerability Scoring System (CVSS) framework. CVSS scores range from 0.0 (Informational) to 10.0 (Critical):
- Critical (9.0–10.0): Requires immediate remediation. Examples include unauthenticated Remote Code Execution (RCE) or SQL Injection vulnerabilities that allow remote database extraction or server compromise.
- High (7.0–8.9): Serious security flaws such as authenticated Privilege Escalation (allowing subscriber accounts to gain administrative permissions) or arbitrary file uploads.
- Medium (4.0–6.9): Conditional risks, including Cross-Site Scripting (XSS) requiring specific user interaction or CSRF (Cross-Site Request Forgery) flaws.
- Low / Informational (0.0–3.9): Minor disclosures, such as public display of the WordPress version tag or visible full path disclosures in error messages.
Distinguishing False Positives from Active Threats
Not every flagged item in a scan represents an active breach. A false positive occurs when a scanner flags legitimate code as malicious—often caused by custom developer hooks, obfuscated licensing code, or framework utilities that utilize functions like eval(), base64_decode(), or gzuncompress().
To differentiate a false positive from a genuine threat:
- Examine the File Path: Malicious web shells often reside in transient upload folders (e.g.,
wp-content/uploads/2026/03/shell.php) or obscure subdirectories disguised as core names (e.g.,wp-includes/images/icon.php). - Review Code Context: Open the flagged file in a secure editor. Legitimate plugins maintain organized inline documentation and standard naming conventions, whereas malicious payloads rely on heavily randomized variable names, long encoded strings, or suppressed error calls (
@eval(...)). - Cross-Reference Repository Checksums: Run
wp plugin verify-checksumsto confirm whether the altered file matches the developer's official deployment hash.
Critical Security Details to Check Beyond Basic Scans
Standard automated tools occasionally overlook deep structural misconfigurations. Audit these critical server and application endpoints manually to ensure full system coverage.
REST API and User Enumeration Exposures
By default, the WordPress REST API exposes public user profiles via the standard JSON endpoint:
https://example.com/wp-json/wp/v2/users
Querying this URL returns a JSON payload containing registered user IDs, display names, and published slug names. Attackers use these usernames to launch targeted brute-force login attacks against /wp-login.php or XML-RPC endpoints.
To check if user data is exposed, open the endpoint URL in your browser or run a cURL command:
curl -i https://example.com/wp-json/wp/v2/users
If the endpoint returns HTTP status 200 OK along with valid user objects, restrict REST API user endpoints to authenticated requests using code snippets or dedicated security plugin rules.
XML-RPC Endpoint Availability
The legacy xmlrpc.php file remains enabled by default in many WordPress installations to support legacy third-party publishing tools. However, it allows attackers to execute brute-force credential amplification attacks (testing hundreds of password combinations in a single HTTP request) and participate in reflected Denial of Service (DoS) attacks.
Test your XML-RPC availability by issuing a POST request:
curl -i -X POST https://example.com/xmlrpc.php
If the server returns XML-RPC server accepts POST requests only with an HTTP status 405 or 200, the endpoint is active and exposed. Block access to xmlrpc.php at the web server layer (.htaccess for Apache or Nginx configuration blocks) unless your workflow explicitly depends on it.
File and Directory Permissions
Insecure file system permissions allow unauthorized processes on shared hosting environments to read sensitive configurations or overwrite web files.
Verify that your file permissions strictly adhere to established standards:
- Directories:
755(or750for tighter web server isolation). - Standard Files:
644(or640). - Configuration Files (
wp-config.php):600or640, preventing standard web server users from reading database access credentials.
Frequently Asked Questions
Can external remote scanners detect malware hidden inside WordPress core files?
No. External remote scanners can only evaluate public HTTP responses, visible HTML source code, public scripts, and HTTP server headers. They cannot access your underlying server file system to inspect PHP code execution or detect internal backdoors inserted into deep core directories. Detecting internal file modifications requires server-side tools such as WP-CLI checksum verification or internal security plugins.
How often should a WordPress site undergo security scans?
Automated light remote scans and plugin-based file integrity checks should run daily. Complete server-side deep malware scans, database inspections, and dependency audits should occur weekly or immediately following major plugin updates, server migrations, or detected security incidents.
Does running a security scan affect website performance?
Remote external scans have minimal impact on server performance unless they run aggressive rate-unlimited brute-force modules. However, internal server-side malware scans read thousands of files and execute complex database queries, which can consume significant CPU and RAM resources. Schedule deep internal scans during off-peak traffic hours to prevent performance slowdowns for visitors.
What should I do if a scan reports a vulnerability in an inactive plugin?
Inactive or disabled plugins still reside on your web server file system and can be directly accessed and executed by attackers over HTTP requests if security flaws exist. You should immediately delete inactive plugins entirely through the WordPress admin dashboard or via WP-CLI rather than simply leaving them deactivated.
What is the difference between vulnerability scanning and malware scanning?
Vulnerability scanning identifies security weaknesses, outdated software versions, missing security headers, and known design flaws (CVEs) that could allow an attacker to compromise your site. Malware scanning checks your system for actual evidence of an active infection, such as malicious PHP web shells, injected spam scripts, redirect code, or modified core files.
Actionable Next Steps: Remediating Vulnerabilities and Hardening
After completing your security scan and compiling the resulting technical details, follow a structured remediation plan:
- Apply Updates and Patches Immediately: Update WordPress core, active themes, and all installed plugins to their latest stable releases to patch flagged CVEs.
- Replace Compromised or Unverified Files: If WP-CLI reports checksum errors in core components, re-install core files securely using
wp core download --force --skip-content. - Enforce Strong Credentials and Two-Factor Authentication (2FA): Terminate suspicious administrative sessions, force user password resets, and implement 2FA across all privileges above Subscriber level.
- Deploy a Web Application Firewall (WAF): Integrate a cloud firewall or server-level WAF to inspect incoming HTTP/HTTPS traffic, blocking malicious requests, SQL injection attempts, and automated bots before they reach your WordPress application.
- Establish Continuous Monitoring: Set up automated email or webhook alerts for file system modifications, unexpected administrative user creation, and failed login spikes to maintain an ongoing security defense.