PT1 certified | OSCP in progress

Algernon – OffSec Practice Writeup

Algernon OffSec Proving Grounds Practice writeup cover

This Algernon OffSec Practice writeup walks through anonymous FTP enumeration, an outdated SmarterMail mail server, and a CVE-2019-7214 .NET Remoting deserialization that drops a SYSTEM shell.

Summary

Algernon is an easy Windows host whose entire compromise hinges on a single over-exposed service. Enumeration reveals anonymous FTP, a default IIS site, and — most importantly — a SmarterMail installation whose web interface listens on port 9998. Alongside the web front-end, SmarterMail also exposes a .NET Remoting service on TCP 17001. That remoting endpoint deserializes untrusted data (CVE-2019-7214), and because the mail service runs as NT AUTHORITY\SYSTEM, a single deserialization gadget yields a SYSTEM reverse shell outright. There is no separate privilege-escalation phase: the foothold is the full compromise.

Reconnaissance

Full TCP port sweep with service and script scanning:

rustscan -a 192.168.188.65 -- -A -oN target
PORTSERVICEINFO
21/tcpMicrosoft ftpdAnonymous FTP allowed; dirs ImapRetrieval, Logs, PopRetrieval, Spool
80/tcpMicrosoft IIS httpd 10.0Default "IIS Windows" page; TRACE method enabled
135/tcpMicrosoft Windows RPC–
139/tcpNetBIOS-ssn–
445/tcpMicrosoft-DS (SMB)No null-session enumeration
5040/tcpunknown–
7680/tcppando-pub?Windows Delivery Optimization
9998/tcpMicrosoft HTTPAPI 2.0 / IIS 10.0SmarterMail web login; redirects to /interface/root
17001/tcpMS .NET Remoting servicesDeserialization RCE vector (CVE-2019-7214)
49664-49669/tcpMicrosoft Windows RPCRPC dynamic range

The host is fingerprinted as modern Windows (Windows 10 / Server 2019 family).

FTP — anonymous login is permitted, so mirror the share recursively to inspect its contents offline:

wget -m ftp://anonymous:anonymous@192.168.188.65/

The retrieved directories (ImapRetrieval, PopRetrieval, Spool, Logs) belong to SmarterMail’s mail-retrieval and spool subsystem and contain no useful loot — this is a confirmation of the running software rather than a credential source.

SMB — null sessions are rejected, so no anonymous share or user enumeration is possible.

Web — port 80 serves only the default IIS splash page. The interesting surface is port 9998, which presents the SmarterMail login portal. SmarterMail is a Windows mail server (SMTP/IMAP/POP3) with a web administration interface; the parallel 17001/tcp .NET Remoting listener is the tell-tale sign of a version vulnerable to CVE-2019-7214.

Initial access

SmarterMail builds prior to 6985 expose a .NET Remoting service on TCP 17001 that deserializes attacker-controlled objects without validation — CVE-2019-7214. A ysoserial.net gadget chain sent to that port is deserialized and executed by the mail service, and since the service runs as NT AUTHORITY\SYSTEM, the resulting command execution is already fully privileged.

The public proof-of-concept EDB-49216 automates this: it embeds a ysoserial.net payload, connects to port 17001, and triggers execution. Edit the script’s configuration block to point the payload at our attacker IP and a chosen port, start a listener, and run it.

Start the listener:

nc -lvnp 443

Launch the exploit (after setting LHOST/LPORT inside the script):

python3 49216.py

The deserialization fires and a reverse shell connects back:

whoami
nt authority\system

We land directly as NT AUTHORITY\SYSTEM and can read the user flag.

Privilege escalation

Not required. The SmarterMail remoting service executes as NT AUTHORITY\SYSTEM, so the CVE-2019-7214 deserialization already yields the highest local privilege. The same shell that provides the foothold also reads the administrator flag — there is no second escalation step to perform.

Conclusion

Algernon is a textbook example of a single-exposure total compromise. The root cause is twofold: an outdated SmarterMail build carrying a known, trivially exploitable deserialization flaw, and an unnecessarily exposed management channel — the .NET Remoting service on port 17001 had no business being reachable from an untrusted network. Because the mail service ran with SYSTEM privileges, the blast radius of the deserialization bug was maximal: no credential harvesting, no lateral movement, and no privilege escalation were needed.

Key defensive takeaways:

  • Patch SmarterMail to build 6985 or later, where the remoting service enforces deserialization restrictions.
  • Firewall the management plane. The .NET Remoting port (17001) should never be exposed beyond localhost or a trusted administrative segment.
  • Run services with least privilege. A mail daemon does not need SYSTEM; a constrained service account would have contained the compromise.
  • Disable anonymous FTP unless there is an explicit business need; even when it leaks nothing, it advertises the stack and widens the attack surface.
Index