Skip to content

Conversation

@n-WN
Copy link
Contributor

@n-WN n-WN commented Sep 4, 2025

No description provided.

@github-actions
Copy link

github-actions bot commented Sep 4, 2025

📝 Docs preview for commit 19187b8 at: https://68b924910981afa53f6f65ee--modest-austin-48be4a.netlify.app

@github-actions
Copy link

github-actions bot commented Sep 4, 2025

📝 Docs preview for commit 19187b8 at: https://68b9249f412e2ac71deb8844--modest-austin-48be4a.netlify.app

@n-WN
Copy link
Contributor Author

n-WN commented Sep 4, 2025

这样讲可能更清晰,于是我更新了本页面,添加内存布局来辅助学习

�假设gets读入的数据存入str,这个str的起始地址以esp做偏移来快速确定

那么,既然要计算填充,也就是

[Saved EBP] (4 字节) <--- 需要被覆盖
... <-- (从缓冲区到Saved EBP的填充区域)
[esp + 0x1c] <-- s, 缓冲区起始地址

这部分内容只需要用当前程序没被填充的ebp地址减去esp+0x1c,就能得到中间的地址,最后加上ebp自身的宽度,下一个单位就是返回地址

@arttnba3
Copy link
Member

arttnba3 commented Sep 7, 2025

Hi n-WN,

Thanks for your contribution! Currently we are busily examining your pull request. Once this have been checked and approved, we will notify you at our earliest convenience.

This is just a notification message and you don't need to reply to it. If you have any further concerns, please feel free to contact us.

Best regards,
arttnba3 @ CTF-Wiki Team
2025/09/07

@arttnba3 arttnba3 self-assigned this Sep 7, 2025
@arttnba3 arttnba3 self-requested a review September 7, 2025 03:39
在 secure 函数又发现了存在调用 `system("/bin/sh")` 的代码,那么如果我们直接控制程序返回至 `0x0804863A` ,那么就可以得到系统的 shell 了。

下面就是我们如何构造 payload 了,首先需要确定的是我们能够控制的内存的起始地址距离 main 函数的返回地址的字节数。
下面就是我们如何构造 payload 了,首先需要确定的是我们能够控制的内存的起始地址距离 main 函数的返回地址的字节数,有时也被称为计算偏移
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个“计算偏移”的说法有具体出处吗?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

民间说法?我去改改说辞

高地址
...
[返回地址] (EBP + 4 字节) <--- 我们的最终目标
[Saved EBP] (4 字节) <--- 需要被覆盖
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Saved EBP] 的说明最好与其他几个说明为同一类型,即介绍其是什么, “需要被覆盖” 的说法过于含糊且不太贴切(为什么“需要”?),个人建议这里可以改为先介绍 saved ebp 这个值是什么含义,并补充 “将要被覆盖”

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants