GestioIP — 1 vulnerability check

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

← All products · Feeds on GitHub

GestioIP <= 3.0 ip_checkhost.cgi command injection

CVECVE-2013-10039
Severityhigh
Categoryrce — Remote code execution
Serviceshttp, https
Detectionset_var, http_request, script, match · highest QoD 70
Feedtests/vulnerabilities/gestioip/CVE-2013-10039.yaml

Detects GestioIP IP address management installs of version 3.0 or earlier, whose ip_checkhost.cgi script passes the 'ip' parameter to a shell command. The feed requests /gestioip/ without credentials and expects a 401 answer with the "GestioIP" Basic authentication realm. It then repeats the request with the default gipadmin account (empty password) and reads the GestioIP version printed by the page. A version of 3.0 or earlier is reported. The injection itself is not sent, so the finding is a version fingerprint; installs that changed the default password are not reported.

How noctis detects it

  1. HTTP(S) request GET /gestioip/
  2. Parses / computes the next value with a Rhai script
  3. HTTP(S) request GET /gestioip/
  4. Checks authd.body for GestioIP\s+v?(?:[0-2]\.[0-9]+(?:\.[0-9]+)?|3\.0(?:\.0)?)(?:[^0-9.]|\.… → finding QoD 70: GestioIP 3.0 or earlier (ip_checkhost.cgi command injection, CVE-2013-10039)

References:

Feed source — tests/vulnerabilities/gestioip/CVE-2013-10039.yaml
# GestioIP <= 3.0 ip_checkhost.cgi command injection — CVE-2013-10039
#
# ip_checkhost.cgi passes the 'ip' parameter to a shell, so a $(...) sequence
# runs commands as the web server user (ported from the OpenVAS
# gb_gestioip_ip_cmd_inj_vuln check). The CGI sits behind HTTP Basic auth and a
# default install ships gipadmin with an empty password.
#
# This feed deliberately does NOT send the injection (it would have to write a
# file on the target): it fingerprints the product and its version instead.
#   1. GET /gestioip/ without credentials: 401 + realm "GestioIP".
#   2. GET /gestioip/ with the default gipadmin account (read-only request) and
#      read the version printed by the page.
# Version/fingerprint only: QoD 70.
uid: fb90a114-d659-4dc0-af18-95489607bda1
name: "GestioIP <= 3.0 ip_checkhost.cgi command injection (CVE-2013-10039)"
description: |
  Detects GestioIP IP address management installs of version 3.0 or earlier, whose
  ip_checkhost.cgi script passes the 'ip' parameter to a shell command.
  The feed requests /gestioip/ without credentials and expects a 401 answer with the
  "GestioIP" Basic authentication realm. It then repeats the request with the default
  gipadmin account (empty password) and reads the GestioIP version printed by the page.
  A version of 3.0 or earlier is reported. The injection itself is not sent, so the finding
  is a version fingerprint; installs that changed the default password are not reported.
category: rce
cves: [CVE-2013-10039]
severity: high
confidence_base: 0.30
tags: [gestioip, ipam, command-injection, version]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2013-10039"
  - "http://www.gestioip.net/"

steps:
  - id: init-anon
    action: set_var
    var_name: anon
    var_value: {status: 0, headers: {}, body: ""}

  - id: init-authd
    action: set_var
    var_name: authd
    var_value: {status: 0, headers: {}, body: ""}

  - id: probe-anon
    action: http_request
    method: GET
    path: /gestioip/
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    store_as: anon

  - id: is-gestioip
    action: script
    store_as: gi
    code: |
      let h = "";
      if anon.status == 401 && type_of(anon.headers["www-authenticate"]) == "string" {
        h = anon.headers["www-authenticate"];
      }
      #{ ok: ereg("(?i)basic\\s+realm=\"GestioIP\"", h) }

  # gipadmin with an empty password: the account of a default install.
  - id: probe-default-account
    action: http_request
    method: GET
    path: /gestioip/
    port: "{{port}}"
    condition: "gi.ok == true"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    headers:
      Authorization: "Basic Z2lwYWRtaW46"
    store_as: authd

  - id: old-version
    action: match
    source: authd.body
    pattern: 'GestioIP\s+v?(?:[0-2]\.[0-9]+(?:\.[0-9]+)?|3\.0(?:\.0)?)(?:[^0-9.]|\.(?:[^0-9]|$)|$)'
    condition: "gi.ok == true && authd.status == 200"
    on_match:
      finding:
        confidence_delta: 0.40
        qod: 70
        title: "GestioIP 3.0 or earlier (ip_checkhost.cgi command injection, CVE-2013-10039)"
        evidence: "/gestioip/ answers 401 with the GestioIP realm, and with the default gipadmin account its page reports a GestioIP version up to 3.0"

View these feeds on GitHub