avatar
Articles
111
Tags
11
Categories
0

Home
Archives
Tags
About
何方圜的博客
Home
Archives
Tags
About

何方圜的博客

Untitled
Created2024-11-17
攻击介绍2023年7月11日,Arbitrum链上的Rodeo Finance: Pool由于价格预言机操纵,而被黑客盗取了472 ETH。 攻击分析攻击者利用了预言机的缺陷控制了unshETH与ETH之间的兑换比率,预言机使用 ETH 与 unshETH 的准备金比率来检查价格。同时攻击者能够通过具有未配置策略地址的 earn 函数强制平台将 USDC 兑换为 unshETH。由于价格预言机存在缺陷,滑点控制无法生效。(具体可见Meth为0x7b37c42b的交易)。 function earn(address usr, address pol, uint256 str, uint256 amt, uint256 bor, bytes calldata dat) external loop returns (uint256){ if (status < S_LIVE) revert WrongStatus(); if (!pools[pol]) revert InvalidPool(); if (strategies[str] == addres ...
CTF-Numen-LenderPool
Created2024-11-13
CTF-Numen-LenderPool题目有点长的,主要是接口使用多了源代码点击 要求很明显: function isSolved() public view returns (bool) { if (token0.balanceOf(address(lenderPool)) == 0) { return true; } 耗尽池中所有的token0 关键就是在flashLoan函数中一个外部调用出现了问题: token0.transfer(borrower, borrowAmount); borrower.functionCall(abi.encodeWithSignature("receiveEther(uint256)", borrowAmount)); 当发送给borrower ``token0时,会调用borrower的内部函数去接受,虽然flashLoan函数有防止重入的攻击的修饰,但是swap()函数没有防止重入攻击的修饰符,所以就可一进行一个=跨函数的重入攻击。 所以这就 ...
CTF-OnlyPwner-REVERSE RUGPULL
Created2024-11-12
题目源码: // SPDX-License-Identifier: MITpragma solidity ^0.8.4;contract PrivilegeFinance { string public name = "Privilege Finance"; string public symbol = "PF"; uint256 public decimals = 18; uint256 public totalSupply = 200000000000; mapping(address => uint) public balances; mapping(address => address) public referrers; string msgsender = '0x71fA690CcCDC285E3Cb6d5291EA935cfdfE4E0'; uint public rewmax = 65000000000000000000000; uint publi ...
CTF-OnlyPwner-FREEBIE
Created2024-11-11
CTF-OnlyPwner-FREEBIE题目地址 点击 要求是将合约的余额变为零 源代码很少 pragma solidity 0.8.19;import {IVault} from "./interfaces/IVault.sol";contract Vault is IVault { uint256 public totalDeposited; function deposit() external payable { totalDeposited += msg.value; emit Deposit(msg.sender, msg.value); } function withdraw(uint256 amount) external { totalDeposited -= amount; payable(msg.sender).transfer(amount); emit Withdraw(msg.send ...
CodeHawks-GivingThanks审计报告
Created2024-11-11
一SummaryThe attacker can register their own address as the charitable organization and then perform a self-transfer by donating to the organization, effectively receiving a specific minted NFT for free. Vulnerability DetailsVulnerability code source:https://github.com/Cyfrin/2024-11-giving-thanks/blob/304812abfc16df934249ecd4cd8dea38568a625d/src/GivingThanks.sol#L21-L23 There is no check to verify whether the charitable organization’s address is the same as the donor’s address, which allows atta ...
newfi攻击事件的分析
Created2024-11-09
攻击介绍2023年7月17日,bscscan链上的NewFi被黑客攻击,一共损失了价值31k$的BUSD。 攻击分析我们使用phalcon进行分析,通过phalcon的调用栈分析,可以看到攻击者首先从4个池子贷了大量的BUSD,然后在PancakeSwap: Smart Router V3中通过以质押与回收BUSD从中套了31,099的BUSD。分析StakedV3.Invest()的调用栈,发现sqrtPriceX96从456917351256涨到了396517633895,显然攻击者通过StakedV3的Invest()方法操纵了价格。 POC // SPDX-License-Identifier: UNLICENSEDpragma solidity ^0.8.10;import "forge-std/Test.sol";import "./interface.sol";// Vulnerable Contract : 0xb8dc09eec82cab2e86c7edc8dd5882dd92d22411// Attack Tx : 0x557 ...
CTF-DeFi Hack
Created2024-11-04
DeFi Hack由于这个是一个题目集,就写在一起,做个写题记录五个题目的源代码,都在这里了:源代码:点击 May The Force Be With You题目要求是:要取得合约中所有的代币 首先还是看代码,合约代码,还是简单,重点还是看向withdrew函数,要撤回合约中的所有代币, function withdraw(uint256 numberOfShares) external nonReentrant { // Gets the amount of xYODA in existence uint256 totalShares = totalSupply(); // Calculates the amount of YODA the xYODA is worth uint256 what = numberOfShares.mul(yoda.balanceOf(address(this))).div(totalShares); _burn(msg.sender, numberOfShare ...
Uwerx攻击事件分析
Created2024-11-03
攻击介绍2023年8月2日,Uwerx被黑客攻击,损失了175ETH。 攻击分析我们通过phalcon来分析。 通过调用栈能发现攻击者通过不断在uniswap V2 Pool交换,最终获利。很明显是Pool的兑换比率被破坏了。之所以能被破坏,是因为uwerx TOKEN合约的_transfer()方法被利用了。 function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 ...
UniswapV3,V4 功能对比
Created2024-11-03
以下功能对比摘抄于官网V4 与 V3虽然 Uniswap v4 的基础集中流动性与 Uniswap v3 相同, 架构和会计存在一些关键差异。 单例设计矿池创建V4:单例合约有助于创建矿池和 还会存储其 state。此模式可降低创建池时的成本 以及执行多跳交换。因为矿池是合约状态,而不是全新的合约本身,所以矿池的创建成本要低得多。 V3:工厂合约负责创建矿池。池是 一个单独的 Contract 实例,用于管理自己的 state。矿池初始化 成本高昂,因为合约创建是 gas 密集型的 Flash Accounting (快速记帐)V4:单例使用 flash accounting,即解锁 PoolManager 的调用方 允许进行余额更改操作(多次掉期、多次流动性修改等) 并且只需要在序列的最末端执行 token 传输。 V3:因为 V3 中缺少 Flash Accounting,所以这是责任 集成合约执行代币转账,在每次单独调用后,对每个单独的矿池合约进行代币转账 流动性费用会计V4:应计费用在修改流动性时起到抵免的作用。 增加流动性会将费用收入转化为流动性 仓内流动性降低会自动 要求提 ...
git 协作流程
Created2024-11-02
团队协作首先使用在gitub 上进行团队的协作,就是你自己要先弄一个分支,然后再提交上去,流程如下:git clone 仓库进入到仓库中:cd 仓库名然后切换分支到要协作的分支:git checkout 分支名创建自己的分支:git checkout -b 分支名1写好自己的部分再提交:git add .同上提交:git commit -m “描述”推送至远程自己创建的分支:git push origin 分支名1这样就可以再创库中看到自己的分支,然后再提交去分支名(也就是说pr:Pull requst)注意要指定review; 个人上传文件到仓库 将本地文件上传到github上,要有一个自己想上传的仓库,cd 要上传的文件名,git remote add origin (ssh下的仓库地址),切换分支,主要是看仓库是master,还是main, 还是其他的分支,git branch -M main , 切换到main分支上直接上传到分支上 git push -u origin main即可 初始化一个仓库git init 仓库名写好文件后使用git add . 将文件上传至缓存区查看 ...
1…456…12
avatar
何方圜
夫孰异道而相安
Articles
111
Tags
11
Categories
0
Follow Me
Announcement
CTF的更新
Recent Post
Uniswap v42025-12-15
MOVE漏洞总结2025-08-29
move 学习2025-07-28
Notional Exponent 审计2025-07-28
GMX协议遭受重入攻击损失4200万美美金2025-07-11
Tags
审计报告 基础知识 攻击事件分析 基本知识 题解 协议 test 课程学习 链接 CTF Solana
Archives
  • 十二月 20251
  • 八月 20251
  • 七月 20253
  • 六月 20257
  • 五月 20252
  • 四月 20252
  • 三月 20252
  • 十二月 202411
Info
Article :
111
UV :
PV :
Last Update :
©2020 - 2025 By 何方圜
Framework Hexo|Theme Butterfly