[网鼎杯 2020 青龙组]singal 1

前言

在主函数中找到了一个vm的译码器,译码器主要是解释传入的opcode,然后对我们输入的字符操作,这里我们发现他是单字节比较的,方法很多可以使用单字节映射,也可以是使用符号化执行,当然也可以硬着头皮去看

Angr

python 复制代码
import angr
import sys

def main(argv):
  path_to_binary = f'./signal.exe'
  project = angr.Project(path_to_binary)
  initial_state = project.factory.entry_state(
    add_options = { angr.options.SYMBOL_FILL_UNCONSTRAINED_MEMORY,
                    angr.options.SYMBOL_FILL_UNCONSTRAINED_REGISTERS}
  )
  simulation = project.factory.simgr(initial_state)

  def is_successful(state):
    stdout_output = state.posix.dumps(sys.stdout.fileno())
    return b'good,The answer format is:flag {}' in stdout_output # :boolean

  def should_abort(state):
    stdout_output = state.posix.dumps(sys.stdout.fileno())
    return b'what a shame...' in stdout_output
  simulation.explore(find=is_successful, avoid=should_abort)

  if simulation.found:
    solution_state = simulation.found[0]
    print(solution_state.posix.dumps(sys.stdin.fileno()).decode())
  else:
    raise Exception('Could not find the solution')

if __name__ == '__main__':
  main(sys.argv)

找到程序通过输出的话,和不通过输出的话,然后我们通过符号化执行,判断出输入的值

Ponce

使用ponce的话就麻烦很多,首先启动调试

将输入设置为符号化

到达判断点

这样就分析出了第一位,我们可以修改EIP一步步来,这样就可以得到所有的输入

相关推荐
南风84111 小时前
C++ 四种强制类型转换详解
c++
微笑星河q2 小时前
C++STL【vector】常用接口函数使用和迭代器失效问题
开发语言·c++
菩提小狗3 小时前
每日安全情报报告 · 2026-11-15
网络安全·漏洞·cve·安全情报·每日安全
HaiXCoder4 小时前
C++ 表达式怎么读:从一行代码到类型、值类别和生命周期
c++
武子康5 小时前
H3-World 扩展跳跃与开门:新动作怎样进入训练数据?
大数据·人工智能·算法
卡尔曼的BD SLAMer5 小时前
北斗导航 |GNSS ION论文集汇总1997到2022(链接在文末)
算法·北斗导航
时间的拾荒人5 小时前
Redis Cluster 集群详解:分片算法、搭建、故障处理与扩容实战
数据库·redis·算法·集群
老师我太想进步了20267 小时前
【数据结构-8】栈的实现
c语言·数据结构·算法
kyle~8 小时前
因子图优化(Factor Graph Optimization)
c++·算法·机器人·传感器
geats人山人海8 小时前
现代c++4.1
java·开发语言·c++