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

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

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

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
BotLens — 一个研究工件兼 MCP 服务器,通过大规模评论分析、LLM 标注以及一套包含 31 个主题的分类体系,审计第三方 Discord 机器人中的安全与隐私问题。 | Kitploit
工具/GitHubGitHub/ua-spectral/botlens
漏洞分析信息收集Web安全隐私保护机器学习论文与研究学习与教育网络爬虫
GitHubua-spectral/botlens

BotLens

一个研究工件兼 MCP 服务器,通过大规模评论分析、LLM 标注以及一套包含 31 个主题的分类体系,审计第三方 Discord 机器人中的安全与隐私问题。

查看仓库
15天前尚未审核

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

BotLens:面向社交平台上第三方社区机器人的安全与隐私审计框架

论文: Kofi Ampomah 和 Tu Le。Measuring Users' Security and Privacy Concerns About Third-Party Community Bots on Discord. Network and Distributed System Security (NDSS) Symposium 2027. https://dx.doi.org/10.14722/ndss.2027.230535

制品评审人员: 请从 ARTIFACT-EVALUATION.md 开始。 该文件将论文中的每一项主张映射到可复现它的确切命令,列出了 预期输出和运行时间,并说明了哪些组件不在范围内。

概述

本仓库包含 BotLens 流水线的源代码,该流水线通过大规模评论分析和元数据审计, 分析 Discord 上第三方社区机器人的安全与隐私(S&P)问题。该流水线处理了从 Top.gg 抓取的 23,102 个机器人上的 183,142 条用户评论, 识别出 8,832 条与 S&P 相关的评论——观测到的流水线产出率为 4.82%—— 并将它们映射到包含 31 个主题的 S&P 分类体系上。

仓库结构

BotLens/
├── README.md                          # This file
├── ARTIFACT-EVALUATION.md             # Claim → command → expected output
├── LICENSE                            # See License below
├── CITATION.cff                       # How to cite (also used by Zenodo)
├── botlens-ndss-data.zip              # The data; unpack to data/ (see Data below)
├── requirements-lock.txt              # Exact versions used for the paper
├── requirements.txt                   # Looser version bounds
│
├── config/                            # Pipeline configuration
│   ├── __init__.py
│   ├── settings.py                    # Paths, model params, thresholds
│   └── taxonomy.py                    # 31-theme S&P taxonomy (single source of truth)
│
├── scrapers/                          # Data collection scripts
│   ├── topgg_metadata_scraper.py      # Bot metadata scraper (Top.gg pages)
│   ├── topgg_reviews_scraper.py       # Bot review scraper (Top.gg reviews)
│   └── discord_server_scanner.py      # Server bot scanner — OUT OF SCOPE, see below
│
├── scripts/                           # Pipeline stages + analysis
│   ├── stage0_preprocess.py           # Merge, clean, detect language, translate
│   ├── stage1_llm_labeling.py         # Binary S&P classification via Ollama
│   ├── stage1b_active_learning.py     # Active learning loop
│   ├── stage2_prepare_data.py         # Train/val/test splits with balancing
│   ├── stage3_finetune_deberta.py     # Fine-tune DeBERTa-v3-large classifier
│   ├── stage4_classify_all.py         # Classify all 183K reviews
│   ├── stage5_theme_assignment.py     # Assign 31-theme taxonomy themes
│   ├── stage6_emotion_classification.py # GoEmotions → Ekman-style groups
│   ├── stage7_analysis.py             # Sec. IV-A: SPRR, TPR, per-tag/per-bot tables
│   ├── stage8_visualizations.py       # Figs. 2–9
│   ├── rq3_permissions_metadata.py    # RQ3 (Sec. IV-D): statistics + Figs. 10–14, 18
│   ├── language_affective_analysis.py # Appendix B: Fig. 17
│   ├── experiment_labeling_pct.py     # Labeling-budget experiment (10–45%)
│   ├── create_irr_sheets.py           # Inter-rater reliability labeling sheets
│   ├── compute_kappa.py               # Cohen's kappa (Sec. III-C3)
│   ├── check_langs.py                 # Language distribution (Table IV; needs raw crawl)
│   └── prep_30pct_for_al.py           # Prepare labels for active learning
│
├── tests/
│   └── test_smoke.py                  # Fast integrity checks, no data required
│
└── mcp_server/                        # BotLens MCP server (Sec. V)
    ├── server.py                      # The six tools of Sec. V-B2 (+ internal helpers)
    ├── example_client.py              # MCP SDK client reproducing Use Cases 1 and 2
    └── benchmark_latency.py           # Sec. V-D latency session

