• 简体版 | 繁體版
  • 联系我们
  • 加入我们
  • 关于我们
  •  
  • 首页
  • 快讯
  • 价值号
  • 视频
  • 专题
  • 滚动
  • 入驻价值号
  • 碳链APP
    微信公众号

    扫码下载App

  • 登录
  • 微信公众号

    微信公众号

导航
  • 首页
  • 快讯
  • 区块链+
  • 价值号
  • 视频
  • 专题
  • DeFi优选
碳链价值APP
专注服务于金融科技和区块链
立即打开

门罗币(XMR)锁定转账攻击细节分析

慢雾科技慢雾科技  •  2019-08-13
近日,针对门罗币(XMR)转账锁定攻击在多个交易所出现,本文重现相关攻击细节分析。

By: ISME@SlowMist Team

近日据慢雾区情报显示,针对门罗币(XMR)转账锁定攻击在多个交易所出现,慢雾安全团队在收到情报第一时间进行分析跟进,本着负责任披露的原则我们第一时间在慢雾区进行了预警并为我们所服务的客户进行了及时的情报同步以及协助检测和修复。如有其他需要提供验证和检测服务欢迎联系慢雾安全团队。

攻击步骤

0x01:通过 monero-wallet-cli 输入密码登录钱包

0x02:通过命令发送锁定交易

0x03:转账完成,交易所未进行锁定交易(locked_transfer)检测,接收到被设置锁定区块高度才能解锁的币(可以理解为锁定了指定时间)。

0x04:恶意用户立即提币走人,留下交易所一脸懵逼。

造成影响

首先该攻击不会导致交易所任何资金损失,但是会锁定了交易所 XMR 流动性。

极端情况举例:如果交易所收到的都是需要锁定一年甚至更多年的门罗币则会导致一年内用户来提币的时候无币可以提(只能去购买额外的币来给用户提取)。

关于 locked_transfer 命令

monero-wallet-cli 关于 locked_transfer 命令解释如下:

locked_transfer [index=<N1>[,<N2>,...]] [<priority>] [<ring_size>] (<URI> | <addr> <amount>) <lockblocks> [<payment_id (obsolete)>]

转账命令:

locked_transfer FromAddress ToAddress 0.0101 20000

FromAddress:发送地址(一般为攻击者钱包地址)

ToAddress:接收地址(一般为交易所钱包地址)

0.0101:为转账金额

20000:为锁定区块数

如何防护

一般交易所会通过 get_transfers RPC 接口来解析 XMR 交易检测充值是否到账,在进行解析的时候只需要对 unlock_time字段进行判断是否大于 0 则可以进行有效检测。

注:unlock_time 为 int 类型,如果大于 0 则意味着该交易有锁定区块,为恶意交易可以不予确认到账。为了避免充值不予到账损害“用户”利益可以进行另外一种处理:判断锁定区块是否到达,如果未到达则不予入账。

所有受影响 RPC 接口

(1)get_transfer

(2)get_bulk_payments

(3)show_transfer

(4)get_payments

同理:在其他地方使用了如上四个接口的地方也需要对 unlock_time字段进行判断是否大于 0 ,大于 0 则不予充值到账。

该问题之前在 HackerOne 也有被白帽子提过漏洞赏金,其中门罗官方回复:

文章链接:

https://hackerone.com/reports/417515

附:以下内容为官方文档摘录

get_transfers

Returns a list oftransfers.

Alias: None.

Inputs:

  • in- boolean; (Optional) Include incoming transfers.

  • out- boolean; (Optional) Include outgoing transfers.

  • pending- boolean; (Optional) Include pending transfers.

  • failed- boolean; (Optional) Include failed transfers.

  • pool- boolean; (Optional) Include transfers from the daemon's transaction pool.

  • filter_by_height- boolean; (Optional) Filter transfers by block height.

  • min_height- unsigned int; (Optional) Minimum block height to scan for transfers, if filtering by height is enabled.

  • max_height- unsigned int; (Opional) Maximum block height to scan for transfers, if filtering by height is enabled (defaults to max block height).

  • account_index- unsigned int; (Optional) Index of the account to query for transfers. (defaults to 0)

  • subaddr_indices- array of unsigned int; (Optional) List of subaddress indices to query for transfers. (Defaults to empty - all indices)

