爆辣火鸡 2024-02-16 20:24 采纳率: 44.4%
浏览 7
已结题

manticore符号执行漏洞分析问题

请问如何使用manticore分析合约中存在的漏洞呢,如何将漏洞类型提示在shell中?
我尝试使用manticore符号执行分析漏洞合约中存在的漏洞,但是总是出问题,脚本如下,shell提示在最下面:


from manticore.ethereum import ManticoreEVM

# 定义智能合约源码
contract_source_code = """
pragma solidity >=0.4.22 <0.7.0;

/**
 * @title Vulnerable to Re-Entrancy
 */
contract Vulnerable {
    mapping(address => uint) public balances;

    function deposit() public payable {
        balances[msg.sender] += msg.value;
    }

    function withdraw() public {
        uint transferAmount = balances[msg.sender];
        require(transferAmount > 0);
        
        (bool success, ) = msg.sender.call.value(transferAmount)("");
        require(success);
        balances[msg.sender] = 0;
    }
}
"""

# 初始化 Manticore
m = ManticoreEVM()

# 创建一个以太坊账户
user_account = m.create_account(balance=1000000000)

# 从源码创建智能合约实例
contract = m.solidity_create_contract(contract_source_code, owner=user_account)

# 与合约交互
contract.deposit(value=100)  # 用户存入 100 wei
contract.withdraw()  # 尝试提现

# 开始分析
m.finalize()

shell提示以下问题,但是不报合约中存在的漏洞:

lrj@ubuntu:/mnt/hgfs/ubuntu_delegatecall/atestall$ python3 t3.py
2024-02-16 04:19:00,484: [26161] m.c.plugin:WARNING: Caught will_solve in state None, but failed to capture its initialization

另:
如果我使用manticore分析完成后,输出了一个mcroe_开头的文件夹,请问漏洞是不会自动报到shell中吗,漏洞只能通过文件夹内的内容分析么。如果只能通过文件夹中的内容分析的话,请问如何分析呢?

  • 写回答

16条回答 默认 最新

  • threenewbee 2024-02-16 23:52
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(15条)

报告相同问题?

问题事件

  • 系统已结题 3月2日
  • 已采纳回答 2月23日
  • 创建了问题 2月16日

悬赏问题

  • ¥66 关于川崎机器人调速问题
  • ¥15 winFrom界面无法打开
  • ¥15 crossover21 ARM64版本安装软件问题
  • ¥15 mymetaobjecthandler没有进入
  • ¥15 mmo能不能做客户端怪物
  • ¥15 osm下载到arcgis出错
  • ¥15 Dell g15 每次打开eiq portal后3分钟内自动退出
  • ¥200 使用python编写程序,采用socket方式获取网页实时刷新的数据,能定时print()出来就行。
  • ¥15 matlab如何根据图片中的公式绘制e和v的曲线图
  • ¥15 我想用Python(Django)+Vue搭建一个用户登录界面,但是在运行npm run serve时报错了如何解决?