使用 PaX+Linux+Eclipse 进行调试,构建后执行脚本以删除 PaX 保护
我是 Linux PaX 用户,因此要调试任何二进制文件,我需要禁用保护标志(根据二进制)使用 paxctl 命令。 PaX 通过随机化为用户提供针对缓冲区溢出攻击等的保护,但它也禁止有意义的调试。 我可以手动执行此操作,但是每次重建后我都必须重复此操作。 我正在考虑这 4 个选项:
- 使用 /proc/sys/kernel/pax/softmode 暂时禁用 PaX
- 让 Eclipse 在构建后运行某种批处理文件(或修改默认 makefile)
- 从内核中删除一些 PaX 以保留地址空间(正如 Gentoo 文档 所建议的那样)
- 制作 Eclipse CDT 调试器 (gdb) 使用硬件断点 (hbreak) 而不是普通断点 (break)
2) 似乎是一种方法(不牺牲安全性或性能)。
有没有办法在(重新)构建后执行脚本/batch_files?
还有另一个问题,即使我设法运行禁用保护的脚本,我如何保证它的安全,使其不能被其他人使用? 我正在考虑让 ide 在“eclipse”用户下运行,该用户将在适当的组中执行 paxctl 或类似的东西。
预先感谢您提供任何提示。
I am Linux PaX user and therefore to debug any binary I need to disable protection flags (per binary) using paxctl command.
PaX gives user protection against buffer overflow attacks and such by randomization, but it also prohibits meaningfull debugging.
I could do this manually, however I'd have to repeat it after every rebuild.
I was thinking about these 4 options:
- Disabling PaX temporarily using /proc/sys/kernel/pax/softmode
- Having Eclipse run some kind of batch file after build (or modifying default makefile)
- Removing a bit of PaX from kernel to preserve adress space (as Gentoo docs suggests)
- Making Eclipse CDT debugger (gdb) use hardware breakpoints (hbreak) instead of normal ones (break)
2) seems a way to go here (w/o sacrificing security or performance).
Is there any way to execute scripts/batch_files after (re)build?
And there is another problem, even if I somehow manage to run script that does disable protections, how do I make it secure so it could not be used by someone else?
I was thinking about having ide run under "eclipse" user which would be in appropriate group to execute paxctl or something like that.
Thank you in advance for any tips.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否考虑过仅对您的可执行文件/库禁用 PaX?您可以通过添加
Project Properties > 来做到这一点构建>设置>构建步骤>构建后步骤
:Have you considered disabling PaX for you executable/library only ? You could do so by adding in
Project Properties > Build > Settings > Build Steps > Post-build Steps
: