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

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2021-31630 PoC — OpenPLC 代码注入漏洞

Source
Associated Vulnerability
Title:OpenPLC 代码注入漏洞 (CVE-2021-31630)
Description:OpenPLC是一种开源的可编程逻辑控制器。可为自动化和研究提供低成本的工业解决方案。 OpenPLC v3 存在代码注入漏洞,该漏洞源于产品的web服务中 /hardware 页面的Hardware Layer Code Box组件未能过滤输入的特殊字符。攻击者可通过该漏洞执行系统命令。
Description
A version of the PoC for CVE-2021-31630 from https://github.com/Hunt3r0x/CVE-2021-31630-HTB but without the political messages, because they are unneccessary.
Readme
## CVE-2021-31630 Exploit
This PoC was originally developed by [Hunt3r0x](https://github.com/Hunt3r0x/CVE-2021-31630-HTB) but I found the political messages to be, quite unnecessary for a HackTheBox PoC so I republished it removing that as well as fixing some typos.

## Usage

```bash
python exploit.py -ip <IP_ADDRESS_FOR_LISTEN> -p <PORT_FOR_LISTEN> -u <USERNAME> -pwd <PASSWORD>
```
```bash
python ./exploit.py -ip 10.10.16.5 -p 1337 -u openplc -pwd openplc
```

### Arguments

- `-ip`  <IP_ADDRESS>: Specifies the IP address to listen on.
- `-p`   <PORT>: Specifies the port to listen on.
- `-u`   <USERNAME>: Specifies the username for OpenPLC login.
- `-pwd` <PASSWORD>: Specifies the password for OpenPLC login.

## Description

This script exploits the CVE-2021-31630 vulnerability in OpenPLC, allowing remote code execution on the WifineticTwo box. It establishes a connection to the target IP and port, authenticates with the provided username and password, and uploads a malicious payload to execute arbitrary code.

## Author

Created by [z1ntrx](https://github.com/Hunt3r0x), modified by [sealldev](https://github.com/sealldeveloper)

## Disclaimer

This script is intended for educational and testing purposes only. Use it responsibly and only on systems you have explicit permission to test.
File Snapshot

[4.0K] /data/pocs/038c2c2df3669357716446662a5f3ff9b75dcf59 ├── [4.4K] main.py └── [1.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.