黑客攻击网络服务器

发布于 2024-12-27 18:17:49 字数 415 浏览 1 评论 0原文

您好,我的任务是尝试破坏我公司使用的专有网络服务器程序,但我的运气不太好。它是用c构建的。

它以 root 身份运行,我试图让它执行命令。 Web 服务器接受 URL 中发布的命令并使用前缀执行这些命令。现在我可以传递任何命令,例如“&_cmd=gettimeout”或“&_cmd=rm”。该程序实际上将运行“prefix rm”。

前缀程序将尝试在一组目录中运行该命令,其中没有有用的unix命令,因此只会报告未找到命令。也不可能在 URL 中传递空格,例如“&_cmd=rm%20-f”,因为 php 脚本会将空格转换为 +。是否有格式化 &_cmd 字符串来运行真正的 unix 命令?

这是一项有点奇怪的任务,但我是一名正在学习安全课程的实习学生,我的工作是试图为我找到一些与我的课程相关的工作。

感谢您的帮助

Hi I have been tasked with trying to break a proprietary web server program which my company uses, I'm not really having much luck. It is built in c.

It runs as root and I am trying to get it to execute commands. The webserver takes commands posted in the URL and executes these commands with a prefix. Now I can pass any command such as '&_cmd=gettimeout' or '&_cmd=rm'. The program will actually run "prefix rm"

The prefix program will try to run that command in a set of directories, of which no useful unix commands are, therefore will just report back command not found. It is also not possible to pass spaces in the URL such as '&_cmd=rm%20-f' as the php script converts spaces to +. Is there anyway of formatting the &_cmd string to run real unix commands?

Bit of a strange task but I am a placement student doing a security course and my work are attempting to find some work for me regarding my course.

Thanks for your help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜司空 2025-01-03 18:17:49

有些想法可能有效,也可能无效:

  1. 反引号。幸运的是,它们将在 prefix 运行之前进行评估。运气不好的话,他们可能仍然会以某种方式为你服务。
  2. 如果空格不起作用,为什么不尝试其他类型的空格呢?有选项卡等等。
  3. 您需要找到确切可以使用哪些命令,并确定它们是否有帮助。
  4. 您可能会在允许的命令之一中发现缓冲区溢出。通常,这种超限不会带来安全风险(如果你接管了vi,你无论如何也不能做任何你不能做的事情)。但在这种情况下,您也许可以利用它们。
  5. 如果您能到达,您可能会在 /proc/ 中找到可执行文件 - 它包含指向每个进程命令的链接。

Some ideas, might work, might not:

  1. Backquotes. With luck, they'll be evaluated before prefix runs. Without luck, they might still serve you somehow.
  2. If spaces don't work, why won't you try other kinds of whitespace? There's the tab, and more.
  3. You need to find which commands exactly can be used, and figure out if they help.
  4. You might find a buffer overrun in one of the allowed commands. Normally, such overruns are not a security risk (if you take over vi, you can't do anything you couldn't do anyway). But in this context, you may be able to exploit them.
  5. You may find executables in /proc/, if you can get there - it contains a link to each processes's command.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文