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

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

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

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
semgrep-rules — 我收集的Semgrep规则,用于促进漏洞研究。 | Kitploit
工具/GitHubGitHub/0xdea/semgrep-rules
静态代码分析 (SAST)漏洞分析代码分析二进制分析学习与教育精选资源
GitHub0xdea/semgrep-rules

semgrep-rules

我收集的Semgrep规则,用于促进漏洞研究。

查看仓库
86689652天前Kitploit 审核通过
分享
网站

semgrep-rules

validate

“攻击面本身就是漏洞。在那里找到一个 bug 只是细节问题。”

-- Mark Dowd

“有些细节比其他的更重要。”

-- Fedor G. Pikus

我收集的 Semgrep 规则集合,用于辅助漏洞研究。

Program in C

文章

  • https://hnsecurity.it/blog/semgrep-ruleset-for-c-c-vulnerability-research
  • https://hnsecurity.it/blog/automating-binary-vulnerability-discovery-with-ghidra-and-semgrep
  • https://hnsecurity.it/blog/big-update-to-my-semgrep-c-cpp-ruleset
  • https://hnsecurity.it/blog/streamlining-vulnerability-research-with-the-idalib-rust-bindings-for-ida-9-2/
  • https://hnsecurity.it/blog/my-semgrep-c-cpp-ruleset-is-ready-for-prime-time-again/

另请参阅

  • https://appsec.guide/docs/static-analysis/semgrep/
  • https://semgrep.dev/docs/writing-rules/overview
  • https://semgrep.dev/r

安装与使用说明

  1. 安装 Semgrep。
  2. 要通过 Semgrep registry 使用这些规则,请在目标源代码仓库的根目录下运行以下命令:
# high priority scan (quick wins)
semgrep --severity ERROR --config "p/0xdea"

# high and medium priority scan (recommended)
semgrep --severity ERROR --severity WARNING --config "p/0xdea"

# full scan (might include marginal findings and more false positives)
semgrep --config "p/0xdea"

或者,你也可以在本地克隆此 GitHub 仓库并运行:

# full scan
semgrep --config semgrep-rules/rules /path/to/source

# specific rule scan
semgrep --config semgrep-rules/rules/c/command-injection.yaml /path/to/source

[!TIP] 指定 --no-git-ignore 开关可扫描文件,而不考虑 git 跟踪状态或 .gitignore 规则。

为了获得更流畅的体验,我建议将 Semgrep 扫描输出保存为 SARIF 格式,并在 VS code 中使用 SARIF Explorer:

semgrep --sarif --sarif-output=/path/to/source/SEMGREP.sarif --config semgrep-rules/rules /path/to/source
code /path/to/source # then open the SEMGREP.sarif file in VS code with SARIF Explorer 

另请参阅随附的 SARIF 输出示例。

兼容性

已使用 Semgrep CLI 1.169.0 测试。

规则

C/C++

经过实战检验的 C(有时也包括 C++)规则集。

缓冲区溢出

  • insecure-api-gets。使用不安全的 API 函数 gets。
  • insecure-api-strcpy-strcat。使用可能不安全的 API 函数 strcpy、stpcpy、strcat。
  • insecure-api-sprintf-vsprintf。使用可能不安全的 API 函数 sprintf 和 vsprintf。
  • insecure-api-scanf。使用 scanf 系列中可能不安全的 API 函数。
  • incorrect-use-of-strncat。向 strncat 传递了错误的大小参数。
  • use-of-source-size-in-copy。向 strncpy、memcpy、snprintf 及其变体传递了错误的大小参数。
  • incorrect-use-of-sizeof。意外地对指针而非其目标使用了 sizeof 运算符。
  • unterminated-string-strncpy。在 strncpy 和 stpncpy 之后缺少显式的 NUL 终止。
  • off-by-one。潜在的差一错误。
  • unsafe-ret-snprintf-vsnprintf。对 snprintf 和 vsnprintf 返回值的潜在不安全使用。
  • unsafe-ret-strlcpy-strlcat。对 strlcpy 和 strlcat 返回值的潜在不安全使用。
  • pointer-subtraction。潜在使用指针相减来确定大小。
  • write-into-stack-buffer。直接写入在栈上分配的缓冲区。

整数溢出

  • integer-wraparound。潜在的整数回绕错误。
  • unsafe-strlen。将 strlen 的返回值强制转换为 short 可能很危险。
  • integer-truncation。潜在的整数截断错误。
  • signed-unsigned-conversion。潜在的有符号/无符号转换错误。
  • incorrect-unsigned-comparison。检查无符号变量是否为负数。

格式化字符串

  • format-string-bugs。潜在的格式化字符串漏洞。

内存管理

  • insecure-api-alloca。使用可能不安全的 API 函数 alloca。
  • use-after-free。潜在的释放后使用(use after free)。
  • double-free。潜在的重复释放(double free)。
  • incorrect-use-of-free。对不在堆上的内存调用 free。
  • unchecked-ret-malloc。未检查 malloc、calloc、realloc 等的返回码。
  • putenv-stack-var。使用栈分配的变量调用 putenv。
  • ret-stack-address。潜在返回栈分配变量的地址。
  • mismatched-memory-management。可能不匹配的 C 内存管理例程。
  • mismatched-memory-management-cpp。可能不匹配的 C++ 内存管理例程。
  • memory-address-exposure。潜在暴露底层内存地址。

命令注入

  • command-injection。通过 system 或 popen 的潜在操作系统命令注入。

竞态条件

  • insecure-api-access-stat。使用不安全的 API 函数 access、stat、lstat 等。
  • insecure-api-mktemp-tmpnam-tempnam。使用不安全的 API 函数 mktemp、tmpnam、tempnam。
  • insecure-api-signal。使用不安全的 API 函数 signal。

权限管理

下载工具

最受欢迎

查看全部 →

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

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 终极 OSINT 工具包:调查图谱、置信度评分、别名家族、地图、时间线和报告。49 个模块、400+ 个站点,无需 API 密钥。

    772
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock 一键执行应用(CVE-2026-43499)

    505
  • 3

    ARTEX

    baarai/artex

    基于LLM的多智能体自主渗透测试平台,具备规划器/执行器智能体、资产与探索图谱、MITM流量记录以及漏洞复测功能。

    420
  • 4

    redforge

    cybersecurity91/redforge

    浏览器端红队工具包,包含 102 个离线工具,用于侦察、载荷生成、凭据攻击、加密、编码和交战报告。

    345
  • 5

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    AI原生网络安全的行动系统——在这里,意图转化为受治理的执行,证据沉淀为运营记忆,每一次操作都让下一次更出色。

    260
  • 6

    antifox

    antifox-ai/antifox

    AI multi-agent autonomous penetration testing platform that runs recon, attack-surface discovery, exploitation validation and evidence-backed report delivery.

    251

探索所有工具

浏览我们的工具集合

查看所有工具 →