Skip to content

[pull] capemon from kevoreilly:capemon#150

Open
pull[bot] wants to merge 306 commits into
EnegyBase:capemonfrom
kevoreilly:capemon
Open

[pull] capemon from kevoreilly:capemon#150
pull[bot] wants to merge 306 commits into
EnegyBase:capemonfrom
kevoreilly:capemon

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Jan 27, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull Bot added the ⤵️ pull label Jan 27, 2025
kevoreilly and others added 29 commits June 3, 2025 17:18
The code is kinda ugly with goto, but it's about as clean as I can get it to re-use existing log formatter in cases where exceptions may occur / sanity checks fail.
…a2d4e1c831808d0a791608db40cd1e4df598e5fee4bac1b239d4f8194f8e2d4a (fixes #100)
Untested :)

While capemon had some RVA hook capabilities before, they were used for DLLs (which has been replaced and seems to be no longer used). This commit adds RVA hooking capabilities for executables. The DLL RVA hooks "sanity check" the DLL using a timestamp, however I've opted to use a quick code scan of the functions first few bytes. I've also added in a NtQueryVirtualMemory version of "IsBadReadPtr" to handle sanity checking a bit more strictly than the existing function in capemon (is_valid_address_range).

The hooked function itself is inspired from the code over at https://github.com/KingKDot/Exorcism, just ported into a hook/loq that capemon likes. Please do check out his github if you're curious of this hooks usefulness.
kevoreilly and others added 30 commits March 17, 2026 14:03
Remove debug output for initialized com hooks.
…645297a0a423564f99b9f474b0df234d6613d04df48a94cb67f541b8eb829d1)
Completes the TLS 1.3 traffic-secret extraction that was scaffolded in 84d5f71 but left unimplemented, adds in-process TLS 1.2/1.3 coverage for WinHTTP/.NET samples that use Schannel-CNG directly (bypassing ncryptsslp.dll), and fixes a concurrent-write race in LogTls where FILE_SHARE_READ-only sharing mode prevented multi-process key capture.
Replace the per-thread g_stage_root / g_client_random_root /
g_tls13_client_random_root linked lists (and their SRWLOCKs and
get/add/del helpers introduced in 0c6e76e) with plain
__declspec(thread) variables. Same per-thread semantics, no
manual lookup or locking, no leaked entries on thread exit (the
OS reclaims TLS automatically).

  - t_stage replaces ThreadTLS13Stage / tls_stage_*
  - t_client_random (+ t_client_random_valid) replaces
    ThreadClientRandom / tls_client_random_*
  - t_tls13_client_random (+ t_tls13_client_random_valid)
    replaces ThreadTLS13ClientRandom / tls13_client_random_*

Preserves upstream semantics:
  - SslHashHandshake (TLS 1.2) stashes client_random only if one
    has not already been captured for the thread (was
    `if (R == NULL)`), and resets t_stage to 0 on every
    ClientHello.
  - BCryptHashData (TLS 1.3) remains unchanged behaviorally:
    always HexEncodes the current ClientHello's client_random
    (was unconditional HexEncode after get-or-create).

Drops the never-written ServerRandomRepr field from ThreadRandom.

Validated live on a CAPE host: TLS 1.2 master_secret and the
full TLS 1.3 secret set (CLIENT/SERVER_HANDSHAKE_TRAFFIC_SECRET,
CLIENT/SERVER_TRAFFIC_SECRET_0, EXPORTER_SECRET) are captured
identically to the lookup-table version against the same
baseline samples.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… hook type fails (e.g. GetCommandLineA/W - fixes #134), improve hook_api() code structure
… "&src" & "&dst" (e.g. action0=dumpimage:&src) for instruction parsing, GetOperand() supporting function
Improve TLS 1.3/1.2 Key Capture & Scylla ATL-Removal Build Cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants