[VulnWatch] AN HTTPd Sample Script File Truncation

From: Matthew Murphy (mattmurphy@kc.rr.com)
Date: 04/22/03

  • Next message: badpack3t: "[Full-Disclosure] Xeneo Web Server 2.2.9.0 Denial Of Service Vulnerability"
    From: "Matthew Murphy" <mattmurphy@kc.rr.com>
    To: "Full Disclosure" <full-disclosure@lists.netsys.com>, "SecurITeam News" <news@securiteam.com>, "VulnWatch" <vulnwatch@vulnwatch.org>, "BugTraq" <bugtraq@securityfocus.com>
    Date: Mon, 21 Apr 2003 17:24:46 -0500
    
    

    Product Description

    AN HTTPd is a relatively small, powerful web server designed for Windows
    systems. It supports ISAPI, CGI, SSI, and several other powerful
    technologies (such as isolated worker processes) usually only seen in
    production servers. More information on AN HTTPd is available at
    http://www.st.rim.or.jp/~nakata/

    Vulnerability Description

    AN HTTPd (1.42h and prior) ships with several sample scripts demonstrating
    various interpreters the server is capable of using. One of these,
    "count.pl", is deployed in the "/isapi" virtual directory. It takes the
    query string as part of a file path, which it uses as a page counter. AN
    HTTPd does not check for directory traversals, and also does not prevent
    non-numeric data from being used as counters.

    Issuing the following request:
    http://www.somesite.com/isapi/count.pl?../../../../../../../../../../../../.
    ./../../../../../../../../../ctr.dll

    Will place "ctr.dll" in the root of C: with a "1" as its contents. This
    same trick also works on writable files that already exist. An effective
    patch for this vulnerability is to issue the following request:

    http://www.somesite.com/isapi/count.pl?count.pl

    This will destroy the vulnerable component, preventing further exploitation.
    Be nice, kiddies :-D

    Some nastier stuff:

    http://www.somesite.com/isapi/count.pl?../../../../../../../../../../../../.
    ./../../../../../../../../../windows/system32/calc.exe

    You get the idea...

    Impact

    Attackers can overwrite any file that the CGI user can access (this userid
    is SYSTEM by default if running as a service, or the user running the binary
    if in GUI mode -- usually an administrator). Contents of the destroyed
    files cannot be sufficiently controlled to allow for exploitation in most
    cases, as the file is replaced with numeric data.

    Solution

    Remove this crappy sample script, and write a web counter that uses
    centralized configuration. The exploit shown above will remove this file
    from a vulnerable system.


  • Next message: badpack3t: "[Full-Disclosure] Xeneo Web Server 2.2.9.0 Denial Of Service Vulnerability"

    Relevant Pages

    • AN HTTPd Sample Script File Truncation
      ... AN HTTPd is a relatively small, powerful web server designed for Windows ... Vulnerability Description ... Attackers can overwrite any file that the CGI user can access (this userid ...
      (Bugtraq)
    • [VulnWatch] AN HTTPd Sample Script File Truncation
      ... AN HTTPd is a relatively small, powerful web server designed for Windows ... Vulnerability Description ... Attackers can overwrite any file that the CGI user can access (this userid ...
      (VulnWatch)
    • [Full-Disclosure] AN HTTPd Sample Script File Truncation
      ... AN HTTPd is a relatively small, powerful web server designed for Windows ... Vulnerability Description ... Attackers can overwrite any file that the CGI user can access (this userid ...
      (Full-Disclosure)
    • Re: httpd fingerprinting
      ... I normally use banner grabbing, nmap, and httprint for fingerprinting httpd servers. ... you need to proactively protect your applications from hackers. ... Download FREE whitepaper on how a managed service can ... Netscape Enterprise Server ...
      (Pen-Test)
    • Apache Cant See Files & Dirs Created in /home
      ... The system is a dedicated server leased from an ISP. ... Starting httpd: httpd: could not open document config file /home/extra.conf ... files created outside of /home can be seen anywhere by Apache, ...
      (linux.redhat)