脚本写出的每张图都以其论文中的图号命名 (figures/fig02_sprr_over_time.png 即图 2,依此类推)。脚本生成的图与论文中的图完全一致:图 2–14、17 和 18。图 1 是流水线示意图,图 15–16 是 BotLens 报告界面的截图。

获取 artifact

该 artifact 发布于 **https://github.com/ua-spectral/BotLens**。每个 GitHub release 都会以 DOI 永久归档在 Zenodo 上;该 DOI 见论文的 artifact 附录以及仓库的 release 页面。

数据

数据以 botlens-ndss-data.zip 的形式随仓库发布(41 MB;其中一个文件解压后达 515 MB,超出 GitHub 的单文件限制)。在仓库根目录下解压一次即可:

python -m zipfile -e botlens-ndss-data.zip .

这会在 config/ 旁边创建 data/;无需下载其他内容。目录结构如下:

BotLens/
└── data/
    ├── processed/
    │   ├── all_reviews_classified.csv    # 183,142 rows — required by the MCP server
    │   ├── privacy_reviews_full.csv      # 8,832 S&P reviews w/ themes + affect
    │   ├── bot_metadata_cleaned.csv      # 23,102 bots (Table I, MCP fallback)
    │   ├── train.csv / val.csv / test.csv
    │   └── label_map.json
    ├── results/                          # Tables behind the paper's numbers
    ├── reference_figures/                # Our output of every generated figure
    └── irr/                              # Annotator workbooks (Sec. III-C3)

在 data/ 目录内使用 sha256sum -c SHA256SUMS.txt 验证完整性。 data/README.md 描述了每个文件。

流水线架构

阶段脚本描述关键输出
0stage0_preprocess.py合并评论 + 元数据、语言检测、Argos Translatedata/raw/reviews.csv
1stage1_llm_labeling.pyOllama/Llama 3 8B 二元 S&P 分类phase1_binary_labels.csv
1bstage1b_active_learning.py不确定性采样 + 多数投票标签改进后的训练集
2stage2_prepare_data.py置信度过滤、5:1 降采样、分层划分train/val/test.csv
3stage3_finetune_deberta.pyDeBERTa-v3-large 微调(30% 标注下 F1 = 0.938)best_model/
4stage4_classify_all.py对全部 183,142 条评论进行批量推理all_reviews_classified.csv
5stage5_theme_assignment.pyOllama 分配 31 主题分类体系中的主题privacy_reviews_themed.csv
6stage6_emotion_classification.pyGoEmotions(RoBERTa)→ 8 个情感组privacy_reviews_full.csv
7stage7_analysis.pySPRR、TPR、按标签和按机器人的 SPRR、按主题的情感data/results/analysis_summary.json
8stage8_visualizations.py图 2–9,包括图 2 的 OLS 趋势(R² = 0.35)figures/fig02_* … fig09_*

关键指标

  • SPRR(安全与隐私评论率):我们的流水线识别并保留为 S&P 相关评论的百分比。总体 SPRR = 4.82%。这是流水线识别出的评论率,并非对已验证漏洞、已确认不当行为或机器人层面风险的度量。
  • TPR(主题流行率):S&P 评论在 31 主题分类体系中的分布,排除标记为 unassigned 的评论。

