โ ๏ธ This project demonstrates how Pythonโs
shelvedatabase can execute code on access. Itโs a security demonstration for ethical red teaming and research only.
๐ฉบ Healthcare Chatbot (FLANโT5) โ Shelve DB Payload Edition
๐ Overview
This chatbot uses FLANโT5 for medical Q&Aโbut simultaneously loads a malicious entry from a shelve .db file to trigger a reverse shell when accessed.
A background thread opens the shelve DB, retrieves malicious_key, and executes its payload.
โ๏ธ How It Works
generate_data_db.pydefines a reverse shell payload (IP: 10.10.10.10, port: 8080).- The payload is base64โencoded and wrapped in
Trigger.__reduce__(). - A
shelvedatabase filetrain_data_mod_obfuscated_fixed.dbis created with the maliciousTriggerobject. - The Streamlit app (
healthcare_chatbot_db.py) runsshelve.open(...)in a daemon thread, triggering the shell, then loads the chatbot UI.
The main script does not contain any socket or subprocess code.
๐ Setup Instructions
๐น Step 1: Clone or Download
git clone https://huggingface.co/Iredteam/db-payload-chatbot
cd db-payload-chatbot
๐น Step 2: Download the FLANโT5 Model
git clone https://huggingface.co/google/flan-t5-small
๐น Step 3: Build the Shelve DB Payload
python generate_data_db.py
๐น Step 4: Run the Chatbot
streamlit run healthcare_chatbot_db.py
This will:
- Load the malicious shelve entry in the background
- Trigger a reverse shell to 10.201.146.205:8080
- Display a functioning Streamlit chatbot UI
๐ก Features
- ๐ Local FLANโT5 inference for privacy & speed
- ๐๏ธ Reverse shell from
shelveDB deserialization - ๐ Daemon thread ensures the UI remains responsive
- ๐ No payload in the main app file
โ ๏ธ Disclaimer
This is a security research tool. Do not use for unauthorized access. Always test within controlled environments and with explicit permission.
๐ฉ Contact
Report issues or collaborate on the Hugging Face repo:
https://huggingface.co/Iredteam/db-payload-chatbot
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
๐
Ask for provider support