Skip to content

Release v2.3.1: Fix x64 Hijack Stack Alignment

Latest

Choose a tag to compare

@youssefnoob003 youssefnoob003 released this 21 Sep 07:14

SindriKit v2.3.1

v2.3.1 is a patch release for the 2.3.x line and the first published 2.3.x release. The v2.3.0 work was recorded in the changelog but was not published with a release page. v2.3.1 supersedes the unpublished 2.3.0 release entry.

This release reorganizes injection around shared target and staging engines, adds complete x86/x64 thread-hijacking frame support, and improves best-effort cleanup for failed injection operations.

Highlights

  • Shared Injection Layer — Classic, APC, and hijack techniques now share target acquisition, remote staging, PE/COFF preparation, state validation, and cleanup through sindri/injection/common/.
  • Thread Hijacking ABI Support — x86 stack-based entry frames are supported alongside x64 register-based argument handling.
  • Best-Effort Remote Cleanup — Optional process capabilities release pre-execution remote allocations and terminate targets created by failed operations when supported by the backend.
  • Injection Validation — Unit and integration coverage now exercises the common staging layer and classic, APC, and hijack PE/COFF paths across architectures and backend profiles.

Breaking Changes

  • Injection headers moved from the flat sindri/injection/context.h layout to sindri/injection/common/.
  • Shared operations use snd_inj_open_target, snd_inj_create_suspended_target, snd_inj_alloc_remote,
    snd_inj_write_payload, and snd_inj_set_protections.
  • Hijack chains now use snd_inj_ctx_t.return_policy instead of accepting a
    raw return-thunk parameter.

Added

  • Hijack Return Policies — Added SND_INJ_RETURN_NONE and SND_INJ_RETURN_GRACEFUL; graceful return resolution is handled internally by the hijack engine.
  • Process Capabilities — Added optional free_remote and terminate_process callbacks to snd_process_api_t, implemented by the Win32, NT, and syscall backends.
  • Native Termination Support — Added NtTerminateProcess declarations, hashes, primitive status mapping, and backend wiring.
  • Public Header Documentation — Expanded Doxygen contracts for injection contexts, stages, target acquisition, staging, preparation, cleanup, and hijack frame operations.

Fixed

  • x64 Thread Hijacking — Aligns the live stack pointer downward before placing the synthetic return slot, preserving the required entry ABI for non-aligned stacks.
  • Injection Cleanup — Releases pre-execution remote memory when the backend provides free_remote, preserves memory after successful execution, and closes suspended-thread handles through the appropriate capability table.
  • Target Ownership — Created targets remain cleanup-owned until execution succeeds and are not terminated after successful APC or hijack handoff.
  • Payload Lifetime — Temporary PE/COFF staging-buffer pointers are cleared before they can remain in the injection context after preparation returns.
  • Integration Teardown — Marker cleanup waits for target handles to be released and terminates target child processes.

Testing

  • Added deterministic fake-backend tests for staging, cleanup, partial writes, target ownership, hijack frame construction, and resume failures.
  • Expanded the integration matrix across classic, APC, and hijack PE/COFF payloads, x86/x64 architectures, and Win32/NT/syscall backends.

SindriKit is intended for educational, security research, and authorized red-team development.