engine

package
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2018 License: AGPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Debugger = true
)
View Source
var VMPreload = `` /* 1010-byte string literal not displayed */

Functions

func CalledBy

func CalledBy() string

func CreateRegKeyAndValue

func CreateRegKeyAndValue(regHive string, keyPath string, keyObject string, keyValue interface{}) error

func DNSQuestion

func DNSQuestion(target, request string) (string, error)

func DeleteRegKeysValue

func DeleteRegKeysValue(regHive string, keypath string, keyobject string) error

func DeobfuscateString

func DeobfuscateString(Data string) string

func FindProcessPid

func FindProcessPid(key string) (int, error)

func ForkExecuteCommand

func ForkExecuteCommand(c string, args ...string) (int, error)

func GetHostname

func GetHostname() (string, error)

func GetLocalIPs

func GetLocalIPs() []string

func HTTPGetFile

func HTTPGetFile(url string) (int, []byte, error)

func InjectIntoProc

func InjectIntoProc(shellcode string, proccessID int64) error

func LocalCopyFile

func LocalCopyFile(src, dst string) error

func LocalDirCreate

func LocalDirCreate(path string) error

func LocalDirRemoveAll

func LocalDirRemoveAll(dir string) error

func LocalFileAppendBytes

func LocalFileAppendBytes(filename string, bytes []byte) error

func LocalFileAppendString

func LocalFileAppendString(input, filename string) error

func LocalFileCreate

func LocalFileCreate(path string, bytes []byte) error

func LocalFileDelete

func LocalFileDelete(path string) error

func LocalFileExists

func LocalFileExists(path string) bool

func LocalFileRead

func LocalFileRead(path string) ([]byte, error)

func LocalFileReplace

func LocalFileReplace(file, match, replacement string) error

func LocalFileReplaceMulti

func LocalFileReplaceMulti(file string, matches []string, replacement string) error

func LocalSystemInfo

func LocalSystemInfo() ([]string, error)

func ObfuscateString

func ObfuscateString(Data string) string

func ProcExists2

func ProcExists2(pidBoi int) bool

func QueryRegKeyString

func QueryRegKeyString(regHive string, keypath string, keyobject string) (string, error)

func RandString

func RandString(strlen int) string

func RandStringRunes

func RandStringRunes(n int) string

func RandomInt

func RandomInt(min, max int) int

func StripSpaces

func StripSpaces(str string) string

func TCPRead

func TCPRead(ip, port string) ([]byte, error)

func TCPWrite

func TCPWrite(writeData []byte, ip, port string) ([]byte, error)

func UDPWrite

func UDPWrite(writeData []byte, ip, port string) error

func XorBytes

func XorBytes(a []byte, b []byte) []byte

func XorFiles

func XorFiles(file1 string, file2 string, outPut string) error

Types

type Engine

type Engine struct {
	VM              *otto.Otto
	Logger          *logrus.Logger
	Imports         map[string]func() []byte
	Name            string
	DebuggerEnabled bool
}

func New

func New(name string) *Engine

func (*Engine) AddImport

func (e *Engine) AddImport(name string, data func() []byte)

func (*Engine) CreateVM

func (e *Engine) CreateVM()

func (*Engine) CurrentUser

func (e *Engine) CurrentUser() map[string]string

func (*Engine) ExecutePlan

func (e *Engine) ExecutePlan() error

func (*Engine) InjectVars

func (e *Engine) InjectVars()

func (*Engine) LoadScript

func (e *Engine) LoadScript(source []byte) error

func (*Engine) RunAfterDeploy

func (e *Engine) RunAfterDeploy() error

func (*Engine) RunBeforeDeploy

func (e *Engine) RunBeforeDeploy() error

func (*Engine) RunDeploy

func (e *Engine) RunDeploy() error

func (*Engine) RunOnError

func (e *Engine) RunOnError() error

func (*Engine) SetLogger

