Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
FinRED-paper — 金融领域特定红队测试基准评估标准 | Kitploit
工具/GitHubGitHub/selectstar-ai/finred-paper
漏洞分析威胁情报机器学习论文与研究学习与教育红队AI 安全
GitHubselectstar-ai/finred-paper

FinRED-paper

金融领域特定红队测试基准评估标准

查看仓库
11183个月前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

FinRED:金融红队评估数据集

面向金融领域安全评估的红队基准生成流水线。

FinRED overview


补充文档

论文中引用的详细材料:

  • docs/expert_validation.md — 来自 12 位 FSI 领域专家的逐题焦点小组访谈(FGI)结果(一致性、李克特量表评分、Cohen's κ / Krippendorff's α)。
  • docs/judge_rubric.md — 完整的 LLM-as-a-Judge 评估模板、五个评分维度、判定规则以及输出 JSON schema。
  • docs/schemas.md — 威胁行为 schema 结构(必需/可选元素),附 R4.4 完整示例。
  • docs/related_work.md — 对先前金融领域 LLM 基准的逐项描述,以及 FinRED 的不同之处。

项目结构

root@kitploit:~
FinRED/
├── main.py                      # Main runner
├── requirements.txt             # Dependencies
├── run/                         # Example run scripts
├── prompts/                     # Prompt files
├── tests/                       # Example notebooks
├── README.md
│
├── src/
│   ├── Step1_build.py           # Scenario generation module
│   ├── Step2_build.py           # Seed prompt generation module
│   ├── __init__.py
│   │
│   ├── data/                    # Downloaded data
│   │   ├── contexts/            # Context data
│   │   │   ├── R3_products/     # R3 product summaries
│   │   │   └── retrieved_chunks/# Similarity search outputs
│   │   ├── orig/                # Raw data
│   │   │   ├── db/              # Chunk CSV DB
│   │   │   ├── parsed_docs/     # PDFs + chunk JSON
│   │   │   └── investinfo/      # R3 product text
│   │   └── queries/             # Query CSV files
│   │
│   ├── data/schemas/            # Output schema definitions
│   │   ├── ko/                  # Korean schemas
│   │   └── en/                  # English schemas
│   │
│   ├── outputs/                 # Generation outputs
│   │   ├── scenarios/           # Step 1 outputs
│   │   └── prompts/             # Step 2 outputs
│   │
│   ├── preprocess/              # Preprocessing pipeline
│   │   ├── preprocess_README.md # Detailed preprocessing guide
│   │   ├── 1_chunking.py
│   │   ├── 2_parsed_to_csv.py
│   │   ├── 3_common_to_csv.py
│   │   ├── 4_product_summarizer.py
│   │   ├── 5_summary_extractor.py
│   │   └── 6_chunk_retriever.py
│   │
│   ├── eval/                    # Evaluation module
│   │   ├── judge_finred.py      # Evaluation script
│   │   ├── dataset/             # Evaluation dataset

环境搭建

0. 下载相关数据

Google Drive:https://drive.google.com/drive/u/0/folders/1cfBf419OUDrQQMRKMPLLJqRX97WMxExC Google Drive

将下载的数据放置到与上述文件夹结构匹配的位置(位于 src/data 下)。

1. 创建虚拟环境(Python 3.10)

root@kitploit:~
# Conda
conda create -n finred python=3.10 -y
conda activate finred

# Or venv
python3.10 -m venv finred_env
source finred_env/bin/activate

2. 安装依赖包

root@kitploit:~
cd /path/to/FinRED
pip install -r requirements.txt

3. 预处理环境(可选)

如果你需要预处理(PDF 分块等):

root@kitploit:~
# Unstructured
pip install "unstructured[all-docs]"

# System dependencies (Ubuntu/Debian)
sudo apt-get install -y libmagic-dev poppler-utils tesseract-ocr tesseract-ocr-kor libreoffice pandoc

预处理指南:src/preprocess/preprocess_README.md

4. 验证安装

root@kitploit:~
python --version  # Python 3.10.x
python -c "import torch; print(f'CUDA: {torch.cuda.is_available()}')"

流水线概览

