如何找到在不同域名上运行的 php 版本?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4672088/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 13:56:07  来源:igfitidea点击:

How can I find the version of php that is running on a distinct domain name?

phpversiondomain-name

提问by LostLord

How can I find the version of php that is running on a distinct server with distinct domain name? (like www.abc.com) It is not my server, no ftp access for making a php file with this code:

如何找到在具有不同域名的不同服务器上运行的 php 版本?(如 www.abc.com)它不是我的服务器,没有使用此代码制作 php 文件的 ftp 访问权限:

<?php
    echo PHP_VERSION;
?>

采纳答案by LostLord

THE ANSWER IS : NMAP PROGRAM

答案是:NMAP 程序

THANKS FOR YOUR ATTENTIONS ...

感谢您的关注...

another way is getting HTTP Headers by this site (http://web-sniffer.net/) or firefox add-on for getting HTTP Headers...

另一种方法是通过此站点(http://web-sniffer.net/)或 firefox 插件获取 HTTP 标头以获取 HTTP 标头...

Best Regards

此致

回答by Neil Robertson

This works for me:

这对我有用:

curl -I http://websitename.com

Which shows results like this or similar including the PHP version:

它显示了这样或类似的结果,包括 PHP 版本:

HTTP/1.1 200 OK
Date: Thu, 13 Feb 2014 03:40:38 GMT
Server: Apache
X-Powered-By: PHP/5.4.19
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
Cache-Control: no-cache
Pragma: no-cache
Set-Cookie: 7b79f6f1623da03a40d003a755f75b3f=87280696a01afebb062b319cacd3a6a9; path=/
Content-Type: text/html; charset=utf-8

Note that if you receive this message:

请注意,如果您收到此消息:

HTTP/1.1 301 Moved Permanently

You may need to curl the www version of the website instead i.e.:

您可能需要卷曲网站的 www 版本,即:

curl -I http://www.websitename.com

回答by neofutur

I use redbot, a great tool to see php version, but also many other useful infos like headers, encoding, keepalive and many more, try it on

我使用 redbot,这是一个查看 php 版本的好工具,还有许多其他有用的信息,如标头、编码、keepalive 等等,试试吧

http://redbot.org

http://redbot.org

I loveit !

我喜欢它 !

I also upvote Neil answer : curl -I http://websitename.com

我也赞成 Neil 的回答:curl -I http://websitename.com

回答by Pekka

Sometimes, PHP will emit a X-Powered-By:response header which you can look at e.g. using Firebug.

有时,PHP 会发出一个X-Powered-By:响应头,您可以使用 Firebug 来查看它。

If this setting (controlled by the ini setting expose_php) is turned off (it often is), there is no way to tell the PHP version used - and rightly so. What PHP version is running is none of the outside world's business, and it's good to obscure this from a security perspective.

如果此设置(由 ini 设置控制expose_php)被关闭(通常是这样),则无法判断所使用的 PHP 版本 - 这是正确的。运行什么 PHP 版本与外界无关,从安全角度来掩盖这一点是很好的。

回答by Jules G.M.

There is a surprisingly effective way that consists of using the easter eggs.

有一种非常有效的方法,就是使用复活节彩蛋

They differ from version to version.

它们因版本而异。

回答by rik

By chance: Default error pages often contain detailed information, e.g.

偶然:默认错误页面通常包含详细信息,例如

Apache/{Version} ({OS}) {Modules} PHP/{Version} {Modules} Server at {Domain}

Apache/{Version} ({OS}) {Modules} PHP/{Version} {Modules} 服务器在 {Domain}

Not so easy: Find out which versions of PHP applications run on the server and which version of PHP they require.

不是那么容易:找出在服务器上运行的 PHP 应用程序的版本以及它们需要的 PHP 版本。

Another approach, only mentioned for the sake of completeness; please forget after reading: You could (but you won't!) detect the PHP version by trying known exploits.

另一种方法,仅出于完整性考虑;请在阅读后忘记:您可以(但您不会!)通过尝试已知漏洞来检测 PHP 版本。

回答by Nyagolova

I suggest you much easier and platform independent solution to the problem - wappalyzer for Google Chrome:

我建议您更轻松且独立于平台的问题解决方案 - 适用于 Google Chrome 的 wappalyzer:

See here

看这里

回答by Kalyan Chakravarthi V

There is a possibility to find the PHP version of other domain by checking "X-Powered-By" response header in the browser through developer tools as other already mentioned it. If it is not exposed through the php.ini configuration there is no way you can get it unless you have access to the server.

有可能通过其他人已经提到的开发人员工具检查浏览器中的“X-Powered-By”响应标头来找到其他域的 PHP 版本。如果它没有通过 php.ini 配置公开,除非您有权访问服务器,否则您无法获得它。

回答by Brad Christie

Possibly use something like firefox's tamperdata and look at the header returned (if they have publishing enabled).

可能使用类似 Firefox 的 tamperdata 并查看返回的标头(如果它们已启用发布)。

回答by Gumbo

You can't. One reason is that not every web site uses PHP. And another reason is: Even if there are some signs that PHP might be used (e.g. .phpfile name extension, some “PHPSESSID” parameter, X-Powered-Byheader field containing “PHP”, etc.) those information might be spoofed to let you think PHP is used.

你不能。原因之一是并非每个网站都使用 PHP。另一个原因是:即使有一些迹象表明可能使用 PHP(例如.php文件扩展名、某些“PHPSESSID”参数、包含“PHP”的X-Powered-By头字段等),这些信息也可能被欺骗以让你认为PHP被使用。