Principle:0xKoda WireMCP Plaintext Credential Reconstruction
| Knowledge Sources | |
|---|---|
| Domains | Security, Credential_Extraction |
| Last Updated | 2026-10-28 00:00 GMT |
Overview
Technique for reconstructing usable username/password pairs from sequential, protocol-specific credential artifacts extracted from a packet capture.
Description
Plaintext credential reconstruction transforms fragmented, sequential credential artifacts into coherent username/password pairs. Different protocols require different reconstruction strategies:
- HTTP Basic Auth: The credential is a single base64-encoded `username:password` string; reconstruction is a simple base64 decode and split.
- FTP: Credentials arrive as separate `USER` and `PASS` commands across different packets; reconstruction requires pairing each `USER` with the next `PASS` in sequence.
- Telnet: Credentials arrive as a prompt (`login:` or `password:`) followed by a data response in a subsequent packet; reconstruction requires detecting the prompt type and pairing it with the next data line.
The common challenge is temporal pairing: the username and password arrive in separate packets and must be correlated by sequence order.
Usage
Use this principle when you have extracted credential field artifacts from a capture and need to reconstruct usable credential pairs for security analysis or reporting.
Theoretical Basis
Pseudo-code Logic:
# Abstract algorithm (NOT real implementation)
def reconstruct_plaintext(packets):
creds = []
for p in packets:
# HTTP Basic: single-field decode
if p.authbasic:
user, pw = base64_decode(p.authbasic).split(":")
creds.append({"type": "HTTP", "username": user, "password": pw})
# FTP: stateful pairing
if p.ftp_cmd == "USER":
creds.append({"type": "FTP", "username": p.ftp_arg, "password": None})
elif p.ftp_cmd == "PASS":
last_user = find_last(creds, lambda c: c["type"] == "FTP" and c["password"] is None)
if last_user: last_user["password"] = p.ftp_arg
# Telnet: prompt-driven pairing
if is_prompt(p.telnet_data):
creds.append({"type": "TelnetPrompt", "data": p.telnet_data})
elif is_response(p.telnet_data):
last_prompt = find_last(creds, lambda c: c["type"] == "TelnetPrompt")
pair_response(last_prompt, p.telnet_data)
return creds
The core pattern is findLast pairing: when a password arrives, find the most recent credential entry of the matching type that lacks a password, and fill it in.