当硬核黑客开始研究“钓鱼”,你的NFT还安全吗?

成都链安Опубліковано о 2022-06-13Востаннє оновлено о 2022-06-13

Анотація

前有周杰伦无聊猿NFT被钓鱼攻击,损失超300万人民币。(愚人节,周杰伦的NFT是如何被黑客盗走的?)

前有周杰伦无聊猿NFT被钓鱼攻击,损失超300万人民币。(愚人节,周杰伦的NFT是如何被黑客盗走的?)

后有全球最大的NFT交易平台之一OpenSea大批用户遭遇钓鱼攻击,多人资产受损。(OpenSea“钓鱼攻击”事件又给我们哪些启示?)

可见Web3世界黑客依然猖狂作祟,为了打击黑客嚣张的气焰,我们将为大家持续输出干货系列文章,教导大家NFT防骗技巧。

本文研究了两类典型的NFT的钓鱼攻击,一类是盗取用户签名的钓鱼攻击,如:Opensea钓鱼邮件事件;一类是高仿域名和内容的NFT钓鱼网站。跟我们一起看看图片。

PART01

「盗取用户签名的钓鱼」

2022年2月21日,全球最大的加密数字藏品市场Opensea遭遇黑客攻击。根据Opensea官方回复,有部分用户由于签署了给黑客的授权而导致用户NFT被盗。

我们将本次事件再次复现一下,在本次事件攻击事件中,攻击者信息如下:

攻击者地址(Fake_Phishing5169):

0x3e0defb880cd8e163bad68abe66437f99a7a8a74

攻击者合约(Fake_Phishing5176):

0xa2c0946ad444dccf990394c5cbe019a858a945bd

攻击者获得相关NFT的交易具体如下图所示:

针对其中一笔交易进行分析,

0xee038a31ab6e3f06bd747ab9dd0c3abafa48a51e969bcb666ecd3f22ff989589,具体内容如下:

由上图可知,攻击者是获得了用户的授权,之后直接调用transferfrom方法将用户的NFT盗走。

根据Opensea的CEODevinFinzer发布的twitter,攻击者是通过钓鱼的方式获取到用户在Opensea上的挂单授权。

通过分析攻击交易,黑客攻击主要分为以下三个步骤。

1.构造正确的待签名交易;

2.诱骗用户点击授权;

3.获取用户签名后构造攻击合约盗取用户NFT。

步骤一

首先对攻击者构建的交易签名内容进行分析,跟踪函数调用栈发现具体的签名信息如下:

由上图可知,签名的计算方式为:keccak256("\x19EthereumSignedMessage:\n32",hashOrder(order));这种签名方式会在order前再加一个消息前缀:’\x19EthereumSignedMessage:\n32’,以确保改签名不能在以太坊之外使用。之后将加上消息前缀的完整数据再计算keccak256值,最后用私钥进行签名。

但是该方式仅能声明所有权,无法防止重放攻击。如:用户A签署了消息发送给合约M,另一用户B可以将这个签名重放给合约N。下图为订单签名中具体涉及到的信息。

其中涉及到的签名主要参数为:

-Side:买入或卖出

-paymentToken:用于支付订单的代币类型

-basePrice:订单中NFT的价格

-maker:订单发出地址

-taker:接收订单的目标地址

上述签名信息中包含订单金额、目标地址等敏感信息,但是经过keccak256计算Hash后的值只是一串二进制字符串,用户无法识别。

攻击者根据上述Order信息构造签名,可以随意将上述签名中涉及到的basePrice参数金额设置为0,接收地址设置为自己等。

步骤二

攻击者构造好待签名数据后就可以诱骗用户点击授权。由于签名的元数据是经过Keccak256计算后得到的包含0x的66个十六进制字符,用户无法得知其代表的具体含义,因此可能直接点击签名,使得攻击者获得了用户的挂单授权。

上图中的签名对于用户来说类似盲签,即所签的消息内容对签名人来说是盲的,签名人不能看见消息的具体内容。

步骤三

在步骤二中攻击者获取到ECDSA签名消息中的R、S、V值,即可利用其构造攻击合约盗取用户NFT。下图为OpenSea:WyvernExchangev1合约中验证order的函数validateOrder(),具体源码如下:

由源码可知,订单验证首先会校验order的有效性和是否包含有效参数,接着校验订单是否曾经通过链上校验。其中approvedOrders是一个mapping变量,该变量保存了所有已经通过链上批准验证的订单。如果订单曾经校验过则直接返回true,无需再使用ecrecover()校验ECDSA签名,以便智能合约可以直接下订单。

以下是其中一笔NFT盗取交易,可以发现攻击者利用用户签名通过调用攻击者合约(Fake_Phishing5176):

0xa2c0946ad444dccf990394c5cbe019a858a945bd,以0ether的价格盗取了用户的NFT。

PART02

「高仿域名的NFT钓鱼」

这一类的钓鱼网站主要是对NFT项目官网的域名和内容等进行几乎一致的模仿,一般会先连接用户钱包查询用户余额之后,再进行其他诱骗操作。这种钓鱼网站是最常见的,主要分为以下几种类型:

1仅更换原官网的顶级域名

案例一

官网:https://invisiblefriends.io/

钓鱼网站:https://invisiblefriends.ch/

查看钓鱼网站的网页源码,可以发现如下攻击地址:

查看

0xEcAcDb9FA4Ed4ACD8977821737da7bCe688be1e0的相关交易:

可以发现上述两笔交易是攻击者获取到的收益。

案例二

