【FreeBuf福利群招新啦!精美周边、现金红包送送送...
满50人开启第一次抽奖,FreeBuf盲盒*2
满100人开启第二次抽奖,FreeBuf大象公仔*2
......
群内不定期开启各种福利活动,包括赠书、报告等,
群内每日更新最新网安资讯】
关于Acheron
功能特性
1、不需要任何其他的依赖组件; 2、基于纯Go语言或Go程序集开发; 3、支持自定义字符串加密和哈希函数以对抗静态代码分析;
工具运行机制
1、遍历PEB并检索内存中ntdll.dll的基地址; 2、解析导出目录并检索每一个导出函数的地址; 3、计算每一个Zw*函数的系统服务数量; 4、枚举ntdll.dll中干净的syscall;ret工具; 5、创建代理实例,用于发送间接/直接系统调用;
工具下载
git clone https://github.com/f1zm0/acheron.git
(向右滑动,查看更多) 或者使用go get命令来下载Acheron: go get -u github.com/f1zm0/acheron
工具使用
下载完成后,我们只需要在代码中调用acheron.New()来创建一个系统调用代理实例,并使用acheron.Syscall()来针对Nt* API发送间接系统调用即可。 最简化样例: package main
import (
"fmt"
"unsafe"
"github.com/f1zm0/acheron"
)
func main() {
var (
baseAddr uintptr
hSelf = uintptr(0xffffffffffffffff)
)
// creates Acheron instance, resolves SSNs, collects clean trampolines in ntdll.dlll, etc.
ach, err := acheron.New()
if err != nil {
panic(err)
}
// indirect syscall for NtAllocateVirtualMemory
s1 := ach.HashString("NtAllocateVirtualMemory")
if retcode, err := ach.Syscall(
s1, // function name hash
hSelf, // arg1: _In_ HANDLE ProcessHandle,
uintptr(unsafe.Pointer(&baseAddr)), // arg2: _Inout_ PVOID *BaseAddress,
uintptr(unsafe.Pointer(nil)), // arg3: _In_ ULONG_PTR ZeroBits,
0x1000, // arg4: _Inout_ PSIZE_T RegionSize,
windows.MEM_COMMIT|windows.MEM_RESERVE, // arg5: _In_ ULONG AllocationType,
windows.PAGE_EXECUTE_READWRITE, // arg6: _In_ ULONG Protect
); err != nil {
panic(err)
}
fmt.Printf(
"allocated memory with NtAllocateVirtualMemory (status: 0x%x)n",
retcode,
)
// ...
}
(向右滑动,查看更多) 工具使用样例
|
|
|
|
|
|
|
|
许可证协议
项目地址
https://github.com/crummie5/FreshyCalls
https://github.com/thefLink/RecycledGate
https://winternl.com/detecting-manual-syscalls-from-user-mode/
https://www.usenix.org/legacy/events/vee06/full_papers/p154-bhansali.pdf
https://redops.at/en/blog/direct-syscalls-a-journey-from-high-to-low
原文始发于微信公众号(FreeBuf):如何使用Acheron修改Go程序中并尝试绕过反病毒产品的检测
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论