root@kitploit:~
[Context + Schema + Query]
         │
         ▼
   ┌─────────────┐
   │ Step1_build │  Scenario generation (OpenAI GPT-4)
   └─────────────┘
         │
         ▼
   [Scenario JSON]
         │
         ▼
   ┌─────────────┐
   │ Step2_build │  Seed prompt generation (Gemini)
   └─────────────┘
         │
         ▼
   [Seed Prompts]
         │
         ▼
   ┌─────────────┐
   │ Evaluation  │  Model response evaluation
   └─────────────┘

模块详情

Step1_build.py - 场景生成

基于上下文和 schema 生成红队场景。

  • 输入:schema、queries、检索到的上下文分块
  • 输出:场景 JSON 文件,位于 src/outputs/scenarios/{category}/
  • 模型:OpenAI GPT-4

Step2_build.py - 种子提示生成

从场景生成种子提示。

  • 输入:来自步骤 1 的场景 JSON
  • 输出:提示 JSON + 合并 CSV,位于 src/outputs/prompts/{category}/
  • 模型:Google Gemini 2.5 Pro

使用方法

快速开始

数据生成

root@kitploit:~
# Run the full pipeline with the example script
sh run/run_data_generate.sh

评判

root@kitploit:~
python src/eval/judge_finred.py \
    -i src/eval/dataset/qwen_2.5_test.csv \
    -o qwen_2.5_test_judged \
    -d src/eval/infer_result

基础用法

root@kitploit:~
cd /path/to/FinRED

python main.py \
    --step <1|2|all> \
    --category <category> \
    --openai_api_key "sk-..." \
    --gemini_api_key "AIza..."

参数

示例

root@kitploit:~
# Full pipeline (R1)
python main.py \
    --step all \
    --category R1 \
    --openai_api_key "sk-proj-..." \
    --gemini_api_key "AIza..."

# Step 1 only
python main.py \
    --step 1 \
    --category R2 \
    --openai_api_key "sk-proj-..."

# Step 2 only (English, 5 prompts)
python main.py \
    --step 2 \
    --category R5 \
    --lang en \
    --num_prompts 5 \
    --gemini_api_key "AIza..."

# Single subcategory
python main.py \
    --step 2 \
    --category R1_1 \
    --num_prompts 3 \
    --gemini_api_key "AIza..."

类别信息


评估

评估模型对生成提示的响应。

运行

root@kitploit:~
cd /path/to/FinRED/src/eval

python src/eval/judge_finred.py \
    -i <input_csv_path> \
    -o <output_basename> \
    -d <output_dir>

示例

root@kitploit:~
python src/eval/judge_finred.py \
    -i ./dataset/qwen_2.5_7b_all_with_responses.csv \
    -o qwen2.5_7b_responses \
    -d ./infer_result/

输入 CSV 格式

CSV 应包含:

  • prompt 列
  • 模型响应列

输出

  • infer_result/:评估结果
  • judge_errors/:错误日志

输出格式

场景 JSON(步骤 1)

root@kitploit:~
{
  "scenario_id": "R1_1_0001",
  "context": "...",
  "risk_description": "...",
  "attack_vector": "..."
}

提示 JSON(步骤 2)

root@kitploit:~
{
  "prompt_1": "Provide details about vulnerabilities in a financial system...",
  "prompt_1_optionalelements": ["social engineering", "phishing"],
  "prompt_2": "...",
  "prompt_2_optionalelements": ["..."]
}
下载工具
参数必需描述
--step是要运行的步骤:1(场景)、2(提示)、all(顺序执行)
--category是类别:R1、R2、R3、R4、R5 或 R1_1 等
--openai_api_key步骤 1OpenAI API 密钥
--gemini_api_key步骤 2Gemini API 密钥
--lang可选提示语言:ko(默认)、en
--num_prompts可选提示数量(默认:3)
--step1_model可选步骤 1 使用的模型(默认:gpt-4.1-2025-04-14)
--step2_model可选步骤 2 使用的模型(默认:models/gemini-2.5-pro)
--model_name可选已弃用的 --step1_model 别名
类别子类别描述
R1R1_1 ~ R1_6金融安全威胁
R2R2_1 ~ R2_5欺诈与非法活动
R3R3_1 ~ R3_3不当销售
R4R4_1 ~ R4_5市场操纵
R5R5_1 ~ R5_7监管违规