Documentation
¶
Index ¶
- Variables
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func BytesToCompressed(b []byte) []byte
- func CalledBy() string
- func CompressedToBytes(b []byte) []byte
- func CreateReplacement(s string) []byte
- func DNSQuestion(target, request string) (string, error)
- func DeobfuscateString(Data string) string
- func FindProcessPid(key string) (int, error)
- func ForkExecuteCommand(c string, args ...string) (int, error)
- func GetLocalIPs() []string
- func HTTPGetFile(url string) (int, []byte, error)
- func InjectIntoProc(shellcode string, proccessID int64) error
- func LocalCopyFile(src, dst string) error
- func LocalDirCreate(path string) error
- func LocalDirRemoveAll(dir string) error
- func LocalFileAppendBytes(filename string, bytes []byte) error
- func LocalFileAppendString(input, filename string) error
- func LocalFileCreate(path string, bytes []byte) error
- func LocalFileDelete(path string) error
- func LocalFileExists(path string) bool
- func LocalFileRead(path string) ([]byte, error)
- func LocalFileReplace(file, match, replacement string) error
- func LocalFileReplaceMulti(file string, matches []string, replacement string) error
- func LocalSystemInfo() ([]string, error)
- func MustAsset(name string) []byte
- func ObfuscateString(Data string) string
- func ProcExists2(pidBoi int) bool
- func RandString(strlen int) string
- func RandStringRunes(n int) string
- func RandUpperAlphaString(strlen int) string
- func RandomInt(min, max int) int
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func StripSpaces(str string) string
- func TCPRead(ip, port string) ([]byte, error)
- func TCPWrite(writeData []byte, ip, port string) ([]byte, error)
- func UDPWrite(writeData []byte, ip, port string) error
- func XorBytes(a []byte, b []byte) []byte
- func XorFiles(file1 string, file2 string, outPut string) error
- type ByLength
- type Compiler
- func (c *Compiler) CreateBuildDir()
- func (c *Compiler) Do()
- func (c *Compiler) GenerateTangledHairs() string
- func (c *Compiler) HairTangler(key rune, source string) string
- func (c *Compiler) LollerSkateDaStringz(source []byte) []byte
- func (c *Compiler) MordorifyDarwin()
- func (c *Compiler) MordorifyLinux()
- func (c *Compiler) MordorifyWindows()
- func (c *Compiler) ObfuscateBinary()
- func (c *Compiler) ParseAssets(filename string) []string
- func (c *Compiler) Visit(node goast.Node) goast.Visitor
- type EmbeddedFile
- type Engine
- func (e *Engine) AddImport(name string, data func() []byte)
- func (e *Engine) CreateVM()
- func (e *Engine) CurrentUser() map[string]string
- func (e *Engine) DebugConsole(call otto.FunctionCall) otto.Value
- func (e *Engine) EnableLogging()
- func (e *Engine) ExecutePlan() error
- func (e *Engine) InjectVars()
- func (e *Engine) InteractiveSession()
- func (e *Engine) LoadScript(source []byte) error
- func (e *Engine) LogCrit(i ...interface{})
- func (e *Engine) LogCritf(fmtString string, i ...interface{})
- func (e *Engine) LogDebug(i ...interface{})
- func (e *Engine) LogDebugf(fmtString string, i ...interface{})
- func (e *Engine) LogError(i ...interface{})
- func (e *Engine) LogErrorf(fmtString string, i ...interface{})
- func (e *Engine) LogInfo(i ...interface{})
- func (e *Engine) LogInfof(fmtString string, i ...interface{})
- func (e *Engine) LogWarn(i ...interface{})
- func (e *Engine) LogWarnf(fmtString string, i ...interface{})
- func (e *Engine) RunAfterDeploy() error
- func (e *Engine) RunBeforeDeploy() error
- func (e *Engine) RunDeploy() error
- func (e *Engine) RunOnError() error
- func (e *Engine) SessionCompleter(d prompt.Document) []prompt.Suggest
- func (e *Engine) SessionExecutor(in string)
- func (e *Engine) SetName(name string)
- func (e *Engine) VMAppendFile(call otto.FunctionCall) otto.Value
- func (e *Engine) VMAsset(call otto.FunctionCall) otto.Value
- func (e *Engine) VMB64Decode(call otto.FunctionCall) otto.Value
- func (e *Engine) VMB64Encode(call otto.FunctionCall) otto.Value
- func (e *Engine) VMCPUStats(call otto.FunctionCall) otto.Value
- func (e *Engine) VMCanExecFile(call otto.FunctionCall) otto.Value
- func (e *Engine) VMCanMakeHTTPConn(call otto.FunctionCall) otto.Value
- func (e *Engine) VMCanMakeTCPConn(call otto.FunctionCall) otto.Value
- func (e *Engine) VMCanPing(call otto.FunctionCall) otto.Value
- func (e *Engine) VMCanReadFile(call otto.FunctionCall) otto.Value
- func (e *Engine) VMCanSSHLogin(call otto.FunctionCall) otto.Value
- func (e *Engine) VMCanSudo(call otto.FunctionCall) otto.Value
- func (e *Engine) VMCanWriteFile(call otto.FunctionCall) otto.Value
- func (e *Engine) VMCmdSuccessful(call otto.FunctionCall) otto.Value
- func (e *Engine) VMCopyFile(call otto.FunctionCall) otto.Value
- func (e *Engine) VMDNSQuery(call otto.FunctionCall) otto.Value
- func (e *Engine) VMDeleteFile(call otto.FunctionCall) otto.Value
- func (e *Engine) VMDetectSSLMITM(call otto.FunctionCall) otto.Value
- func (e *Engine) VMDirExists(call otto.FunctionCall) otto.Value
- func (e *Engine) VMEnvVars(call otto.FunctionCall) otto.Value
- func (e *Engine) VMExec(call otto.FunctionCall) otto.Value
- func (e *Engine) VMExecuteFile(call otto.FunctionCall) otto.Value
- func (e *Engine) VMExistsInPath(call otto.FunctionCall) otto.Value
- func (e *Engine) VMExpectedDNS(call otto.FunctionCall) otto.Value
- func (e *Engine) VMFileAccessTime(call otto.FunctionCall) otto.Value
- func (e *Engine) VMFileBirthTime(call otto.FunctionCall) otto.Value
- func (e *Engine) VMFileChangeTime(call otto.FunctionCall) otto.Value
- func (e *Engine) VMFileContains(call otto.FunctionCall) otto.Value
- func (e *Engine) VMFileExists(call otto.FunctionCall) otto.Value
- func (e *Engine) VMFileModifyTime(call otto.FunctionCall) otto.Value
- func (e *Engine) VMForkExec(call otto.FunctionCall) otto.Value
- func (e *Engine) VMGetDirsInPath(call otto.FunctionCall) otto.Value
- func (e *Engine) VMGetEnv(call otto.FunctionCall) otto.Value
- func (e *Engine) VMGetTweet(call otto.FunctionCall) otto.Value
- func (e *Engine) VMHTTPRequest(call otto.FunctionCall) otto.Value
- func (e *Engine) VMHalt(call otto.FunctionCall) otto.Value
- func (e *Engine) VMHasPublicIP(call otto.FunctionCall) otto.Value
- func (e *Engine) VMImplode(call otto.FunctionCall) otto.Value
- func (e *Engine) VMIsAWS(call otto.FunctionCall) otto.Value
- func (e *Engine) VMIsVM(call otto.FunctionCall) otto.Value
- func (e *Engine) VMLocalUserExists(call otto.FunctionCall) otto.Value
- func (e *Engine) VMLogCrit(call otto.FunctionCall) otto.Value
- func (e *Engine) VMLogDebug(call otto.FunctionCall) otto.Value
- func (e *Engine) VMLogError(call otto.FunctionCall) otto.Value
- func (e *Engine) VMLogInfo(call otto.FunctionCall) otto.Value
- func (e *Engine) VMLogWarn(call otto.FunctionCall) otto.Value
- func (e *Engine) VMLoggedInUsers(call otto.FunctionCall) otto.Value
- func (e *Engine) VMMD5(call otto.FunctionCall) otto.Value
- func (e *Engine) VMMatches(call otto.FunctionCall) otto.Value
- func (e *Engine) VMMemStats(call otto.FunctionCall) otto.Value
- func (e *Engine) VMProcExistsWithName(call otto.FunctionCall) otto.Value
- func (e *Engine) VMReadFile(call otto.FunctionCall) otto.Value
- func (e *Engine) VMReplaceInFile(call otto.FunctionCall) otto.Value
- func (e *Engine) VMRetrieveFileFromURL(call otto.FunctionCall) otto.Value
- func (e *Engine) VMSHA1(call otto.FunctionCall) otto.Value
- func (e *Engine) VMSSHCmd(call otto.FunctionCall) otto.Value
- func (e *Engine) VMServeFileOverHTTP(call otto.FunctionCall) otto.Value
- func (e *Engine) VMShellcodeExec(call otto.FunctionCall) otto.Value
- func (e *Engine) VMSignal(call otto.FunctionCall) otto.Value
- func (e *Engine) VMSleep(call otto.FunctionCall) otto.Value
- func (e *Engine) VMTCPPortInUse(call otto.FunctionCall) otto.Value
- func (e *Engine) VMTimestamp(call otto.FunctionCall) otto.Value
- func (e *Engine) VMUDPPortInUse(call otto.FunctionCall) otto.Value
- func (e *Engine) VMUsersRunningProcs(call otto.FunctionCall) otto.Value
- func (e *Engine) VMWriteFile(call otto.FunctionCall) otto.Value
- func (e *Engine) ValidateAST(source []byte) error
- func (e *Engine) ValueToByteSlice(v otto.Value) []byte
- type StringDef
- type VMBundle
- type VMExecResponse
Constants ¶
This section is empty.
Variables ¶
var (
Debugger = true
)
var (
FunctionMap = map[string]string{}
)
var ObfuscatedBlobs = []string{
"2f686f6d652f5b5b3a776f72643a5d5c2e5c5c2f205d2a",
"2f55736572732f5b5b3a776f72643a5d5c2e5c5c2f205d2a",
"2f726f6f742f5b5b3a776f72643a5d5c2e5c5c2f205d2a",
"2f746d702f5b5b3a776f72643a5d5c2e5c5c2f205d2a",
"2f7573722f6c6f63616c2f5b5b3a776f72643a5d5c2e5c5c2f205d2a",
"6769746875625b5b3a776f72643a5d5c2e5c5c2f205d2a",
"676f6f676c655b5b3a776f72643a5d5c2e5c5c2f205d2a",
"676f6c616e675b5b3a776f72643a5d5c2e5c5c2f205d2a",
"676f706b675b5b3a776f72643a5d5c2e5c5c2f205d2a",
"5550585b5b3a776f72643a5d5c2e5c5c2f205d2a",
"24496e666f5b5b3a776f72643a5d5c2e5c5c2f205d2a",
"67656e30636964655b5b3a776f72643a5d5c2e5c5c2f205d2a",
"677363726970745b5b3a776f72643a5d5c2e5c5c2f205d2a",
}
var VMPreload = `` /* 1010-byte string literal not displayed */
Functions ¶
func Asset ¶ added in v0.0.4
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶ added in v0.0.4
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/
foo.txt
img/
a.png
b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶ added in v0.0.4
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetNames ¶ added in v0.0.4
func AssetNames() []string
AssetNames returns the names of the assets.
func BytesToCompressed ¶
func CompressedToBytes ¶
func CreateReplacement ¶ added in v0.0.8
func DNSQuestion ¶
func DeobfuscateString ¶
func FindProcessPid ¶ added in v0.0.8
func ForkExecuteCommand ¶ added in v0.0.8
func GetLocalIPs ¶ added in v0.0.7
func GetLocalIPs() []string
func InjectIntoProc ¶ added in v0.0.8
func LocalCopyFile ¶
func LocalDirCreate ¶
func LocalDirRemoveAll ¶
func LocalFileAppendBytes ¶
func LocalFileAppendString ¶
func LocalFileCreate ¶
func LocalFileDelete ¶
func LocalFileExists ¶
func LocalFileRead ¶
func LocalFileReplace ¶
func LocalFileReplaceMulti ¶
func LocalSystemInfo ¶
func MustAsset ¶ added in v0.0.4
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func ObfuscateString ¶
func ProcExists2 ¶ added in v0.0.8
func RandString ¶
func RandStringRunes ¶
func RandUpperAlphaString ¶ added in v0.0.4
func RestoreAsset ¶ added in v0.0.4
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶ added in v0.0.4
RestoreAssets restores an asset under the given directory recursively
func StripSpaces ¶
Types ¶
type Compiler ¶
type Compiler struct {
OS string `json:"os"`
Arch string `json:"arch"`
OutputFile string `json:"output"`
VMs []*VMBundle `json:"vms"`
BuildDir string `json:"build_dir"`
AssetDir string `json:"asset_dir"`
OutputSource bool `json:"output_source"`
Logger *l.Logger `json:"-"`
Source string `json:"-"`
StringDefs []*StringDef `json:"-"`
}
Compiler creates a skeleton structure to produce a compiled binary
func NewCompiler ¶
NewCompiler returns a basic Compiler object
func (*Compiler) CreateBuildDir ¶
func (c *Compiler) CreateBuildDir()
CreateBuildDir sets up the compiler's build directory
func (*Compiler) GenerateTangledHairs ¶ added in v0.0.8
func (*Compiler) HairTangler ¶ added in v0.0.8
func (*Compiler) LollerSkateDaStringz ¶ added in v0.0.8
func (*Compiler) MordorifyDarwin ¶ added in v0.0.8
func (c *Compiler) MordorifyDarwin()
func (*Compiler) MordorifyLinux ¶ added in v0.0.8
func (c *Compiler) MordorifyLinux()
func (*Compiler) MordorifyWindows ¶ added in v0.0.8
func (c *Compiler) MordorifyWindows()
func (*Compiler) ObfuscateBinary ¶ added in v0.0.8
func (c *Compiler) ObfuscateBinary()
func (*Compiler) ParseAssets ¶ added in v0.0.4
ParseAssets normalizes the import files into localized assets
type EmbeddedFile ¶
type EmbeddedFile struct {
SourcePath string
SourceURL string
Filename string
NameHash string
VariableDef string
Uncompressed []byte
Compressed []byte
}
func (*EmbeddedFile) Compress ¶
func (e *EmbeddedFile) Compress()
func (*EmbeddedFile) Embed ¶
func (e *EmbeddedFile) Embed()
func (*EmbeddedFile) ResolveData ¶
func (e *EmbeddedFile) ResolveData()
func (*EmbeddedFile) ResolveFilename ¶
func (e *EmbeddedFile) ResolveFilename()
func (*EmbeddedFile) ResolveVariableName ¶
func (e *EmbeddedFile) ResolveVariableName()
type Engine ¶
func (*Engine) CurrentUser ¶ added in v0.0.3
func (*Engine) DebugConsole ¶
func (e *Engine) DebugConsole(call otto.FunctionCall) otto.Value
func (*Engine) EnableLogging ¶
func (e *Engine) EnableLogging()
func (*Engine) ExecutePlan ¶
func (*Engine) InjectVars ¶ added in v0.0.3
func (e *Engine) InjectVars()
func (*Engine) InteractiveSession ¶
func (e *Engine) InteractiveSession()
func (*Engine) LoadScript ¶
func (*Engine) RunAfterDeploy ¶
func (*Engine) RunBeforeDeploy ¶
func (*Engine) RunOnError ¶
func (*Engine) SessionCompleter ¶
func (*Engine) SessionExecutor ¶
func (*Engine) VMAppendFile ¶
func (e *Engine) VMAppendFile(call otto.FunctionCall) otto.Value
func (*Engine) VMB64Decode ¶
func (e *Engine) VMB64Decode(call otto.FunctionCall) otto.Value
func (*Engine) VMB64Encode ¶
func (e *Engine) VMB64Encode(call otto.FunctionCall) otto.Value
func (*Engine) VMCPUStats ¶
func (e *Engine) VMCPUStats(call otto.FunctionCall) otto.Value
func (*Engine) VMCanExecFile ¶
func (e *Engine) VMCanExecFile(call otto.FunctionCall) otto.Value
func (*Engine) VMCanMakeHTTPConn ¶
func (e *Engine) VMCanMakeHTTPConn(call otto.FunctionCall) otto.Value
func (*Engine) VMCanMakeTCPConn ¶
func (e *Engine) VMCanMakeTCPConn(call otto.FunctionCall) otto.Value
func (*Engine) VMCanReadFile ¶
func (e *Engine) VMCanReadFile(call otto.FunctionCall) otto.Value
func (*Engine) VMCanSSHLogin ¶
func (e *Engine) VMCanSSHLogin(call otto.FunctionCall) otto.Value
func (*Engine) VMCanWriteFile ¶
func (e *Engine) VMCanWriteFile(call otto.FunctionCall) otto.Value
func (*Engine) VMCmdSuccessful ¶
func (e *Engine) VMCmdSuccessful(call otto.FunctionCall) otto.Value
func (*Engine) VMCopyFile ¶
func (e *Engine) VMCopyFile(call otto.FunctionCall) otto.Value
func (*Engine) VMDNSQuery ¶
func (e *Engine) VMDNSQuery(call otto.FunctionCall) otto.Value
func (*Engine) VMDeleteFile ¶
func (e *Engine) VMDeleteFile(call otto.FunctionCall) otto.Value
func (*Engine) VMDetectSSLMITM ¶
func (e *Engine) VMDetectSSLMITM(call otto.FunctionCall) otto.Value
func (*Engine) VMDirExists ¶
func (e *Engine) VMDirExists(call otto.FunctionCall) otto.Value
func (*Engine) VMExecuteFile ¶
func (e *Engine) VMExecuteFile(call otto.FunctionCall) otto.Value
func (*Engine) VMExistsInPath ¶
func (e *Engine) VMExistsInPath(call otto.FunctionCall) otto.Value
func (*Engine) VMExpectedDNS ¶
func (e *Engine) VMExpectedDNS(call otto.FunctionCall) otto.Value
func (*Engine) VMFileAccessTime ¶ added in v0.0.8
func (e *Engine) VMFileAccessTime(call otto.FunctionCall) otto.Value
func (*Engine) VMFileBirthTime ¶ added in v0.0.8
func (e *Engine) VMFileBirthTime(call otto.FunctionCall) otto.Value
func (*Engine) VMFileChangeTime ¶ added in v0.0.8
func (e *Engine) VMFileChangeTime(call otto.FunctionCall) otto.Value
func (*Engine) VMFileContains ¶
func (e *Engine) VMFileContains(call otto.FunctionCall) otto.Value
func (*Engine) VMFileExists ¶
func (e *Engine) VMFileExists(call otto.FunctionCall) otto.Value
func (*Engine) VMFileModifyTime ¶
func (e *Engine) VMFileModifyTime(call otto.FunctionCall) otto.Value
func (*Engine) VMForkExec ¶ added in v0.0.8
func (e *Engine) VMForkExec(call otto.FunctionCall) otto.Value
func (*Engine) VMGetDirsInPath ¶
func (e *Engine) VMGetDirsInPath(call otto.FunctionCall) otto.Value
func (*Engine) VMGetTweet ¶
func (e *Engine) VMGetTweet(call otto.FunctionCall) otto.Value
func (*Engine) VMHTTPRequest ¶
func (e *Engine) VMHTTPRequest(call otto.FunctionCall) otto.Value
func (*Engine) VMHasPublicIP ¶
func (e *Engine) VMHasPublicIP(call otto.FunctionCall) otto.Value
func (*Engine) VMLocalUserExists ¶
func (e *Engine) VMLocalUserExists(call otto.FunctionCall) otto.Value
func (*Engine) VMLogDebug ¶
func (e *Engine) VMLogDebug(call otto.FunctionCall) otto.Value
func (*Engine) VMLogError ¶
func (e *Engine) VMLogError(call otto.FunctionCall) otto.Value
func (*Engine) VMLoggedInUsers ¶
func (e *Engine) VMLoggedInUsers(call otto.FunctionCall) otto.Value
func (*Engine) VMMemStats ¶
func (e *Engine) VMMemStats(call otto.FunctionCall) otto.Value
func (*Engine) VMProcExistsWithName ¶
func (e *Engine) VMProcExistsWithName(call otto.FunctionCall) otto.Value
func (*Engine) VMReadFile ¶ added in v0.0.8
func (e *Engine) VMReadFile(call otto.FunctionCall) otto.Value
func (*Engine) VMReplaceInFile ¶
func (e *Engine) VMReplaceInFile(call otto.FunctionCall) otto.Value
func (*Engine) VMRetrieveFileFromURL ¶
func (e *Engine) VMRetrieveFileFromURL(call otto.FunctionCall) otto.Value
func (*Engine) VMServeFileOverHTTP ¶
func (e *Engine) VMServeFileOverHTTP(call otto.FunctionCall) otto.Value
func (*Engine) VMShellcodeExec ¶ added in v0.0.8
func (e *Engine) VMShellcodeExec(call otto.FunctionCall) otto.Value
func (*Engine) VMTCPPortInUse ¶
func (e *Engine) VMTCPPortInUse(call otto.FunctionCall) otto.Value
func (*Engine) VMTimestamp ¶
func (e *Engine) VMTimestamp(call otto.FunctionCall) otto.Value
func (*Engine) VMUDPPortInUse ¶
func (e *Engine) VMUDPPortInUse(call otto.FunctionCall) otto.Value
func (*Engine) VMUsersRunningProcs ¶
func (e *Engine) VMUsersRunningProcs(call otto.FunctionCall) otto.Value
func (*Engine) VMWriteFile ¶
func (e *Engine) VMWriteFile(call otto.FunctionCall) otto.Value
func (*Engine) ValidateAST ¶
type VMBundle ¶ added in v0.0.4
type VMBundle struct {
ID string `json:"id"`
ScriptFile string `json:"source"`
AssetFiles []string `json:"imports"`
Embeds []EmbeddedFile `json:"-"`
}
VMBundle defines a standalone GSE VM that will be bundled into a compiled binary
type VMExecResponse ¶
type VMExecResponse struct {
Stdout []string `json:"stdout"`
Stderr []string `json:"stderr"`
Success bool `json:"success"`
PID int `json:"pid"`
ErrorMsg string `json:"error_message"`
}
func ExecuteCommand ¶
func ExecuteCommand(c string, args ...string) VMExecResponse
