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

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2022-0543 PoC — Redis 代码注入漏洞

Source
Associated Vulnerability
Title: Redis 代码注入漏洞 (CVE-2022-0543)
Description:It was discovered, that redis, a persistent key-value database, due to a packaging issue, is prone to a (Debian-specific) Lua sandbox escape, which could result in remote code execution.
Description
CVE-2022-0543 - Redis RCE Vulnerability home lab for Red Teaming, Penetration Testing Training with just one DOCKER
Readme
# CVE-2022-0543 — Redis Lua Sandbox Escape (Remote Code Execution)

---

## CVE‑2022‑0543 — Redis Lua Sandbox Escape คืออะไร?

<p align="center">
  <img width="500" height="500" alt="20220543" src="https://github.com/user-attachments/assets/084ad041-8a1e-438e-8480-3a3f78f534dd" />
</p>

ช่องโหว่นี้เกิดเฉพาะบน **Redis ที่ติดตั้งผ่าน Debian / Ubuntu package** เท่านั้น  
เพราะ Redis ถูกคอมไพล์พร้อม Lua engine แบบ dynamic module (`lua-cjson`, `lua-bitop`) ทำให้ผู้โจมตีสามารถเรียกใช้:

```
package.loadlib()
```

เพื่อโหลดฟังก์ชัน IO ของระบบ และรันคำสั่งใน Host ซึ่งทำให้เกิด **Remote Code Execution (RCE)**

---

## Lab นี้จำลองอะไร?

- Redis เวอร์ชันที่มีช่องโหว่
- Lua engine เปิด `package.loadlib`
- เปิด Redis แบบไม่มี password
- Flag สร้างใหม่ทุกครั้งที่ container start
- PoC ทำงานได้จริง

---

## วิธีใช้งาน Lab

### 1) Build

```
docker compose build
```

### 2) Run

```
docker compose up -d
```

### 3) Test

```
redis-cli -h localhost -p 6379 ping
```

---

## การใช้ PoC

PoC:
```
https://github.com/0x7eTeam/CVE-2022-0543
```

---

# English Version

## What is CVE‑2022‑0543?

This is a **Debian-specific Redis RCE** caused by improper Lua sandboxing.  
The Redis Debian package loads Lua modules dynamically, exposing:

```
package.loadlib()
```

allowing a full escape → host OS command execution.

---

## What This Lab Simulates

- Vulnerable Redis
- Lua engine with unrestricted loadlib  
- Redis exposed without password  
- Auto flag generator  
- PoC works exactly as real-world exploitation  

---

## Usage

### Build

```
docker compose build
```

### Start

```
docker compose up -d
```

### Test

```
redis-cli -h localhost -p 6379 ping
```

---

## PoC Usage

PoC:
```
https://github.com/0x7eTeam/CVE-2022-0543
```

---

## Notes

- For education only  
- Do not use on production  
- This lab is intentionally vulnerable  

File Snapshot

Log in to view the POC file snapshot cached by Shenlong Bot

Log in to view
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →