英文:
Executing an exe file using php on server error
问题
我正在尝试在服务器上运行一个exe文件,以便为用户显示它。我已经在我的服务器上上传了一个exe文件。我创建了一个index.php文件,并提供了以下代码:
<?php
// index.php
echo $_GET['cmd'];
?>
现在我通过我的URL来调用它,例如:
demo.com/index.php?=C:\path\AUTORUN.exe
但是这给我一个空白页面。有人可以告诉我为什么我的exe文件没有运行吗?
英文:
I am trying to run an exe file on server to display it for user. I have an exe file uploaded on my server. I have created an index.php file and gave the following code:
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
<?php
// index.php
echo $_GET['cmd'];?>
<!-- end snippet -->
Now I am calling it through my url like
> demo.com/index.php?=C:\path\AUTORUN.exe
Which gives me blank page. Can anyone please tell me why my exe is not running?
答案1
得分: 0
为了能够访问 $_GET['cmd']
,您需要传递与该名称相对应的请求参数。在您的情况下,类似这样:demo.com/index.php?cmd=C:\path\AUTORUN.exe
。此外,从请求参数中运行应用程序在安全性方面非常不推荐。
英文:
To be able to access $_GET['cmd']
you need to pass in request parameter with that name. In your case something like: demo.com/index.php?cmd=C:\path\AUTORUN.exe
Also: running application from request parameters is really bad from security point of view.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论