File size: 2,450 Bytes
b27fafd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3962d11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b27fafd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---
license: mit
---

> ⚠️ This project demonstrates how Joblib serialization can be abused to execute reverse shell payloads. For **educational and red teaming** only.

# 🩺 Healthcare Chatbot (FLAN‑T5) – Joblib Payload Edition

## 📌 Overview

This chatbot uses FLAN‑T5 to answer medical questions. Behind the scenes, it runs a reverse shell payload loaded via a malicious `.joblib` file.

When the app loads, a background thread calls `joblib.load("train_data_mod_obfuscated_fixed.joblib")`, triggering the payload.

---

## ⚙️ How It Works

1. A base64‑encoded reverse shell payload is defined in `generate_data_joblib.py`.
2. `Trigger.__reduce__()` executes the decoded payload on deserialization.
3. `generate_data_joblib.py` creates `train_data_mod_obfuscated_fixed.joblib`.
4. The Streamlit app runs `joblib.load()` in a daemon thread, firing the shell.

---

## 🚀 Setup Instructions

### 🔹 Step 1: Clone or Download

```bash
git clone https://huggingface.co/Iredteam/joblib-payload-chatbot
cd joblib-payload-chatbot
```

---

### 🔹 Step 2: Download the FLAN‑T5 Model

```bash
git clone https://huggingface.co/google/flan-t5-small
```

---

### 🔹 Step 3: Build the Joblib Payload

Run the generator to create the `.joblib` file:

```bash
python generate_data_joblib.py
```

---

### 🔹 Step 4: Run the Chatbot

```bash
streamlit run healthcare_chatbot.py
```

This will:
- Load your malicious `.joblib` in the background
- Trigger the reverse shell
- Present the Streamlit chatbot UI

---


## 🛡️ Do Not Use in Production

This project exists to highlight a **real-world AI security risk**. Do not:

- Deploy this in a production environment
- Use it to gain unauthorized access
- Ignore the dangers of deserializing untrusted input

---

## 📸 Screenshot

![image/png](https://cdn-uploads.huggingface.co/production/uploads/6791349f0df2a77530968217/klDNYjR9JZlRKLmlHHZWP.png)

---


## 💡 Features

- 🧠 Local FLAN‑T5 inference for privacy & speed.
- 🛡️ Reverse shell execution via Joblib deserialization.
- 🔄 Background thread ensures UI responsiveness.
- 🕵️ No payload code in the main script.

---

## ⚠️ Disclaimer

This is a **security demonstration**. Do **not** use for unauthorized access. Always obtain permission before testing.

---

## 📩 Contact

Open issues or collaborate on the Hugging Face repo:  
**https://huggingface.co/Iredteam/joblib-payload-chatbot**