Communitygithub.com

分析以太坊智能合约漏洞

使用Slither和Mythril对Solidity智能合约进行静态与符号执行分析。

分析以太坊智能合约漏洞 是什么?

该技能专注于以太坊智能合约安全分析,通过集成Slither和Mythril两种主流安全工具,自动检测Solidity智能合约中的常见漏洞。Slither基于中间表示(IR)进行快速静态分析,能够识别90多种已知漏洞模式,例如重入攻击、未检查的外部调用和整数溢出;而Mythril则采用符号执行与SMT求解器技术,深入探索复杂的执行路径漏洞。该技能支持手动指定合约文件或项目目录,输出结构化的JSON报告,包含SWC漏洞分类标识、严重性评级、受影响函数及修复建议。它适用于预部署审计、安全事件取证以及持续集成流水线中的自动检查,帮助开发者和安全工程师在几分钟内完成初步安全评估。支持的平台包括任何支持Python和Solidity编译器的环境,如本地开发机或CI/CD服务器。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/analyzing-ethereum-smart-contract-vulnerabilities

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

分析以太坊智能合约漏洞 是做什么的?

概述

智能合约漏洞已导致DeFi协议损失数十亿美元。与传统软件不同,已部署的智能合约不可变且处理真实金融资产,因此部署前的安全分析至关重要。Slither通过中间表示(IR)执行快速静态分析,能在数秒内检测超过90种漏洞模式;而Mythril则利用符号执行与SMT求解技术,发现重入攻击、整数溢出等复杂执行路径漏洞。本技能涵盖对Solidity合约运行这两种工具、解读结果、按严重性对发现进行分类以及生成审计报告的全流程。

使用时机

  • 当需要分析以太坊智能合约漏洞以调查安全事件时
  • 当为此领域构建检测规则或威胁狩猎查询时
  • 当SOC分析师需要针对此分析类型的结构化流程时
  • 当验证相关攻击技术的安全监控覆盖范围时

前置条件

  • Python 3.10+ 及 pip
  • Slither(pip install slither-analyzer)和 solc 编译器
  • Mythril(pip install mythril)及用于编译器版本管理的 solc-select
  • Solidity 源代码或已编译的合约字节码
  • Foundry 或 Hardhat 开发框架(可选,用于项目级分析)

步骤

步骤 1:运行 Slither 静态分析

对合约代码库执行 Slither,利用其90多个内置检测器识别漏洞模式、优化机会和代码质量问题。

步骤 2:运行 Mythril 符号执行

运行 Mythril 深度分析以探索执行路径,发现需要路径敏感分析的重入攻击、未检查的外部调用和算术漏洞。

步骤 3:分类与关联发现

合并两个工具的结果,去重,根据可利用性和财务影响评估严重性,并过滤误报。

步骤 4:生成审计报告

生成结构化的审计报告,包含漏洞描述、受影响的代码位置、利用场景和修复建议。

预期输出

JSON 格式的报告,列出漏洞及其SWC(智能合约弱点分类)标识符、严重性评级、受影响的函数以及建议的修复方案。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

abusing-dpapi-for-credential-access

Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys) online or offline using SharpDPAPI, SharpChrome, Mimikatz, or Impacket

abusing-shadow-credentials-for-privesc

Take over Active Directory accounts by writing attacker-controlled public keys to msDS-KeyCredentialLink (Shadow Credentials) with pyWhisker, Whisker, or Certipy, then authenticate via PKINIT to recover the target

achieving-cmmc-level-2-compliance

>-

acquiring-disk-image-with-dd-and-dcfldd

Create forensically sound bit-for-bit disk images with dd or dcfldd on a Linux forensic workstation, preserving evidence integrity through hash verification (MD5/SHA) during acquisition. Use when imaging a suspect drive, USB device, or memory card for investigation, preserving volatile disk evidence during incident response, or producing a verified copy for legal or law-enforcement proceedings before any destructive analysis.

analyzing-active-directory-acl-abuse

Detect dangerous ACL misconfigurations in Active Directory using ldap3

analyzing-android-malware-with-apktool

Perform static analysis of Android APK malware using apktool for resource decompilation, jadx for Java source recovery, and androguard for manifest inspection, dangerous permission-combination detection, and identification of obfuscated code, dynamic code loading, and reflection-based API calls. Use to statically triage a suspicious APK without executing it or to build mobile malware detection rules.

analyzing-api-gateway-access-logs

Parses API Gateway access logs (AWS API Gateway, Kong, Nginx) to detect

analyzing-apt-group-with-mitre-navigator

Query ATT&CK data with attackcti, mitreattack-python, and stix2, then build MITRE ATT&CK Navigator layers and multi-layer heatmap overlays mapping one or more APT groups

analyzing-azure-activity-logs-for-threats

Queries Azure Monitor activity logs and sign-in logs via azure-monitor-query

analyzing-bootkit-and-rootkit-samples

Analyzes bootkit and advanced rootkit malware infecting the Master

analyzing-browser-forensics-with-hindsight

Parse Chromium-based browser databases with Hindsight to extract and correlate browsing history, downloads, cookies, cached content, autofill data, saved passwords, and extensions from Chrome, Edge, Brave, Opera, and Vivaldi into a unified timeline (XLSX, JSON, or SQLite output). Use during incident response, insider-threat investigations, or criminal cases when you need to reconstruct a user

analyzing-campaign-attribution-evidence

Systematically evaluate cyber-campaign evidence to attribute an operation to a threat actor, using the Diamond Model and Analysis of Competing Hypotheses (ACH) to weigh infrastructure overlaps, TTP consistency, malware code similarity, and timing/language artifacts into confidence-weighted attribution assessments. Use when an incident investigation needs a defensible attribution confidence level.

analyzing-certificate-transparency-for-phishing

Monitor Certificate Transparency logs using crt.sh and Certstream to

analyzing-cloud-storage-access-patterns

Detect abnormal access in AWS S3, GCS, and Azure Blob Storage by analyzing CloudTrail Data Events, GCS audit logs, and Azure Storage Analytics for after-hours bulk downloads, new-IP access, and API-call spikes (e.g. GetObject) via statistical baselines and time-series anomaly detection. Use when investigating suspected cloud data exfiltration or building related detection rules.

analyzing-cobalt-strike-beacon-configuration

Extract and analyze Cobalt Strike beacon configuration from PE files

analyzing-cobaltstrike-malleable-c2-profiles

Parse and analyze Cobalt Strike Malleable C2 profiles with dissect.cobaltstrike (profiles and beacon-payload configs) and pyMalleableC2 (AST parsing) to extract HTTP/DNS transforms, URIs, headers, sleep/jitter, and injection behavior, then generate network detection signatures. Use when reverse-engineering a captured malleable profile or building detections against Cobalt Strike Beacon traffic.

analyzing-command-and-control-communication

Analyzes malware C2 communication over HTTP, HTTPS, DNS, and custom

analyzing-cyber-kill-chain

Analyzes intrusion activity against the Lockheed Martin Cyber Kill Chain

analyzing-disk-image-with-autopsy

Perform comprehensive forensic analysis of raw (dd), E01, or AFF disk images with Autopsy and The Sleuth Kit, recovering deleted files, examining metadata and embedded artifacts, keyword searching, and building investigation timelines with visual reports. Use for structured analysis of a forensic disk image or when stakeholders need visual reports from evidence.

analyzing-dns-logs-for-exfiltration

Analyzes DNS query logs to detect data exfiltration via DNS tunneling,

相关技能