Outputs:

  • inarray of transfers:

    • address- string; Public address of the transfer.

    • amount- unsigned int; Amount transferred.

    • confirmations- unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed).

    • double_spend_seen- boolean; True if the key image(s) for the transfer have been seen before.

    • fee- unsigned int; Transaction fee for this transfer.

    • height- unsigned int; Height of the first block that confirmed this transfer (0 if not mined yet).

    • note- string; Note about this transfer.

    • payment_id- string; Payment ID for this transfer.

    • subaddr_index- JSON object containing the major & minor subaddress index:

    • major- unsigned int; Account index for the subaddress.

    • minor- unsigned int; Index of the subaddress under the account.

    • suggested_confirmations_threshold- unsigned int; Estimation of the confirmations needed for the transaction to be included in a block.

    • timestamp- unsigned int; POSIX timestamp for when this transfer was first confirmed in a block (or timestamp submission if not mined yet).

    • txid- string; Transaction ID for this transfer.

    • type- string; Transfer type: "in"

    • unlock_time - unsigned int; Number of blocks until transfer is safely spendable.

  • outarray of transfers (see above).

  • pendingarray of transfers (see above).

  • failedarray of transfers (see above).

  • poolarray of transfers (see above).

Example:$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfers","params":{"in":true,"account_index":1}}' -H 'Content-Type: application/json'{ "id": "0", "jsonrpc": "2.0", "result": { "in": [{ "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", "amount": 200000000000, "confirmations": 1, "double_spend_seen": false, "fee": 21650200000, "height": 153624, "note": "", "payment_id": "0000000000000000", "subaddr_index": { "major": 1, "minor": 0 }, "suggested_confirmations_threshold": 1, "timestamp": 1535918400, "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", "type": "in", "unlock_time": 0 }] }}

get_payments

Get a list ofincoming payments using a given payment id.

Alias: None.

Inputs:

  • payment_id- string; Payment ID used to find the payments (16 characters hex).

Outputs:

  • payments- list of:

    • payment_id- string; Payment ID matching the input parameter.

    • tx_hash- string; Transaction hash used as the transaction ID.

    • amount- unsigned int; Amount for this payment.

    • block_height- unsigned int; Height of the block that first confirmed this payment.

    • unlock_time- unsigned int; Time (in block height) until this payment is safe to spend.

    • subaddr_index- subaddress index:

    • major- unsigned int; Account index for the subaddress.

    • minor- unsigned int; Index of the subaddress in the account.

    • address- string; Address receiving the payment; Base58 representation of the public keys.

Example:$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_payments","params":{"payment_id":"60900e5603bf96e3"}}' -H 'Content-Type: application/json'{ "id": "0", "jsonrpc": "2.0", "result": { "payments": [{ "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", "amount": 1000000000000, "block_height": 127606, "payment_id": "60900e5603bf96e3", "subaddr_index": { "major": 0, "minor": 0 }, "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", "unlock_time": 0 }] }}

get_bulk_payments

Get a list ofincoming payments using a given payment id, or a list of payments ids, from agiven height. This method is the preferred method over get_paymentsbecause it has the same functionality butis more extendable. Either is fine for looking up transactions by a singlepayment ID.

Alias: None.

Inputs:

  • payment_ids- array of: string; Payment IDs used to find the payments (16 characters hex).

  • min_block_height- unsigned int; The block height at which to start looking for payments.

Outputs:

  • payments- list of:

    • payment_id- string; Payment ID matching one of the input IDs.

    • tx_hash- string; Transaction hash used as the transaction ID.

    • amount- unsigned int; Amount for this payment.

    • block_height- unsigned int; Height of the block that first confirmed this payment.

    • unlock_time- unsigned int; Time (in block height) until this payment is safe to spend.

    • subaddr_index- subaddress index:

    • major- unsigned int; Account index for the subaddress.

    • minor- unsigned int; Index of the subaddress in the account.

    • address- string; Address receiving the payment; Base58 representation of the public keys.

