RWX_MEMEORY_HUNT_AND_INJECTION_DV
滥用 Windows fork API 和 OneDrive.exe 进程注入恶意 shellcode,而无需分配新的 RWX 内存区域。此技术是在已运行的进程(本例中为 OneDrive.exe)中找到 RWX 区域,然后将 shellcode 写入该区域并执行它,而无需调用 VirtualProtect、VirtualAllocEx、VirtualAlloc。
用法
只需编译程序并运行(EXE),无需任何参数。
步骤
-
在运行的进程中找到OneDrive.exe。
-
获取OneDrive.exe的句柄。
-
查询远程进程内存信息。
-
寻找 RWX 内存区域。
-
将 shellcode 写入 OneDrive.exe 的找到区域中
-
将 OneDrive.exe 分叉到一个新的进程中。
-
将分叉进程的起始地址设置为克隆的shellcode。
-
执行后终止克隆的进程。
Shell code 代码
此技术适用于基于 ntdll 的 shellcode,它不依赖于任何部分。我使用https://github.com/rainerzufalldererste/windows_x64_shellcode_template来生成我的 shellcode。
Shellcode 创建
-
根据https://github.com/rainerzufalldererste/windows_x64_shellcode_template上的说明编辑 shellcode 模板文件函数“shellcode_template”
-
编译代码并在任何十六进制编辑器(HxD)中打开.EXE 文件
-
提取 .text 部分并在给定的项目文件中使用它。
-
要提取 shellcode,存储库中还解释了其他方法。
仅用于教育目的。
演示
https://www.linkedin.com/posts/usman-sikander13_%3F%3F%3F-%3F%3F%3F%3F%3F%3F-activity-7196426924351488001-RXOk?utm_source=share&utm_medium=member_desktop
项目地址:
https://github.com/Offensive-Panda/RWX_MEMEORY_HUNT_AND_INJECTION_DV
原文始发于微信公众号(Ots安全):隐形Shellcode注入:利用 Windows Forking 绕过内存保护
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论