Linux 是否可以使用 wget 从网页下载 PHP 脚本?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7938624/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is it possible to download PHP script from a web page with wget?
提问by user219882
If I try wget <url>
it downloads the resolved page. But I want to download the original script. Is this possible?
如果我尝试wget <url>
下载已解决的页面。但我想下载原始脚本。这可能吗?
采纳答案by Pointy
No, and thank goodness for that. The server is completely in control of how it responds to your HTTP requests.
不,谢天谢地。服务器完全控制它如何响应您的 HTTP 请求。
Strictly speaking, you can't tell whether it's PHP on the other end of the wire in the first place.
严格来说,您一开始无法判断它是否是电线另一端的 PHP。
回答by Daveo
No this is not possible, and would be a huge security issue if it was.
不,这是不可能的,如果是,这将是一个巨大的安全问题。
The only way this would be possible is if the web server (Apache) was not configured correctly
如果 Web 服务器 (Apache) 配置不正确,唯一可能的方法是
回答by Jfdev
This is not possible, the webserver doesn't output the PHP script. The webserver parses it serverside and writes the response of that to the client.
这是不可能的,网络服务器不输出 PHP 脚本。网络服务器在服务器端解析它并将其响应写入客户端。
回答by artemonster
"Officially" - no.
Through "hacking" - yes. If a website allows to download some content via "/download.php?src=path_to_file" script, AND it was unproperly coded, then you could request to download, say, index.php file.
“正式” - 没有。
通过“黑客” - 是的。如果网站允许通过“/download.php?src=path_to_file”脚本下载某些内容,并且编码不正确,那么您可以请求下载 index.php 文件。
Check this out: https://www.owasp.org/index.php/Path_Traversal