Example:$ curl -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_bulk_payments","params":{"payment_ids":["60900e5603bf96e3"],"min_block_height":"120000"}}' -H 'Content-Type: application/json'{ "id": "0", "jsonrpc": "2.0", "result": { "payments": [{ "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", "amount": 1000000000000, "block_height": 127606, "payment_id": "60900e5603bf96e3", "subaddr_index": { "major": 0, "minor": 0 }, "tx_hash": "3292e83ad28fc1cc7bc26dbd38862308f4588680fbf93eae3e803cddd1bd614f", "unlock_time": 0 }] }}

get_transfer_by_txid

Show informationabout a transfer to/from this address.

Alias: None.

Inputs:

  • txid- string; Transaction ID used to find the transfer.

  • account_index- unsigned int; (Optional) Index of the account to query for the transfer.

Outputs:

  • transfer- JSON object containing payment information:

    • address- string; Address that transferred the funds. Base58 representation of the public keys.

    • amount- unsigned int; Amount of this transfer.

    • confirmations- unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed).

    • destinations- array of JSON objects containing transfer destinations:

    • amount- unsigned int; Amount transferred to this destination.

    • address- string; Address for this destination. Base58 representation of the public keys.

    • double_spend_seen- boolean; True if the key image(s) for the transfer have been seen before.

    • fee- unsigned int; Transaction fee for this transfer.

    • height- unsigned int; Height of the first block that confirmed this transfer.

    • note- string; Note about this transfer.

    • payment_id- string; Payment ID for this transfer.

    • subaddr_index- JSON object containing the major & minor subaddress index:

  • major- unsigned int; Account index for the subaddress.

  • minor- unsigned int; Index of the subaddress under the account.

  • suggested_confirmations_threshold- unsigned int; Estimation of the confirmations needed for the transaction to be included in a block.

  • timestamp- unsigned int; POSIX timestamp for the block that confirmed this transfer (or timestamp submission if not mined yet).

  • txid- string; Transaction ID of this transfer (same as input TXID).

  • type- string; Type of transfer, one of the following: "in", "out", "pending", "failed", "pool"

  • unlock_time- unsigned int; Number of blocks until transfer is safely spendable.

Example:$ curl -X POST http://localhost:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfer_by_txid","params":{"txid":"c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a"}}' -H 'Content-Type: application/json'{ "id": "0", "jsonrpc": "2.0", "result": { "transfer": { "address": "55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", "amount": 300000000000, "confirmations": 1, "destinations": [{ "address": "7BnERTpvL5MbCLtj5n9No7J5oE5hHiB3tVCK5cjSvCsYWD2WRJLFuWeKTLiXo5QJqt2ZwUaLy2Vh1Ad51K7FNgqcHgjW85o", "amount": 100000000000 },{ "address": "77Vx9cs1VPicFndSVgYUvTdLCJEZw9h81hXLMYsjBCXSJfUehLa9TDW3Ffh45SQa7xb6dUs18mpNxfUhQGqfwXPSMrvKhVp", "amount": 200000000000 }], "double_spend_seen": false, "fee": 21650200000, "height": 153624, "note": "", "payment_id": "0000000000000000", "subaddr_index": { "major": 0, "minor": 0 }, "suggested_confirmations_threshold": 1, "timestamp": 1535918400, "txid": "c36258a276018c3a4bc1f195a7fb530f50cd63a4fa765fb7c6f7f49fc051762a", "type": "out", "unlock_time": 0 } }}点击查看官方文档:

https://www.getmonero.org/resources/developer-guides/wallet-rpc.html

展开全文
打开碳链价值APP  查看更多精彩资讯
声明:本文内容为作者独立观点,不代表碳链价值立场,且不构成任何投资理财建议。
0 0
攻击XMR链圈子

扫一扫,分享到微信

相关推荐

XMR、ZEC、Dash哪个才是最好的隐私币? 价值号

XMR、ZEC、Dash哪个才是最好的隐私币?

AXA Labs 2022-07-22 价值号
XMRZECDASH
发明隐私币是为了保护区块链上用户的匿名性。隐私币不是在公共分类账上记录交易,而是将交易分组;以至于没有人知道这笔钱的来源。
元宇宙先驱下周或有大动作 苹果库克却称:远离这个流行词 滚动

