ISCTF2025
ez2048该题需要我们获得100000分才能打rop。但是经过分析可以发现,如果选择q可以-10分,由于最后的判断是无符号的,因此如果我们是一个负数的话,判断的时候就会变为一个很大的正数从而绕过判断打rop。exp如下: #导入所需库#--------------------------------------------------------------------------------from pwn import*from LibcSearcher import*from ctypes import*from struct import*import time#设置context#--------------------------------------------------------------------------------context(arch='amd64', os='linux',...
PCTF_2025
test_your_nc考查的是python脚本的编写,计算2025道计算题就给flag。exp如下: from pwn import *import recontext.log_level = "info"context.timeout = 5io = remote("challenge.imxbt.cn", 30734)digits = "0123456789abcdefghijklmnopqrstuvwxyz"def int_to_base(n, base): if n == 0: return "0" sign = "" if n < 0: sign = "-" n = -n res = "" while n: res = digits[n % base] + res n //= base return sign +...
heap_study
主要介绍一些堆的基础知识,并且会持续更新。(attack方法在后续的文章中会陆续介绍) 概述概述方面可以在ctfwiki上面自行查看,在这就不过多赘述了。 glibc中的堆因为在pwn题中,比较常见的就是glibc中的堆,由此就先介绍这个。在glibc中,堆管理器为ptmalloc2,用malloc与free分配与释放堆块。在堆的内部结构方面,主要介绍chunk和bin。 chunkchunk就是我们通过malloc申请的内存堆块,由于chunk可能会有不同状态,可以把chunk分为allocated chunk、free chunk和top chunk。但是不管是什么状态下的chunk,其都使用的同一个结构(但表现形式会有所不同): 代码为: /* This struct declaration is misleading (but accurate and necessary). It declares a "view" into memory allowing access to necessary fields at known...
PolarCTF2025冬季赛
choice分析一道64位开了canary保护的题目,存在一个格式化字符串漏洞函数与栈溢出函数,还有一个后门函数,因此是一个简单的题目。 题解 存在格式化字符串漏洞,可以用来泄漏canary的值,使用gdb调试加上fmtarg算出偏移是多少 该题还存在存在栈溢出和后门函数,因此直接打即可 expfrom pwn import*from LibcSearcher import*from ctypes import*from struct import*import timecontext(arch='amd64', os='linux', log_level='debug', terminal=['tmux', 'splitw', '-h'])pwn_file='./choice'#libc_file='./libc.so.6'elf=ELF(pwn_file)#libc=ELF(libc_file)flag=0if...
ctfshow_pwn_萌新赛_签退
看学弟在群里提到刷题过程中遇到了一道setbuf缓冲区,且是一道签退题,就想到了该题,于是就打算写一下。 分析 一道32位题目,开启了NX保护与Partial...
pwn_小记
本文章会持续更新,用于记录pwn过程中,本人觉得值得记录的东西0v0 pwn的exp简化模板该部分记录使用lambda表达式与自定义函数简化exp,便于未来exp的编写。 #导入所需库#--------------------------------------------------------------------------------from pwn import*from LibcSearcher import*from ctypes import*from struct import*import time#设置context#--------------------------------------------------------------------------------context(arch='', os='linux', log_level='debug', terminal=['tmux', 'splitw',...