分类体系

31 主题 S&P 分类体系(论文表 V)由 20 个继承自 Akgul 等人(USENIX Security 2024)的主题 和 11 个在本研究中归纳得出的主题 组成——2 个额外的安全与保障主题和 9 个 Discord 特有主题。config/taxonomy.py 是唯一事实来源;stage8_visualizations.py 从中派生其分组。

主题组 1 — 数据实践(7 个,全部继承): 数据收集、数据共享、数据删除、移除个人可识别信息、数据暴露、数据隐藏、位置与追踪

主题组 2 — 用户权利与控制(7 个,全部继承): 同意、隐私控制、匿名 / 身份识别、广告、隐私政策与法律、隐私侵犯、积极隐私

主题组 3 — 安全与保障(6 个继承 + 2 个新增): 数据安全、密码问题、数据准确性、安全、出售数据、监控、网络钓鱼与诈骗(新增)、数据保留(新增)

主题组 4 — Discord 特有风险(9 个,全部新增): 过度监听、权限范围不匹配、消息内容访问、私信隐私、网关意图滥用、Webhook 滥用、服务器画像、语音隐私、机器人审核透明度

数据收集

元数据爬虫(scrapers/topgg_metadata_scraper.py)

使用并行的 undetected-chromedriver 实例从 Top.gg 收集公开机器人元数据,覆盖 90+ 个类别标签,具备自动重启和进度持久化功能。

评论爬虫(scrapers/topgg_reviews_scraper.py)

使用异步 Playwright 和 4 个并发浏览器实例从 Top.gg 机器人页面抓取公开用户评论。处理分页、去重,并按机器人导出 JSON。评论者显示名称在公开页面上可见,但被有意不读取或保留;仅收集评论内容和公开元数据。

Discord 服务器扫描器(scrapers/discord_server_scanner.py)—— 超出范围

此脚本自动登录真实 Discord 用户账户以枚举服务器中带有 APP 徽章的成员,生成用于演示 scan_server_bots(论文用例 2)的机器人清单。

制品评审人员不应运行此脚本。 自动化用户账户违反 Discord 的服务条款,且运行该脚本需要在 .env 中填入真实凭据。此处仅为记录的完整性而收录。若要在不使用该脚本的情况下测试 scan_server_bots,请传入任意文本文件,每行一个机器人名称——参见 ARTIFACT-EVALUATION.md。

MCP 服务器

mcp_server/server.py 通过模型上下文协议(Model Context Protocol)暴露以下工具,可在任何兼容 MCP 的客户端中提供按需的 S&P 决策支持。

论文中描述的六个工具

  1. get_bot_signals — 指定机器人的 SPRR、星级评分、请求权限、报告的 S&P 主题以及情感构成。
  2. get_taxonomy_breakdown — 机器人 S&P 评论中 31 个分类主题的频率分布,每条评论按其主主题计数。
  3. get_review_samples — 具有代表性的 S&P 相关评论文本。
  4. compare_bots — 两个或多个机器人的并排比较。
  5. list_high_salience_bots — 按 SPRR 排名的前 k 个机器人。
  6. scan_server_bots — 接受机器人清单并返回服务器范围的比较报告。

这些工具报告 S&P 讨论的显著性。它们不验证评论中的声明,也不判定机器人是否安全。

这些工具遵循算法 1(附录 A)。在 Top.gg 上列出但在数据集中没有评论的机器人(23,102 个机器人中的 10,637 个)没有 SPRR,因此 get_bot_signals、compare_bots 和 scan_server_bots 会回退到基于其 Top.gg 元数据的权限审计(PermissionAudit),而不是报告为未找到。

辅助函数(不属于论文贡献)

用于开发、基准测试和临时探索;这些是普通函数,未注册为 MCP 工具: get_permissions_audit、search_bots、filter_bots_by_theme、 get_dataset_stats、diagnose、get_timing_stats。

性能

下载工具