元宇宙先驱下周或有大动作 苹果库克却称:远离这个流行词

区块链资讯 2021-10-21 滚动
元宇宙链圈子
从目前的情况来看,实现终极元宇宙道阻且长
区块链企业已超1400家,运营商如何驱动区块链应用创新提速? 滚动

区块链企业已超1400家,运营商如何驱动区块链应用创新提速?

区块链资讯 2021-10-14 滚动
区块链企业产业区块链链圈子
目前我国区块链企业已超过1400家,初步形成较为完善的产业链条

碳链快讯更多 ›

2023-04-02

山西警方查处了一个制造并分销假钱包的团伙

2023-04-02

Vitalik:ZK-EVM 将成为以太坊的第三种客户端,应推动创建一个开放的多客户端 ZK-EVM 生态

2023-04-02

马斯克要求法官驳回狗狗币投资者对其提起的 2580 亿美元集体诉讼

2023-04-01

彭博社:孙宇晨已就出售 Huobi 股份进行谈判,对话尚处于早期阶段

2023-04-01

OpenAI CEO 旗下加密项目 Worldcoin 推出去中心化身份协议「World ID」

2023-04-01

数据:以太坊上 Aave V3 总市场规模突破 10 亿美元

2023-04-01

彭博社:数字货币为第一季度表现最佳的资产类别

2023-04-01

亚马逊 NFT 市场将上架 Beeple 与 Pudgy Penguins 等创作者和项目的数字收藏品

2023-04-01

美国全国期货协会通过数字资产商品相关规定,将于 2023 年 5 月 31 日生效

2023-04-01

推特开放包括推荐算法在内的大部分源代码

2023-04-01

动视暴雪前总裁 Daniel Alegre 正式加入 Yuga Labs 出任 CEO

2023-04-01

Arbitrum 发起新提案将引入 ArbitrumDAO 并申请 10 亿美元拨款

2023-03-31

跨链桥聚合器 LI.FI 完成 1750 万美元 A 轮融资,CoinFund 和 Superscrypt 领投

2023-03-31

周小川:数字货币别急着想赢者通吃,每隔三五年局面就会有大变化

2023-03-31

CAIDP敦促美FTC调查OpenAI违反消费者保护规则的行为

2023-03-31

美SEC对Ormeus Coin项目创始人分别处罚超2314万美元

2023-03-31

彭博社:韩国法院再次驳回对Terra联创Daniel Shin的逮捕令

2023-03-31

外媒:Tron 创始人孙宇晨失去了外交官身份

2023-03-31

阿根廷航空公司 Flybondi 发行基于 Algorand 的 NFT 机票

2023-03-31

数据:USDC 稳定币市值过去两周下跌约 100 亿美元至 325 亿美元

2023-03-30

硬件钱包 Ledger 以 13 亿欧元估值完成 1 亿欧元融资

2023-03-30

联合国儿童基金会正在创建 DAO 原型

2023-03-30

腾讯高级执行副总裁汤道生:腾讯正研发类ChatGPT聊天机器人

2023-03-30

丹麦最高法院裁定对比特币销售利润征税

2023-03-30

报告:预测加密货币捐款将在十年内超过100亿美元

2023-03-30

印度在2023财年已征收超过1920万美元的加密税

2023-03-30

数字监管领域专业人士:到2030年合规稳定币将得到广泛使用

2023-03-30

韩国三大加密交易所XRP交易量飙升至数十亿美元

2023-03-30

日本财务省或将于4月成立CBDC专家小组,讨论发行可能性

2023-03-30

美国财政部副部长:美国的银行倒闭事件不应归咎于加密行业

2023-03-30

3月10日以来USDC净流出超过100亿美元,USDT市场份额创22个月新高

2023-03-30

美联储主席:年内预计还会加息一次

2023-03-30

美 SEC 主席:证券法涵盖加密市场大部分活动,无需额外立法

2023-03-29

英国发布人工智能监管白皮书 概述了针对ChatGPT等人工智能治理的五项原则

2023-03-29

美金融服务委员会将连同 SEC 主席寻求明确加密监管策略和制定规则的方法

2023-03-29

俄罗斯推迟原计划于 4 月 1 日开始的央行数字货币试点