func (e *Engine) SetLogger(logger *logrus.Logger)

func (*Engine) SetName

func (e *Engine) SetName(name string)

func (*Engine) VMAddRegKey

func (e *Engine) VMAddRegKey(call otto.FunctionCall) otto.Value

func (*Engine) VMAppendFile

func (e *Engine) VMAppendFile(call otto.FunctionCall) otto.Value

func (*Engine) VMAsset

func (e *Engine) VMAsset(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) VMCanPing

func (e *Engine) VMCanPing(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) VMCanSudo

func (e *Engine) VMCanSudo(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) VMDelRegKey

func (e *Engine) VMDelRegKey(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) VMEnvVars

func (e *Engine) VMEnvVars(call otto.FunctionCall) otto.Value

func (*Engine) VMExec

func (e *Engine) VMExec(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

func (e *Engine) VMFileAccessTime(call otto.FunctionCall) otto.Value

func (*Engine) VMFileBirthTime

func (e *Engine) VMFileBirthTime(call otto.FunctionCall) otto.Value

func (*Engine) VMFileChangeTime

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

func (e *Engine) VMForkExec(call otto.FunctionCall) otto.Value

func (*Engine) VMGetDirsInPath

func (e *Engine) VMGetDirsInPath(call otto.FunctionCall) otto.Value

func (*Engine) VMGetEnv

func (e *Engine) VMGetEnv(call otto.FunctionCall) otto.Value

func (*Engine) VMGetHostname

func (e *Engine) VMGetHostname(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) VMHalt

func (e *Engine) VMHalt(call otto.FunctionCall) otto.Value

func (*Engine) VMHasPublicIP

func (e *Engine) VMHasPublicIP(call otto.FunctionCall) otto.Value

func (*Engine) VMImplode

func (e *Engine) VMImplode(call otto.FunctionCall) otto.Value

func (*Engine) VMIsAWS

func (e *Engine) VMIsAWS(call otto.FunctionCall) otto.Value

func (*Engine) VMIsVM

func (e *Engine) VMIsVM(call otto.FunctionCall) otto.Value

func (*Engine) VMLocalUserExists

func (e *Engine) VMLocalUserExists(call otto.FunctionCall) otto.Value

func (*Engine) VMLogCrit

func (e *Engine) VMLogCrit(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) VMLogInfo

func (e *Engine) VMLogInfo(call otto.FunctionCall) otto.Value

func (*Engine) VMLogWarn

func (e *Engine) VMLogWarn(call otto.FunctionCall) otto.Value

func (*Engine) VMLoggedInUsers

func (e *Engine) VMLoggedInUsers(call otto.FunctionCall) otto.Value

func (*Engine) VMMD5

func (e *Engine) VMMD5(call otto.FunctionCall) otto.Value

func (*Engine) VMMatches

func (e *Engine) VMMatches(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) VMQueryRegKey

func (e *Engine) VMQueryRegKey(call otto.FunctionCall) otto.Value

func (*Engine) VMReadFile

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) VMSHA1

func (e *Engine) VMSHA1(call otto.FunctionCall) otto.Value

func (*Engine) VMSSHCmd

func (e *Engine) VMSSHCmd(call otto.FunctionCall) otto.Value

func (*Engine) VMServeFileOverHTTP

func (e *Engine) VMServeFileOverHTTP(call otto.FunctionCall) otto.Value

func (*Engine) VMShellcodeExec

func (e *Engine) VMShellcodeExec(call otto.FunctionCall) otto.Value

func (*Engine) VMSignal

func (e *Engine) VMSignal(call otto.FunctionCall) otto.Value

func (*Engine) VMSleep

func (e *Engine) VMSleep(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

func (e *Engine) ValidateAST(source []byte) error

func (*Engine) ValueToByteSlice

func (e *Engine) ValueToByteSlice(v otto.Value) []byte

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL