reentrancy
Hunt and validate reentrancy bugs — classic cross-function, same-function, read-only, and cross-contract variants.
- License 许可
- Apache-2.0
- 所属仓库
- Akapi895/raptix
- 最近更新
- 2026-11-06
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- reentrancy
- metadata
- { "subdomain": "smart-contracts", "when_to_use": "reentrancy cross-function read-only erc777 erc1155 hook callback evm", "mitre_attack": [ "T1190" ] }
- description
- Hunt and validate reentrancy bugs — classic cross-function, same-function, read-only, and cross-contract variants.
03 SKILL.md 正文
Reentrancy Playbook
Variants
- Classic — external call before state update (The DAO)
- Cross-function — A calls out, reentered into B which reads/writes A's state
- Read-only — view function reads stale state during reentrancy, consumed by a second contract making decisions
- Cross-contract — same attack pattern across protocol boundaries
- ERC777 / ERC1155 hook —
onERC*Receivedcallback re-enters
Audit steps
solidity_scan_fileflags every.call{value:...}anddelegatecall- For each hit, check:
- Is there a state write BEFORE the external call?
- Is
ReentrancyGuard'snonReentrantmodifier applied? - Does it follow checks-effects-interactions?
- Trace call graph — if any function the call target can invoke reads or writes the same state slot, that's a reentrancy chain.
PoC via Foundry
foundry_reentrancy_test(target="Vault", function="withdraw", target_path="src/Vault.sol")
Then:
cp generated.t.sol /workspace/foundry/test/
cd /workspace/foundry && forge test -vvv --match-contract Test_withdraw
Success criteria
The attacker contract balance grows by more than its initial deposit after the attack transaction. The Foundry test should assert this.
CVSS
- Direct fund drain:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H= 10.0 - Read-only with downstream impact: 8.1-9.1 depending on impact
Known exemplars
- The DAO (2016)
- Lendf.Me (2020, ERC777 hook reentrancy, $25M)
- Cream Finance (2021)
- Rari Capital (2022)
- Curve pool read-only reentrancy (2023)
04 同仓库更多 Skills
wps-pixie-dust
WPS Pixie-Dust offline nonce attack (reaver -K / pixiewps) and fallback online PIN brute (bully) to recover the AP's WPA PSK without capturing a handshake.
wpa3-sae
WPA3-SAE transition-mode downgrade (DragonShift), SSID Confusion CVE-2023-52424, Dragonblood side-channels, and SAE captive-portal credential recovery against WPA3-Personal networks.
wpa2-psk
WPA/WPA2-PSK handshake capture via targeted deauth + PMKID (no deauth required) + offline hashcat cracking. The most common consumer/SMB encryption mode in 2026.
wpa-enterprise-eap
WPA/WPA2/WPA3-Enterprise (802.1X/EAP) rogue-RADIUS evil-twin for MSCHAPv2 capture, GTC downgrade, and PEAP relay. MSCHAPv2 capture equals a NetNTLM hash — the primary wireless on-ramp to Active Directory.
krack-fragattacks
KRACK key-reinstallation (CVE-2017-13077..13082) and FragAttacks fragmentation/aggregation flaws (CVE-2020-24586..24588, CVE-2020-26139..26147) against legacy or embedded 802.11 supplicants with poor patch cadence.
evil-twin-karma
Evil-twin rogue AP with KARMA/Mana PNL-probe response, captive-portal credential capture, and post-association MITM for PSK/open networks. Distinct from wpa-enterprise-eap which targets 802.1X.