Documentation
¶
Index ¶
- Constants
- Variables
- func BytesToCompressed(b []byte) []byte
- func CalledBy() string
- func CompressedToBytes(b []byte) []byte
- func DNSQuestion(target, request string) (string, error)
- func DeobfuscateString(Data string) string
- func HTTPGetFile(url string) ([]byte, 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 ObfuscateString(Data string) string
- func RandLowerAlphaString(strlen int) string
- func RandString(strlen int) string
- func RandStringRunes(n int) string
- func RandomInt(min, max int) int
- func StripSpaces(str string) string
- func XorBytes(a []byte, b []byte) []byte
- func XorFiles(file1 string, file2 string, outPut string) error
- type Compiler
- 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) VMFileContains(call otto.FunctionCall) otto.Value
- func (e *Engine) VMFileCreateTime(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) 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) 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) 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 VMExecResponse
Constants ¶
const EntryPoint = `genesis_entry_point.gs`
Variables ¶
var (
Debugger = true
)
var TempEnd = "\tgse.LoadScript(gse.Imports[\"genesis_entry_point.gs\"]())\n\tgse.ExecutePlan()\n}\n"
var TempMain = "func main() {\n\tgse := gscript.New(\"\")\n\tgse.CreateVM()"
var TempStart = "package %s\n\nimport (\n\t\"bytes\"\n\t\"compress/flate\"\n\t\"io/ioutil\"\n\n\t\"github.com/gen0cide/gscript\"\n)\n"
var VMPreload = `` /* 1010-byte string literal not displayed */
Functions ¶
func BytesToCompressed ¶
func CompressedToBytes ¶
func DNSQuestion ¶
func DeobfuscateString ¶
DeobfuscateString from https://github.com/SaturnsVoid/GoBot2/blob/7d6609cd49f006f5aee76a4ffd97eb25d12a1a9b/components/Cryptography.go#L44
func HTTPGetFile ¶
HTTPGetFile takes a url and returns a byte slice of the file there
func LocalCopyFile ¶
func LocalDirCreate ¶
func LocalDirRemoveAll ¶
func LocalFileAppendBytes ¶
LocalFileAppendBytes adds bytes to the end of filename's path.
func LocalFileAppendString ¶
LocalFileAppendString adds input as strings to the end of filename's path.
func LocalFileCreate ¶
func LocalFileDelete ¶
func LocalFileExists ¶
func LocalFileRead ¶
LocalReadFile takes a file path and returns the byte array of the file there
func LocalFileReplace ¶
Replace will replace all instances of match with replace in file.
func LocalFileReplaceMulti ¶
ReplaceMulti will replace all instances of possible matches with replacement in file.
func LocalSystemInfo ¶
func ObfuscateString ¶
ObfuscateString from https://github.com/SaturnsVoid/GoBot2/blob/7d6609cd49f006f5aee76a4ffd97eb25d12a1a9b/components/Cryptography.go#L52
func RandLowerAlphaString ¶
func RandString ¶
RandString returns a string the length of strlen
func RandStringRunes ¶
func StripSpaces ¶
StripSpaces will remove the spaces from a single string and return the new string
Types ¶
type Compiler ¶
type Compiler struct { OS string Arch string ScriptFile string PackageName string OutputFile string AssetFiles []string Embeds []EmbeddedFile BuildDir string AssetDir string Logger *l.Logger }
func NewCompiler ¶
func (*Compiler) BuildEntryPoint ¶
func (c *Compiler) BuildEntryPoint()
func (*Compiler) CompileAssets ¶
func (c *Compiler) CompileAssets()
func (*Compiler) CreateBuildDir ¶
func (c *Compiler) CreateBuildDir()
func (*Compiler) GatherAssets ¶
func (c *Compiler) GatherAssets()
func (*Compiler) WriteScript ¶
func (c *Compiler) WriteScript()
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) GenerateVariableDef ¶
func (e *EmbeddedFile) GenerateVariableDef()
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
Uses the native DNS client (including things like host files and resolution)
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) VMFileContains ¶
func (e *Engine) VMFileContains(call otto.FunctionCall) otto.Value
func (*Engine) VMFileCreateTime ¶
func (e *Engine) VMFileCreateTime(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) 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) 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) 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 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
ExecuteCommand function