XAMPP — 1 vulnerability check

noctis ships 1 vulnerability check for XAMPP, covering 1 CVE; each one has to observe the bug on the live service before it reports a finding.

← All products · Feeds on GitHub

XAMPP WebDAV default credentials

CVECVE-2012-10062
Severityhigh · CVSS 7.5
Categorydefault-credentials — Default credentials
Serviceshttp, https
Detectionset_var, http_request, script, match · highest QoD 75
Feedtests/vulnerabilities/xampp/CVE-2012-10062.yaml

Detects the XAMPP WebDAV folder protected by the default account wampp / xampp. The test requests /webdav/ without credentials and expects an HTTP Digest challenge for the realm "XAMPP with WebDAV". It then answers the challenge with the default account and, as a control, with a random wrong password: the finding is reported only when the default account is accepted and the wrong password is rejected. With these credentials an attacker can upload a PHP script to the folder with PUT and run it. The test only reads the folder; nothing is uploaded.

How noctis detects it

  1. HTTP(S) request GET /webdav/
  2. Parses / computes the next value with a Rhai script
  3. HTTP(S) request GET /webdav/
  4. HTTP(S) request GET /webdav/
  5. Checks good_resp.status for ^20[07]$ → finding QoD 75: XAMPP WebDAV folder accepts the default account wampp/xampp (CVE-2012-10062)

References:

Feed source — tests/vulnerabilities/xampp/CVE-2012-10062.yaml
# XAMPP 1.7.3 WebDAV default credentials (CVE-2012-10062).
#
# XAMPP ships /webdav/ (mod_dav, HTTP Digest, realm "XAMPP with WebDAV") with the
# well-known account wampp:xampp, which allows PUT of a .php file and its
# execution through a later GET.
#
# Detection (read-only, nothing is uploaded — the source check PUTs a phpinfo
# script on the server; this one stops one step earlier):
#   (1) GET /webdav/ without credentials must answer 401 with a Digest challenge
#       for the realm "XAMPP with WebDAV";
#   (2) the Digest response is computed in a script for wampp:xampp and for a
#       random wrong password;
#   (3) the finding fires only when the default account is accepted (200/207) and
#       the wrong password is rejected (401), which proves the credentials are
#       checked and the default ones are valid on the very folder that accepts PUT.
#
# Improvements over the source NVT: no file is written on the target (so no
# leftover PHP script), and a server that accepts any credentials is not reported.
#
# Ported from OpenVAS/Greenbone NVT 2012/gb_xampp_webdav_php_upload_vuln.nasl (GPL-2.0-only).
uid: badd8821-7e9b-4063-9428-8e0254ef2c03
name: "XAMPP WebDAV default credentials (CVE-2012-10062)"
description: |
  Detects the XAMPP WebDAV folder protected by the default account wampp / xampp.
  The test requests /webdav/ without credentials and expects an HTTP Digest
  challenge for the realm "XAMPP with WebDAV". It then answers the challenge with
  the default account and, as a control, with a random wrong password: the finding
  is reported only when the default account is accepted and the wrong password is
  rejected. With these credentials an attacker can upload a PHP script to the
  folder with PUT and run it. The test only reads the folder; nothing is uploaded.
cves: [CVE-2012-10062]
cvss: 7.5  # NVD publishes no v3.x score for this CVE (only CVSS v4.0, 8.7); kept from the backlog issue
severity: high
category: default-credentials
confidence_base: 0.30
tags: [xampp, webdav, default-credentials, digest]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2012-10062"
  # OpenVAS/Greenbone NASL 2012/gb_xampp_webdav_php_upload_vuln.nasl (GPL-2.0-only)

steps:
  - id: init-auth
    action: set_var
    var_name: auth
    var_value: {ok: false, good: "", bad: ""}

  - id: challenge
    action: http_request
    method: GET
    path: "/webdav/"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    store_as: chal

  - id: build-digest
    action: script
    condition: 'chal.status == 401'
    code: |
      let h = chal.headers["www-authenticate"];
      if type_of(h) != "string" { return #{ ok: false, good: "", bad: "" }; }
      if stridx(tolower(h), "digest") < 0 || stridx(h, "XAMPP with WebDAV") < 0 {
        return #{ ok: false, good: "", bad: "" };
      }
      let n = eregmatch("nonce=\"([^\"]*)\"", h);
      if type_of(n) != "array" || n.len() < 2 { return #{ ok: false, good: "", bad: "" }; }
      let nonce = n[1];
      let uri = "/webdav/";
      let realm = "XAMPP with WebDAV";
      let qop = eregmatch("qop=\"?([a-z,]*auth[a-z,]*)", tolower(h));
      let use_qop = type_of(qop) == "array" && qop.len() > 1;
      let cnonce = rand_hex(8);
      let ha2 = md5("GET:" + uri);
      let hdrs = [];
      for pw in ["xampp", "n" + rand_hex(8)] {
        let ha1 = md5("wampp:" + realm + ":" + pw);
        let r = if use_qop { md5(ha1 + ":" + nonce + ":00000001:" + cnonce + ":auth:" + ha2) }
                else { md5(ha1 + ":" + nonce + ":" + ha2) };
        let a = "Digest username=\"wampp\", realm=\"" + realm + "\", nonce=\"" + nonce + "\", uri=\"" + uri + "\", algorithm=MD5, response=\"" + r + "\"";
        if use_qop { a += ", qop=auth, nc=00000001, cnonce=\"" + cnonce + "\""; }
        hdrs.push(a);
      }
      #{ ok: true, good: hdrs[0], bad: hdrs[1] }
    store_as: auth

  - id: login-default
    action: http_request
    method: GET
    path: "/webdav/"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    headers:
      Authorization: "{{auth.good}}"
    condition: "auth.ok == true"
    store_as: good_resp

  - id: login-control
    action: http_request
    method: GET
    path: "/webdav/"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    headers:
      Authorization: "{{auth.bad}}"
    condition: "auth.ok == true && (good_resp.status == 200 || good_resp.status == 207)"
    store_as: bad_resp

  - id: confirm
    action: match
    source: good_resp.status
    pattern: "^20[07]$"
    condition: "auth.ok == true && (good_resp.status == 200 || good_resp.status == 207) && bad_resp.status == 401"
    on_match:
      finding:
        title: "XAMPP WebDAV folder accepts the default account wampp/xampp (CVE-2012-10062)"
        description: "/webdav/ asks for HTTP Digest credentials (realm XAMPP with WebDAV) but accepts the default account wampp with the default XAMPP password, while a wrong password is refused. This folder accepts PUT, so an attacker can upload a PHP script and execute it with a later GET."
        remediation: "Change the WebDAV password (or remove the WebDAV configuration) and restrict /webdav/; upgrade XAMPP and do not expose it to untrusted networks."
        confidence_delta: 0.50
        qod: 75
        evidence: "GET /webdav/ answered {{good_resp.status}} to the Digest account wampp with the default password and 401 to a random wrong password"

View these feeds on GitHub