Skip to content

Hardening DDMA Copy‑On‑Write exploit PoC.#2

Open
alor29 wants to merge 1 commit into
LabGuy94:masterfrom
alor29:hardening-fix
Open

Hardening DDMA Copy‑On‑Write exploit PoC.#2
alor29 wants to merge 1 commit into
LabGuy94:masterfrom
alor29:hardening-fix

Conversation

@alor29

@alor29 alor29 commented Jul 13, 2026

Copy link
Copy Markdown

Description:
This pull request adds simple safety checks to make the proof‑of‑concept more robust and less risky to run.

PID validation: Before, the program would try to inject into any process ID, including critical system processes. I added a guard so that very low PIDs (like 0–4) are rejected. This prevents accidental crashes or corruption of system processes.

Section size check: The exploit assumed the .text section of kernel32.dll always had enough space for shellcode. I added a check to make sure the section is at least 0x1000 bytes before attempting injection. This avoids writing into too small a section.

TLS address sanity check: The code used whatever address GetProcAddress returned for TlsGetValue. I added a guard to stop if the address is invalid. This prevents overwriting memory when the pointer is not safe.

Shellcode size validation: The exploit copied shellcode without checking if it fit. I added a check so that if the shellcode is larger than the allocated section, the program aborts instead of overflowing memory.
image

…llcode size validation to harden exploit PoC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant