DOI: 10.5281/zenodo.17971722
title: VIPER_code

description: Breaking Visual Reasoning CAPTCHAs with VIPER: A Structured Vision-Language Attack Framework

VIPER_code is an academic and practical Python framework designed for the analysis and attack of Visual Reasoning CAPTCHAs (VRC). It implements a structured, modular vision-language attack pipeline that supports a range of CAPTCHA types — including six major VRC datasets and various non-VRC challenges. The framework enables automated evaluation and experimentation with large language models (LLMs) to break CAPTCHAs in a highly configurable manner.

 

File & Directory Structure

First, unzip all the compressed files.




File/Folder
Description




main.py
Main entry for experiment orchestration and accuracy testing. Modifying imports here allows switching among LLM modules and VRC types.


environment_variable.py
LLM API and environment configuration. You must edit this file before running any experiment.


r1_and_r2_main.py
Script for running “r1” and “r2” series experiments. Update the imports to select the relevant experiment logic.


DS_*.py, Grok_*.py, KIMI_*.py
Scripts for specific dataset/model/attack integration. For example, DS_geetest.py for Geetest VRC-specific logic.


tools_*.py
Toolkit and utility scripts for each VRC or LLM variant.


best_28.pt
Pretrained model weights (PyTorch). May be needed for certain experiments.


data_process/
Contains scripts and raw/intermediate data for transforming datasets.


dataset/
Houses all datasets, including six VRC datasets, their labels, prompts, and evaluation scripts that consume these resources.


other_captcha/
Scripts and results for non-VRC experiments, such as traditional text-based CAPTCHAs or rotated CAPTCHA variants.


result/
Experimental result files, including cracking accuracy per LLM/model (r1, r2), corresponding response times, and any processed data.


recaptchaTest/
Specific test scripts and resources for reCAPTCHA-related CAPTCHAs.


README.md
This documentation.




 

Directions for Use





Configure the Environment:





Edit environment_variable.py to set the LLM API keys, endpoints, and dataset addresses as needed for your experiments.






Run Main Experiments:





The central script for most experiments is main.py:





Run with python main.py.




To test different LLMs or VRC types, adjust the import statements at the top, e.g.:

from tools_gpt_xiaodun import *# or: from Grok_xiaodun import *# or: from KIMI_VTT import *




The script will manage accuracy testing, experiment orchestration, and results logging.








Run r1 / r2 Experiments:





Use r1_and_r2_main.py for specialized accuracy experiments of r1 and r2:





Edit the import line: from tools_r1 import * to select your target.




Change VC-specific logic by editing the directory, sub_directory, width, height = getDirectory() or .Xiaodun_file() invocation.




Select which VRC to attack by adjusting the arguments in the related function call.








Datasets and Output:





Datasets must be placed in /dataset as referenced by test scripts.




Transformed/intermediate data is handled by /data_process.




Results and accuracy scores generated by experiments are saved in /result.






Other CAPTCHA Experiments:





/other_captcha/ contains scripts and data for additional types of CAPTCHAs, as well as experiment results for variations like rotated CAPTCHAs or text-based ones.





 

Example Project Tree

VIPER_code/├── main.py├── environment_variable.py├── r1_and_r2_main.py├── DS_*.py├── Grok_*.py├── KIMI_*.py├── tools_*.py├── best_28.pt├── README.md├── data_process/│   └── # Dataset processing scripts & data├── dataset/│   └── # All datasets and associated labels/questions├── other_captcha/│   └── # Non-VRC CAPTCHA code/experiments├── recaptchaTest/│   └── # Specific reCAPTCHA experiments└── result/    └── # Output/results for each experiment

 

Reproducibility & Recommendations





Python 3.8+ environment recommended.




Manage dependencies as needed (pip install ...). There may not be a requirements.txt — review import statements in main scripts.




Some experiments require a CUDA-enabled GPU with a functional PyTorch setup.




Always check and update environment_variable.py before executing scripts for the correct test context.