cgi-bin问题

发布于 2024-09-16 10:54:27 字数 521 浏览 0 评论 0原文

我可以访问共享网络主机。 那里安装的网站使用exec()。大约 4 个月前,该功能被启用,但现在他们已将其放入 disable_functions 列表中。他们将 execpassthrushell_exec 放在该列表中,但他们忘记将 system :) 这让我思考服务器管理员不太清楚他在做什么。不管怎样,他们现在说这些功能不应该被启用,而且他们不会重新启用它们。

安装的网站使用 exec() 启动一些 php 脚本来执行一些后台工作。现在我正在寻找是否有任何其他“合法”方式在后台启动这些 php 脚本(我希望 system() 能够工作,但也许他们将来也会禁用它)。 现在我的简单问题是: 在预定义的文件结构中,我看到一个 cgi-bin 文件夹。它有什么用?从我在网上读到的内容来看,它用于在通过浏览器访问时生成“动态”页面,但服务器无论如何都安装了 php,所以我看不到它的用途。

I have access to a shared web host.
The website installed there uses exec(). About 4 months ago the function was enabled, but now they have put it on the disable_functions list. They put exec, passthru and shell_exec on that list but they forgot to put system:) This makes me think that the server admin is not very aware on what he's doing. Anyway, they now say that those functions should have never be enabled and they wont re-enable them.

The installed website uses exec() to start some php scripts that would do some background work. Right now i'm looking to see if there is any other "legal" way to start those php scripts in background(i expect system() to work, but maybe they will disable it in the future also).
And now my simple question:
In the perdefined file structure i see a cgi-bin folder. Whats its use? From what i read on the web it is used to generate "dynamic" pages when accessed through the browser, but the server has php anyway installed, so i dont see its use.

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

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

发布评论

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

评论(1

南冥有猫 2024-09-23 10:54:27

/cgi-bin/CGI 脚本 所在的目录已放置。
您可以使用 CGI 来解决 PHP 中 exec 的限制。

创建一个名为 somefile.sh 的文件,其内容为:

#!/bin/sh
printf "Content-Type: text/plain\n\n"
#your code here

仅当 /bin/sh 实际存在且可执行时才有效(例如,如果您不在没有 /bin/sh 的 chroot 中

)有足够的方法来执行命令。如果他们禁用 CGI,您可以继续使用 SSI

/cgi-bin/ is a directory where CGI script should be placed.
You can work around restrictions on exec in PHP by using CGI.

Create a file named somefile.sh with contents:

#!/bin/sh
printf "Content-Type: text/plain\n\n"
#your code here

This will only work if /bin/sh actually exists, and is executable (if you're not in a chroot without /bin/sh for example)

There are enough ways to get a command executed. If they disable CGI, you can continue with SSI.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文