官网:https://cyberbrokers.io/

钓鱼网站:https://cyberbrokers.live/

查看钓鱼网站源码,发现如下攻击地址:

综上,该类事件主要是因为用户在签署交易签名时,由于签署的交易内容是加密后的字符串,导致用户无法直观的看到签署交易的具体内容,习惯性的点击确认,从而造成攻击者获取到用户的卖单权授权,盗走用户的NFT。(编辑修正:此段为第一部分结尾总结)

2主域名添加单词或符号进行混淆

有的钓鱼网站会在主域名添加单词或符号进行混淆,比如othersidemeta-airdrop、otherside-refunds.xyz等。

官网:https://otherside.xyz/

钓鱼网站:http://othersidemeta-airdrop.com/

查看钓鱼网站源码,发现页面存在setApprovalForAll()函数,该函数会授权_operator具有所有代币的控制权。如果用户授权了攻击者,则用户账号中所有的NFT将会被盗走。

3添加二级域名进行混淆

有的钓鱼网站会添加二级域名进行混淆,进行钓鱼欺骗。

官网:https://www.okaybears.com/

钓鱼网站:https://okaybears.co.uk/

查看网页源码,根据solanaweb3的官方文档API,确认如下地址为攻击地址:

在如今钓鱼事件频发的情况下,用户需提高安全意识,保护自己。以下是我们的安全建议:

1签名时应当明确签署的交易内容,包括交易价格、交易地址等信息,如下图红框处内容所示:

如果存在签署内容仅为二进制字符串内容等无法明确的内容,请勿签署。

2切勿点击任何邮件中的链接、附件,或输入任何个人信息。

3访问NFT官网时,一般在官网右上角等处会显示官方twitter、discord等社交帐号,需在官方账号上确认官网地址。

4安装钓鱼插件,可辅助识别部分钓鱼网站。比如下面这一款(复制链接谷歌浏览器直接安装)

https://chrome.google.com/webstore/detail/beosin-alert/lgbhcpagiobjacpmcgckfgodjeogceji?hl=zh-CN

Пов'язані матеріали

Podcast Notes: Hyperliquid Has Become the Top Interest Point for Traditional Hedge Funds

Empire Podcast hosts Jason Yanowitz and Santiago Santos discuss the surging institutional interest in Hyperliquid, a decentralized perpetual exchange, marking the highest level of engagement from traditional hedge fund managers since Paul Tudor Jones endorsed Bitcoin in 2020. The primary driver is the demand for weekend trading of commodities like oil, especially during geopolitical tensions such as the Iran conflict, as Hyperliquid provides the only active price discovery venue when traditional markets are closed. Trade XYZ, a front-end on Hyperliquid, has seen significant growth, with weekend oil price predictions having a median error of only 50 basis points. Santos predicts commodity trading volume on Hyperliquid will surpass Bitcoin within the year and that its market cap could rise from $25 billion to $100 billion. Other key points include Kraken raising $200 million at a reduced valuation of $13.3 billion, and the SEC clarifying that self-custodied DeFi frontends like MetaMask are not subject to broker-dealer rules, resolving a major regulatory uncertainty. The hosts also note the strong correlation between crypto and macro markets, with the S&P 500 posting one of its best 10-day rallies since 1950. They highlight MicroStrategy's continued Bitcoin acquisitions and the potential of real-world asset (RWA) tokenization as a key trend. The discussion concludes with skepticism towards many L2 projects, predicting a wave of protocols truly going to zero as capital concentrates in proven assets like Bitcoin and Hyperliquid.

marsbit5 год тому

Podcast Notes: Hyperliquid Has Become the Top Interest Point for Traditional Hedge Funds

marsbit5 год тому

a16z: The Next Frontier of AI, The Triple Flywheel of Robotics, Autonomous Science, and Brain-Computer Interfaces

a16z presents a comprehensive investment thesis for the next frontier of AI: Physical AI, centered on a synergistic flywheel of robotics, autonomous science, and novel human-computer interfaces (HCIs) like brain-computers. While the current AI paradigm scales on language and code, the most disruptive future capabilities will emerge from three adjacent fields leveraging five core technical primitives: 1) learned representations of physical dynamics (via models like VLA, WAM, and native embodied models), 2) embodied action architectures (e.g., dual-system designs, diffusion-based motion generation, and RL fine-tuning like RECAP), 3) simulation and synthetic data as scaling infrastructure, 4) expanded sensory channels (touch, neural signals, silent speech, olfaction), and 5) closed-loop agent systems for long-horizon tasks. These primitives converge to power three key domains: * **Robotics:** The literal embodiment of AI, requiring all primitives for real-world physical interaction and manipulation. * **Autonomous Science:** Self-driving labs that conduct hypothesis-experiment-analysis loops, generating structured, causally-grounded data to improve physical AI models. * **Novel HCIs:** Devices (AR glasses, EMG wearables, BCIs) that expand human-AI bandwidth and act as massive data-collection networks for real-world human experience. These domains form a mutually reinforcing flywheel: Robotics enable autonomous labs, which in turn generate valuable data for robotics and materials science. New interfaces provide rich human-physical interaction data to train better robots and scientists. Together, they represent a new scaling axis for AI, moving beyond the digital realm to interact with and learn from physical reality, promising significant emergent capabilities and value.

marsbit6 год тому

a16z: The Next Frontier of AI, The Triple Flywheel of Robotics, Autonomous Science, and Brain-Computer Interfaces

marsbit6 год тому

Торгівля

Спот
Ф'ючерси
活动图片