# berabuddies/redis-poc architecture

> Architecture diagram of the GitHub repository berabuddies/redis-poc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/berabuddies/redis-poc
- Repository: https://github.com/berabuddies/redis-poc

## Overview

This repository is a collection of Redis proof-of-concept exploit clients for specific Redis and bundled RedisBloom versions. The operator selects a client, which connects to Redis and attempts a version-specific memory-corruption chain; successful runs execute the supplied trigger. The main branches cover stream consumer-group shared-NACK bugs and RedisBloom TDigest/TopK bugs. Shared helpers construct protocol and serialized payloads, while CRC-64 support enables valid RESTORE payloads. Edges reflect the README and shown imports/calls; several internal exploit stages are documented but not fully excerpted, so they are represented at the client level rather than as speculative components.

Main entry points: [`A_lib.py`](https://github.com/berabuddies/redis-poc/blob/main/A_lib.py) (Stream Payload Helpers), [`A_exploit_stock.py`](https://github.com/berabuddies/redis-poc/blob/main/A_exploit_stock.py) (Redis 6.2.22 Client), [`P74_exploit.py`](https://github.com/berabuddies/redis-poc/blob/main/P74_exploit.py) (Redis 7.4.9 Client), [`P88W_exploit.py`](https://github.com/berabuddies/redis-poc/blob/main/P88W_exploit.py) (TDigest Exploit)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_stream["Stream NACK Exploits"]
  node_stock62["Redis 6.2.22 Client<br/>[A_exploit_stock.py]"]
  node_g2read["Arbitrary Read<br/>[G2_arbread.py]"]
  node_redis74["Redis 7.4.9 Client<br/>[P74_exploit.py]"]
  node_g274["7.4 Reclaim<br/>[P74_g2.py]"]
  node_redis86["Redis 8.6.4 Client<br/>[P86_exploit.py]"]
end

subgraph group_bloom["RedisBloom Exploits"]
  node_tdigest["TDigest Exploit<br/>[P88W_exploit.py]"]
  node_tdcorrupt["TDigest Corruption<br/>[P88W_corrupt.py]"]
  node_tdhelper["TDigest Helpers<br/>[P88W_lib.py]"]
  node_topk["TopK Exploit<br/>[T88_exploit.py]"]
end

subgraph group_shared["Payload Helpers"]
  node_streamhelpers["Stream Payload Helpers<br/>[A_lib.py]"]
end

subgraph group_crc["CRC Support"]
  node_crc["CRC-64 Core<br/>[crc64.c]"]
  node_crcspeed["CRC Speed Routines<br/>[crcspeed.c]"]
  node_crcapi["CRC Interfaces<br/>[crcspeed.h]"]
end

node_operator(("Operator"))
node_redis["Redis Target"]
node_trigger["Command Result"]

node_operator -->|"runs client"| node_stock62
node_operator -->|"runs client"| node_redis74
node_operator -->|"runs client"| node_redis86
node_operator -->|"runs client"| node_tdigest
node_operator -->|"runs client"| node_topk
node_stock62 -->|"sends commands"| node_redis
node_redis74 -->|"sends commands"| node_redis
node_redis86 -->|"sends commands"| node_redis
node_tdigest -->|"sends commands"| node_redis
node_topk -.->|"sends commands"| node_redis
node_redis -->|"executes trigger"| node_trigger
node_stock62 -->|"uses helpers"| node_streamhelpers
node_stock62 -->|"calls read primitive"| node_g2read
node_redis74 -->|"uses reclaim"| node_g274
node_redis74 -->|"uses helpers"| node_streamhelpers
node_redis86 -->|"uses helpers"| node_streamhelpers
node_tdigest -->|"uses corruption logic"| node_tdcorrupt
node_tdigest -->|"uses payload helpers"| node_tdhelper
node_topk -->|"uses helpers"| node_streamhelpers
node_streamhelpers -->|"computes payload CRC"| node_crc
node_crc -->|"uses speed routines"| node_crcspeed
node_crcspeed -->|"uses declarations"| node_crcapi

click node_stock62 "https://github.com/berabuddies/redis-poc/blob/main/A_exploit_stock.py"
click node_g2read "https://github.com/berabuddies/redis-poc/blob/main/G2_arbread.py"
click node_redis74 "https://github.com/berabuddies/redis-poc/blob/main/P74_exploit.py"
click node_g274 "https://github.com/berabuddies/redis-poc/blob/main/P74_g2.py"
click node_redis86 "https://github.com/berabuddies/redis-poc/blob/main/P86_exploit.py"
click node_tdigest "https://github.com/berabuddies/redis-poc/blob/main/P88W_exploit.py"
click node_tdcorrupt "https://github.com/berabuddies/redis-poc/blob/main/P88W_corrupt.py"
click node_tdhelper "https://github.com/berabuddies/redis-poc/blob/main/P88W_lib.py"
click node_topk "https://github.com/berabuddies/redis-poc/blob/main/T88_exploit.py"
click node_streamhelpers "https://github.com/berabuddies/redis-poc/blob/main/A_lib.py"
click node_crc "https://github.com/berabuddies/redis-poc/blob/main/crc64.c"
click node_crcspeed "https://github.com/berabuddies/redis-poc/blob/main/crcspeed.c"
click node_crcapi "https://github.com/berabuddies/redis-poc/blob/main/crcspeed.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_stock62,node_g2read,node_redis74,node_g274,node_redis86 toneBlue
class node_tdigest,node_tdcorrupt,node_tdhelper,node_topk,node_redis toneAmber
class node_streamhelpers toneMint
class node_crc,node_crcspeed,node_crcapi toneRose
class node_operator,node_trigger toneIndigo
```

## Components

### Stream NACK Exploits

- [Redis 6.2.22 Client](https://github.com/berabuddies/redis-poc/blob/main/A_exploit_stock.py): `A_exploit_stock.py`
- [Arbitrary Read](https://github.com/berabuddies/redis-poc/blob/main/G2_arbread.py): `G2_arbread.py`
- [Redis 7.4.9 Client](https://github.com/berabuddies/redis-poc/blob/main/P74_exploit.py): `P74_exploit.py`
- [7.4 Reclaim](https://github.com/berabuddies/redis-poc/blob/main/P74_g2.py): `P74_g2.py`
- [Redis 8.6.4 Client](https://github.com/berabuddies/redis-poc/blob/main/P86_exploit.py): `P86_exploit.py`

### RedisBloom Exploits

- [TDigest Exploit](https://github.com/berabuddies/redis-poc/blob/main/P88W_exploit.py): `P88W_exploit.py`
- [TDigest Corruption](https://github.com/berabuddies/redis-poc/blob/main/P88W_corrupt.py): `P88W_corrupt.py`
- [TDigest Helpers](https://github.com/berabuddies/redis-poc/blob/main/P88W_lib.py): `P88W_lib.py`
- [TopK Exploit](https://github.com/berabuddies/redis-poc/blob/main/T88_exploit.py): `T88_exploit.py`

### Payload Helpers

- [Stream Payload Helpers](https://github.com/berabuddies/redis-poc/blob/main/A_lib.py): `A_lib.py`

### CRC Support

- [CRC-64 Core](https://github.com/berabuddies/redis-poc/blob/main/crc64.c): `crc64.c`
- [CRC Speed Routines](https://github.com/berabuddies/redis-poc/blob/main/crcspeed.c): `crcspeed.c`
- [CRC Interfaces](https://github.com/berabuddies/redis-poc/blob/main/crcspeed.h): `crcspeed.h`

### Other components

- **Operator**
- **Redis Target**
- **Command Result**

## Connections

- Operator → Redis 6.2.22 Client: runs client (evidence: `README.md`)
- Operator → Redis 7.4.9 Client: runs client (evidence: `README.md`)
- Operator → Redis 8.6.4 Client: runs client (evidence: `README.md`)
- Operator → TDigest Exploit: runs client (evidence: `README.md`)
- Operator → TopK Exploit: runs client (evidence: `README.md`)
- Redis 6.2.22 Client → Redis Target: sends commands (evidence: `A_exploit_stock.py`)
- Redis 7.4.9 Client → Redis Target: sends commands (evidence: `P74_exploit.py`)
- Redis 8.6.4 Client → Redis Target: sends commands (evidence: `P86_exploit.py`)
- TDigest Exploit → Redis Target: sends commands (evidence: `P88W_exploit.py`)
- TopK Exploit → Redis Target: sends commands
- Redis Target → Command Result: executes trigger (evidence: `README.md`)
- Redis 6.2.22 Client → Stream Payload Helpers: uses helpers (evidence: `A_exploit_stock.py`)
- Redis 6.2.22 Client → Arbitrary Read: calls read primitive (evidence: `A_exploit_stock.py`)
- Redis 7.4.9 Client → 7.4 Reclaim: uses reclaim (evidence: `P74_exploit.py`)
- Redis 7.4.9 Client → Stream Payload Helpers: uses helpers (evidence: `P74_exploit.py`)
- Redis 8.6.4 Client → Stream Payload Helpers: uses helpers (evidence: `P86_exploit.py`)
- TDigest Exploit → TDigest Corruption: uses corruption logic (evidence: `P88W_exploit.py`)
- TDigest Exploit → TDigest Helpers: uses payload helpers (evidence: `P88W_exploit.py`)
- TopK Exploit → Stream Payload Helpers: uses helpers (evidence: `T88_exploit.py`)
- Stream Payload Helpers → CRC-64 Core: computes payload CRC (evidence: `README.md`)
- CRC-64 Core → CRC Speed Routines: uses speed routines (evidence: `crc64.c`)
- CRC Speed Routines → CRC Interfaces: uses declarations (evidence: `crcspeed.c`)
