โš ๏ธ This project demonstrates how Pythonโ€™s shelve database 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

  1. generate_data_db.py defines a reverse shell payload (IP: 10.10.10.10, port: 8080).
  2. The payload is base64โ€‘encoded and wrapped in Trigger.__reduce__().
  3. A shelve database file train_data_mod_obfuscated_fixed.db is created with the malicious Trigger object.
  4. The Streamlit app (healthcare_chatbot_db.py) runs shelve.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 shelve DB 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

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support