Skip to main content
RelayKing includes detectors for SMTP, IMAP/IMAPS, WinRM/WinRMS, and MS-RPC. SMTP, IMAP/IMAPS, and WinRM/WinRMS are marked Work In Progress — they detect service presence and surface configuration details but relay-vulnerability assessment for these protocols is incomplete.

Protocol summary

ProtocolFlagDefault portAuth requiredStatus
SMTPsmtp25NoWIP
IMAPimap143NoWIP
IMAPSimaps993NoWIP
WinRMwinrm5985No (detection); Yes (EPA check)WIP
WinRMSwinrms5986No (detection); Yes (EPA check)WIP
RPCrpc135Yes (reliable check)Stable
Pass any combination as a comma-separated value:
python3 relayking.py -u lowpriv -p 'P@ssw0rd' -d corp.local \
  -vv --protocols smb,ldap,ldaps,mssql,rpc,smtp,imap,imaps,winrm,winrms \
  -o plaintext 10.0.0.0/24

SMTP

SMTP detection is Work In Progress. STARTTLS relay analysis is not implemented. The detector surfaces banner, AUTH methods, and NTLM presence only.
The SMTP detector connects to port 25, reads the service banner, and sends an EHLO relayking command. It checks the response for:
  • AUTH capability (any authentication method supported)
  • AUTH NTLM (NTLM authentication advertised)
  • STARTTLS capability
What is detectedHow
Service bannerRaw TCP banner on connect
NTLM auth advertisedNTLM in EHLO response AUTH line
STARTTLS availableSTARTTLS in EHLO response
Relay-vulnerability logic for SMTP (including STARTTLS upgrade behavior and EPA enforcement) is not yet implemented.

IMAP / IMAPS

IMAP and IMAPS detection is Work In Progress. Relay-vulnerability assessment is not implemented. These detectors surface capabilities only.
The IMAP detector connects to port 143 (or 993 for IMAPS), reads the banner, and issues an A001 CAPABILITY command. IMAPS wraps the socket in TLS with certificate verification disabled.
What is detectedHow
Service bannerRaw banner on connect
NTLM auth capabilityAUTH=NTLM in capability response
STARTTLS capabilitySTARTTLS in capability response
Port selection: IMAPS defaults to port 993. If the IMAP detector is called with use_ssl=True and port 143 is passed, the port is automatically corrected to 993.

WinRM / WinRMS

WinRM and WinRMS detection is Work In Progress. EPA enforcement detection for WinRMS is not reliably implemented. The current code contains a known stub that unconditionally sets epa_enforced = True and channel_binding = True for WinRMS — this does not reflect actual server configuration.
WinRM uses WS-Management over HTTP (port 5985) or HTTPS (port 5986). The detector sends a GET to http(s)://<host>:<port>/wsman and inspects the WWW-Authenticate response header on a 401 response.
What is detectedHow
Service presenceHTTP 401 at /wsman
Kerberos/Negotiate authNegotiate or Kerberos in WWW-Authenticate
NTLM authNTLM in WWW-Authenticate
EPA enforcement (WinRMS)Stub only — not reliable
When a valid authenticated check is implemented, EPA enforcement on WinRMS will follow the same CBT probe pattern used for HTTPS.

RPC (MS-RPC)

The RPC detector is the most complete of the additional protocol detectors. It tests the MS-RPC endpoint mapper (port 135) by iterating through authentication levels from lowest to highest and binding to the EPM interface (MSRPC_UUID_PORTMAP).

Authentication levels tested

Level constantLevel nameSigning required?
RPC_C_AUTHN_LEVEL_CONNECT (2)CONNECTNo
RPC_C_AUTHN_LEVEL_CALL (3)CALLNo
RPC_C_AUTHN_LEVEL_PKT_INTEGRITY (5)PKT_INTEGRITYYes
RPC_C_AUTHN_LEVEL_PKT_PRIVACY (6)PKT_PRIVACYYes (+ encryption)
The detector stops at the first level that is accepted. The lowest accepted level is stored in additional_info['min_auth_level'] and determines signing_required:
Lowest accepted level is CONNECT or CALL  →  signing_required = False  →  RELAYABLE
Lowest accepted level is PKT_INTEGRITY or PKT_PRIVACY  →  signing_required = True  →  NOT relayable

Relay condition

signing_required == False  →  RELAYABLE

Kerberos behaviour

If Kerberos authentication is in use and a KDC/KRB-related error occurs at any test level, the detector stops immediately and does not continue to the next auth level. This prevents account lockouts from repeated authentication failures.

Flags and port

ParameterValue
--protocols valuerpc
Default port135
Auth requiredYes (for reliable check)

Example command

python3 relayking.py -u lowpriv -p 'P@ssw0rd' -d corp.local \
  --dc-ip 10.0.0.1 -vv \
  --protocols smb,ldap,ldaps,mssql,rpc \
  --threads 10 -o plaintext,json \
  --output-file relayking-scan \
  --proto-portscan
RPC on recent Windows Server 2025 and Windows 11 builds has known compatibility issues. See the project README for current status. Run with -vvv for detailed per-level error output when troubleshooting.

Build docs developers (and LLMs) love