百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

DeepSleep

> 编程语言
开源

Gargoyle 的 x64 变体,仅使用 ROP 和 PIC 隐藏内存异常

376 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

Gargoyle 的 x64 变体,仅使用 ROP 和 PIC 隐藏内存异常

DeepSleep

A variant of Gargoyle for x64 to hide memory artifacts using ROP only and PIC.

Huge thanks to @waldoirc for documenting large parts of this technique on his blog
This implementation is different in that it does not make use of any APCs and is fully implemented as PIC.

Description

I have created this to better understand how to evade memory artifacts using a Gargoyle like technique on x64. The idea is to set up a ROPChain calling VirtualProtect() -> Sleep() -> VirtualProtect() to mark my own page as N/A while Sleeping.

Unlike Gargoyle and other Gargoyle-like implementations, I fully rely on ROP and do not queue any APC. DeepSleep itself is implemented as fully PIC, which makes it easier to enumerate which memory pages have to be hidden from scanners.

While the thread is active, a MessageBox pops up and DeepSleep's page is marked as executable. While Sleeping, the page is marked as N/A.

This effectively bypasses Moneta at the time of writing if DeepSleep is injected and the executing thread's base address does not point to private commited memory.

I have verified this using the Earlybird injection technique to inject DeepSleep.bin into notepad.exe

Usage

Using Mingw:
Type make and a wild DeepSleep.bin appears.
Alternatively use the precompiled DeepSleep.bin :-)

Future Work and limitations

Future Work

I might release a loader for CS or other C2 agents. Similarly to YouMayPasser, the loader would hook sleep using HW breakpoints to avoid suspicious modifications of kernel32.dll.

Limitations

This was tested on 10.0.19044 N/A Build 19044

The ROPgadgets I am relying on might not exist in ntdll.dll in other versions of Windows. It is probably a good idea to make use of smaller and more generic ROPgadgets and to enumerate the gadgets in more dlls than ntdll.dll.

Detection

The callstack to a thread in the DelayExecution state includes unknown/tampered memory regions and additionally includes addresses to VirtualProtect(). Hunt-Sleeping-Beacons detects this.
It may be possible to apply that metric to other C2 using a different technique to wait between callbacks.

Credits

@waldoirc for documenting large parts of the technique here
@forrest Orr for Moneta
Josh Lospinoso for the original Gargoyle technique

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言