2023-03-29

以太坊再质押协议 EigenLayer 开发商 EigenLabs 完成 5000 万美元 A 轮融资

2023-03-29

Circle 披露 USDC 储备结构:80% 为短期美国国债,约 20% 为现金存款存储在 GSIB

2023-03-29

Voyager Digital 向 Circle 转移 1.5 亿美元 USDC 将其兑换成美元

2023-03-28

美亚柏科:公司将对各类AIGC内容的检测、AI生成文本的检测技术及产品进行布局

2023-03-28

Galaxy Digital 披露在 2022 年净亏损达 10 亿美元

2023-03-28

慢雾:批准未知来源的代币时请仔细检查交易的 gas limit

2023-03-28

蚂蚁集团:于隽曾是外派至A&T Capital的工作人员,目前已办结离职手续

2023-03-28

香港金管局和证监会将于 4 月 28 日联合举办加密企业和银行家之间的圆桌会议

2023-03-28

英国财政部取消由政府支持的 NFT 计划

2023-03-28

欧盟将于 3 月 28 日投票表决是否禁止匿名自托管钱包转账大额加密资产

2023-03-28

日经亚洲:美 SEC 对孙宇晨的指控或将影响 Huobi 香港牌照申请及扩张计划

2023-03-28

CFTC提起诉讼后价值近15亿美元的加密资产从币安相关钱包流出

2023-03-27

CFTC 诉币安及其 CEO 违法以寻求民事货币罚款和其他衡平救济

2023-03-27

CFTC指控Binance概述:涉及向美国投资者提供的交易服务及其合规性问题

推荐文章

  • OpenAI 秘史公开:马斯克和奥特曼的战争,与钱无关

    2023-04-02

  • Messari 报告:深度解读 DAO 工作组的资金分配现状

    2023-04-01

  • Copy to China难以复现,中国的大模型机会在何处?

    2023-03-30

  • 人类精英呼吁暂停 AI 实验 ChatGPT:合理但谨慎考虑

    2023-03-30

  • 一文解读香港虚拟资产监管政策的变迁

    2023-03-30

价值号更多 ›

达瓴智库
达瓴智库
文章: 155
  • 如何通过MVRV判断加密牛市还是熊市?
  • ETH在上海升级期间表现如何?
  • 熊末牛初:Ordinals是福是祸?
区块链骑士
区块链骑士
文章: 1302
  • Web3时代游戏会如何演变?
  • 继美国后,澳洲也有大动作?澳洲参议员提案将优化数字资产监管
  • SEC主席正在成为数字资产“教父”?高强度监管是否矫枉过正?
TinTinLand
TinTinLand
文章: 36
  • 去中心化存储,值得关注的问题与成功用例
  • 一家银行倒闭后,加密市场发生了什么?
  • 打破科研困境的 DeSci 是什么?
换一批

热门标签

新基建 比特币 以太坊 DeFi 共识对话 区块链+ 美联储 央行数字货币 加密衍生品 AI 云计算 大数据 5G 政策 交易所 稳定币 电子支付 Libra 算力产业 联盟链 公链 区块链 加密货币 Nervos Cosmos EOS BCH STO 数字货币 去中心化

邮件订阅

及时、全面、专业、准确的资讯与数据,致力于为区块链爱好者以及数字货币投资者提供最好的服务。

App内打开

邮件订阅

及时、全面、专业、准确的资讯与数据,致力于为区块链爱好者以及数字货币投资者提供最好的服务。

Moshou

碳链价值是集资讯、行情、数据于一身的区块链信息服务平台,我们追求及时、全面、专业、精确的资讯与数据,致力于为区块链创新者和数字货币投资者提供优质的服务。

关于我们 加入我们 联系我们 隐私条款
微信公众号

扫一扫关注微信公众号

Copyright © 2018-2020 碳链价值 京ICP备18046423号
下载碳链App

下载碳链App

微信公众号

微信公众号

微信公众号

微信公众号

打赏文章作者

支付宝打赏二维码 支付宝扫一扫打赏
微信打赏二维码 微信扫一扫打赏

# 热门搜索 #

CBDC 比特币 DeFi 以太坊 区块链