Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitHubGitHub/norrrrrrr-lyn/wainjectbench
Vulnerability AnalysisWeb SecurityMachine LearningPapers & ResearchLearning & EducationAI SecurityAdversarial Attack
GitHubnorrrrrrr-lyn/wainjectbench

WAInjectBench

Benchmarking prompt injection detections for web agents.

View Repository
234472 months agoReviewed by Kitploit

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

WAInjectBench

WAInjectBench is a comprehensive benchmark for prompt injection detection in web agents.
It covers 6 types of attacks, across two modalities: text and image.


📂 Dataset Structure

  • data/
    • text/
      • benign/ → 4 categories, stored as JSONL files
      • malicious/ → 8 attack types, stored as JSONL files
    • image/
      • benign/ → 2 categories, stored in subfolders
      • malicious/ → 7 attack types, stored in subfolders

⚙️ Installation

Clone the repo and create the environment:

root@kitploit:~
Download Tool
git clone https://github.com/Norrrrrrr-lyn/WAInjectBench.git cd WAInjectBench conda env create -f environment.yml conda activate wainjectbench

🚀 Evaluation

WAInjectBench supports two evaluation pipelines: text-based detection and image-based detection.

🔹 Text-based Detection

root@kitploit:~
python main_text.py \
  --data_dir [path to text dataset] \
  --detector [detector name] \
  --result_dir [output path] \
  --gpu [gpu id]

Available detectors: ["kad", "promptarmor", "embedding-t", "promptguard", "datasentinel", "ensemble"]

PromptArmor → requires OPENAI_API_KEY as environment variable.

DataSentinel →

root@kitploit:~
git clone https://github.com/liu00222/Open-Prompt-Injection.git

Download the pretrained model into: WAInjectBench/Open-Prompt-Injection/DataSentinel_Models Set the directory and model path in detector_text/datasentinel.py.

🔹 Image-based Detection

root@kitploit:~
python main_image.py \
  --data_dir [path to image dataset] \
  --detector [detector name] \
  --result_dir [output path] \
  --gpu [gpu id]

Available detectors: ["gpt-4o-prompt", "llava-1.5-7b-prompt", "jailguard", "embedding-i", "llava-1.5-7b-ft", "ensemble"]

GPT-4o-Prompt → requires OPENAI_API_KEY as environment variable.

JailGuard →

root@kitploit:~
git clone https://github.com/shiningrain/JailGuard.git

Follow its README to configure MiniGPT4.

LLaVA-1.5-7B-FT → requires downloading our finetuned model and setting its path in detector_image/llava.py.

🔹 In-domain Generalization

We also provide in-domain trained versions of the Embedding-T and Embedding-I models, available in model/embedding-t/in-domain and model/embedding-i/in-domain. To use them, follow the same evaluation procedure as in the main experiments, but update the model path in detector_text/embedding-t.py and detector_image/embedding-i.py.

🏋️ Training

We provide code for training embedding-based binary classifiers for both text and image.

Text embedding classifier

root@kitploit:~
python train/embedding-t.py \
  --input_dir [dir with training text jsonl files] \
  --output_dir [model output path]

JSONL format:

root@kitploit:~
{"text": "example", "label": 1}   # 1 for malicious, 0 for benign

Image embedding classifier

root@kitploit:~
python train/embedding-i.py \
  --input_dir [dir with training image jsonl files] \
  --output_dir [model output path]

JSONL format:

root@kitploit:~
{"path": "path/to/image.png", "label": 1}

Finetuning LLaVA-1.5-7B

root@kitploit:~
python train.py \
  --train_jsonl train.jsonl \
  --val_jsonl val.jsonl \
  --use_lora \
  --amp_dtype bf16 \
  --device_mode single \
  --gpu_id 0

The JSONL files should contain image paths and labels (1 = malicious, 0 = benign). Experiments in our paper use the default hyperparameters.