How do I find the version of Apache running without access to the command line?

前端 未结 11 2179
失恋的感觉
失恋的感觉 2020-12-04 12:37

I need to either find a file in which the version is encoded or a way of polling it across the web so it reveals its version. The server is running at a host who will not pr

相关标签:
11条回答
  • 2020-12-04 13:33

    Rarely, a hardened HTTP server is configured to give no server information or misleading server information. In those scenarios if the server has PHP enabled you can add:

    <?php phpinfo(); ?>
    

    in a file and browse to it and look for the

    _SERVER["SERVER_SOFTWARE"]
    

    entry. This is susceptible to the same hardening lack of information/misleading though I would imagine that it's not altered often, because this method first requires access to the machine to create the PHP file.

    0 讨论(0)
  • 2020-12-04 13:36

    Simply use something like the following - the string should be there already:

    <?php
       if(isset($_SERVER['SERVER_SOFTWARE'])){
          echo $_SERVER['SERVER_SOFTWARE'];
       }
    ?>
    
    0 讨论(0)
  • 2020-12-04 13:38

    Warning, some Apache servers do not always send their version number when using HEAD, like in this case:

    HTTP/1.1 200 OK
    Date: Fri, 03 Oct 2008 13:09:45 GMT
    Server: Apache
    X-Powered-By: PHP/5.2.6RC4-pl0-gentoo
    Set-Cookie: PHPSESSID=a97a60f86539b5502ad1109f6759585c; path=/
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Pragma: no-cache
    Connection: close
    Content-Type: text/html
    
    
    
    Connection to host lost.
    

    If PHP is installed then indeed, just use the php info command:

    <?php phpinfo(); ?>
    
    0 讨论(0)
  • 2020-12-04 13:39

    Your best option is through PHP: All version requests from the client side cannot be trusted since your Apache could be configured with ServerTokens Prod and ServerSignature Off. See: http://www.petefreitag.com/item/419.cfm

    0 讨论(0)
  • 2020-12-04 13:42

    Telnet to the host at port 80.

    Type:

    get / http1.1
    ::enter::
    ::enter::
    

    It is kind of an HTTP request, but it's not valid so the 500 error it gives you will probably give you the information you want. The blank lines at the end are important otherwise it will just seem to hang.

    0 讨论(0)
提交回复
热议问题