Sami HTTP — 1 vulnerability check
noctis ships 1 vulnerability check for Sami HTTP, covering 1 CVE; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
Sami HTTP Server <= 1.0.4 Long GET Request Buffer Overflow
| CVE | CVE-2004-0292 |
|---|---|
| Severity | critical · CVSS 10.0 |
| Category | rce — Remote code execution |
| Services | http, https |
| Detection | tcp_connect, script, match · highest QoD 70 |
| Feed | tests/vulnerabilities/sami-http/CVE-2004-0292.yaml |
KarjaSoft Sami HTTP Server (a small Windows web server) up to 1.0.4 overflows a buffer when it parses an overly long HTTP GET request, which crashes the server and possibly lets a remote unauthenticated attacker run code (BID 9679, EDB-23714).
The test sends one plain `GET / HTTP/1.0` request (over TLS on HTTPS services), reads the `Server:` response header and reports the host when it advertises Sami HTTP Server 1.0.4 or older (any 0.x, 1.0 and 1.0.0 to 1.0.4). Later versions (1.0.5 and up, including 1.0.10 and 2.x) and other servers are not reported.
This is a version check, on purpose: the only way to trigger the bug is the overflow itself, which would crash the server, so no exploit is ever sent. The test is passive and not tagged `intrusive`; `category: rce` classifies the bug so operators filtering code-execution issues see it.
How noctis detects it
- Raw TCP (TLS on HTTPS), sent verbatim:
GET / HTTP/1.0 - Parses / computes the next value with a Rhai script
- Checks
ver.versionfor^[0-9]→ finding QoD 70: Server header '…': Sami HTTP Server … is 1.0.4 or older (buffer overflow on a long GET request; not triggered, it would crash the server).
References:
- https://nvd.nist.gov/vuln/detail/CVE-2004-0292
- https://www.exploit-db.com/exploits/23714
- http://www.securityfocus.com/bid/9679
Feed source — tests/vulnerabilities/sami-http/CVE-2004-0292.yaml
# Ported from OpenVAS/Greenbone NASL pre2008/samihttp_1_0_4.nasl
# (OID 1.3.6.1.4.1.25623.1.0.12073, GPL-2.0-only), which reports
# `Server:.*Sami HTTP Server v(0\.|1\.0\.[0-4][^0-9])` in the response headers.
#
# Better than the NASL: the version is compared numerically, so a bare `v1.0` and
# a Server: value ending right after the version (no trailing byte for the NASL's
# `[^0-9]`) are covered too; only the header block is searched; raw tcp_connect
# so a non-conformant reply is not dropped by an HTTP client, HTTPS covered.
uid: 13154384-0591-4cbd-9376-8559f0cbfe37
name: "Sami HTTP Server <= 1.0.4 Long GET Request Buffer Overflow (CVE-2004-0292)"
description: |
KarjaSoft Sami HTTP Server (a small Windows web server) up to 1.0.4 overflows a
buffer when it parses an overly long HTTP GET request, which crashes the server
and possibly lets a remote unauthenticated attacker run code (BID 9679, EDB-23714).
The test sends one plain `GET / HTTP/1.0` request (over TLS on HTTPS services),
reads the `Server:` response header and reports the host when it advertises
Sami HTTP Server 1.0.4 or older (any 0.x, 1.0 and 1.0.0 to 1.0.4). Later
versions (1.0.5 and up, including 1.0.10 and 2.x) and other servers are not
reported.
This is a version check, on purpose: the only way to trigger the bug is the
overflow itself, which would crash the server, so no exploit is ever sent. The
test is passive and not tagged `intrusive`; `category: rce` classifies the bug
so operators filtering code-execution issues see it.
cves: [CVE-2004-0292]
cvss: 10.0
severity: critical
confidence_base: 0.30
category: rce
tags: [sami-http, karjasoft, buffer-overflow, windows, version-check, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2004-0292"
- "https://www.exploit-db.com/exploits/23714"
- "http://www.securityfocus.com/bid/9679"
steps:
# 1 — one plain request; only its response headers are used.
- id: probe
action: tcp_connect
port: "{{port}}"
send: "GET / HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
timeout_secs: 10
store_as: resp
# 2 — check every Server: header of the header block and compare the version
# with the last vulnerable release 1.0.4, part by part.
- id: version
action: script
store_as: ver
code: |
let out = #{ vulnerable: false, version: "", server: "" };
if type_of(resp.banner) == "string" {
let head = resp.banner;
let cut = stridx(head, "\r\n\r\n");
if cut < 0 { cut = stridx(head, "\n\n"); }
if cut >= 0 { head = substr(head, 0, cut); }
for raw in split(head, "\n") {
if out.vulnerable { break; }
let line = eregmatch("^server:[ \\t]*([^\\r]*)", raw, true);
if line.len() < 2 { continue; }
let m = eregmatch("Sami HTTP Server[ \\t]*v?([0-9]{1,6}(\\.[0-9]{1,6})*)", line[1], true);
if m.len() < 2 { continue; }
let parts = split(m[1], ".");
let last = [1, 0, 4];
let vuln = true;
for i in 0..3 {
let n = if i < parts.len() { int(parts[i]) } else { 0 };
if n < last[i] { break; }
if n > last[i] { vuln = false; break; }
}
if vuln {
out.vulnerable = true;
out.version = m[1];
out.server = line[1];
}
}
}
out
- id: vulnerable_version
action: match
condition: "ver.vulnerable == true"
source: ver.version
pattern: "^[0-9]"
on_match:
stop: true
finding:
confidence_delta: 0.45
qod: 70
evidence: "Server header '{{ver.server}}': Sami HTTP Server {{ver.version}} is 1.0.4 or older (buffer overflow on a long GET request; not triggered, it would crash the server)."