Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

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

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

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

工具目录

分类

查看所有分类
Loading categories
caracal — Starknet 智能合约静态分析器 | Kitploit
工具/GitHubGitHub/crytic/caracal
静态分析漏洞分析代码分析
GitHubcrytic/caracal

caracal

Starknet 智能合约静态分析器

查看仓库
1481172年前Kitploit 审核通过

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

Caracal

Caracal 是一个针对 Starknet 智能合约的 SIERRA 表示的静态分析工具。

功能特点

  • 检测器:检测易受攻击的 Cairo 代码
  • 打印器:报告信息
  • 污点分析
  • 数据流分析框架
  • 易于在 Scarb 项目中运行

安装

预编译二进制文件

预编译的二进制文件可在我们的发布页面获取。如果您使用的是 Cairo 编译器 1.x.x,请使用 v0.1.x 二进制文件;如果您使用的是 Cairo 编译器 2.x.x,请使用 v0.2.x。

从源码构建

您需要安装 Rust 编译器和 Cargo。 从 git 构建:

root@kitploit:~
cargo install --git https://github.com/crytic/caracal --profile release --force

从本地副本构建:

root@kitploit:~
git clone https://github.com/crytic/caracal
cd caracal
cargo install --path . --profile release --force

使用方法

列出检测器:

root@kitploit:~
caracal detectors

列出打印器:

root@kitploit:~
caracal printers

独立使用

要使用独立的 Cairo 文件,并且您有本地的 Cairo 编译器二进制文件,只需将其指向该文件即可。否则,将使用捆绑的编译器,并且您需要通过 --corelib 命令行选项或设置 CORELIB_PATH 环境变量来传递 corelib 库的路径。
运行检测器:

root@kitploit:~
caracal detect path/file/to/analyze
root@kitploit:~
caracal detect path/file/to/analyze --corelib path/to/corelib/src

运行打印器:

root@kitploit:~
caracal print path/file/to/analyze --printer printer_to_use --corelib path/to/corelib/src

Cairo 项目

如果您有一个包含多个文件和合约的 Cairo 项目,可能需要通过 --contract-path 指定合约。如果可用,将使用本地的 Cairo 编译器二进制文件;否则将使用捆绑的编译器。在后一种情况下,您还需要按照独立使用情况中所述指定 corelib。路径是 cairo_project.toml 所在的目录。
运行检测器:

root@kitploit:~
caracal detect path/to/dir
root@kitploit:~
caracal detect path/to/dir --contract-path token::myerc20::... token::myerc721::...

运行打印器:

root@kitploit:~
caracal print path/to/dir --printer printer_to_use

Scarb

如果您有一个使用 Scarb 的项目,您需要在 Scarb.toml 中添加以下内容:

root@kitploit:~
[[target.starknet-contract]]
sierra = true

[cairo]
sierra-replace-ids = true

然后传递 Scarb.toml 所在目录的路径。 运行检测器:

root@kitploit:~
caracal detect path/to/dir

运行打印器:

root@kitploit:~
caracal print path/to/dir --printer printer_to_use

检测器

Cairo 列表示该检测器适用的编译器版本。

打印器

  • cfg:将每个函数的 CFG 导出为 .dot 文件
  • callgraph:将函数调用图导出为 .dot 文件

如何贡献

请查看以下主题的 wiki:

  • 如何编写检测器
  • 如何编写打印器

局限性

  • 内联函数无法正确处理。
  • 由于它基于 SIERRA 表示运行,因此无法报告源码中的错误位置,我们只能报告 SIERRA 指令 / SIERRA 程序中可用的信息。
下载工具
编号检测器检测内容影响置信度Cairo 版本
1controlled-library-call使用用户控制的类哈希进行库调用高中1 & 2
2unchecked-l1-handler-from检测未进行 from 地址检查的 L1 处理器高中1 & 2
3felt252-unsafe-arithmetic检测用户控制的 felt252 类型操作,该类型不安全的溢出/下溢中中1 & 2
4reentrancy检测在外部调用之前读取存储变量并在之后写入的情况中中1 & 2
5read-only-reentrancy检测视图函数在外部调用之后读取存储变量的情况中中1 & 2
6unused-events定义了但未发出的事件中中1 & 2
7unused-return未使用的返回值中中1 & 2
8unenforced-view函数具有视图修饰符但修改了状态中中1
9tx-origin检测使用交易发起地址作为访问控制中中2
10unused-arguments未使用的参数低中1 & 2
11reentrancy-benign检测在外部调用之后写入存储变量但在之前未读取的情况低中1 & 2
12reentrancy-events检测在外部调用之后发出事件导致事件乱序的情况低中1 & 2
13dead-code从未使用过的私有函数低中1 & 2
14use-after-pop-front检测在移除数组或 span 元素后使用该数组或 span 的情况低中1 & 2