Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//go:build windows
// +build windows

package caffeinate

import (
"errors"
)

type CaffeinateRunWindows struct {
Successful bool
Resultstring string
}

func (j *CaffeinateRunWindows) Success() bool {
return j.Successful
}

func (j *CaffeinateRunWindows) Result() string {
return j.Resultstring
}

func runCommand(enable bool) (CaffeinateRunWindows, error) {
n := CaffeinateRunWindows{}
n.Resultstring = ""
n.Successful = false
return n, errors.New("Not implemented")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//go:build windows

package clipboard

func GetClipboard(readTypes []string) (string, error) {
return "Not Implemented", nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//go:build windows
// +build windows

package clipboard_monitor

import (
"errors"
)

func CheckClipboard(oldCount int) (string, error) {
return "", errors.New("Not supported on Windows")
}

func GetClipboardCount() (int, error) {
return int(0), errors.New("Not supported on Windows")
}
func GetFrontmostApp() (string, error) {
return "", errors.New("Not supported on Windows")
}
func WaitForTime() {

}
11 changes: 11 additions & 0 deletions Payload_Type/poseidon/poseidon/agent_code/drives/drives_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//go:build windows

package drives

import (
"errors"
)

func listDrives() ([]Drive, error) {
return nil, errors.New("Not implemented")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//go:build windows

package execute_library

type WindowsExecuteMemory struct {
Message string
}

func executeLibrary(filePath string, functionName string, args []string) (WindowsExecuteMemory, error) {
res := WindowsExecuteMemory{}
res.Message = "Not Supported"
return res, nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// +build windows

package jsimport_call

import (
"errors"
)

type JxaRunWindows struct {
Successful bool
Resultstring string
}

func (j *JxaRunWindows) Success() bool {
return j.Successful
}

func (j *JxaRunWindows) Result() string {
return j.Resultstring
}


func runCommand(encpayload string) (JxaRunWindows, error) {
n := JxaRunWindows{}
n.Resultstring = ""
n.Successful = false
return n, errors.New("Not implemented")
}
27 changes: 27 additions & 0 deletions Payload_Type/poseidon/poseidon/agent_code/jxa/jxa_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// +build windows
package jxa

import (
"errors"
)

type JxaRunWindows struct {
Successful bool
Resultstring string
}

func (j *JxaRunWindows) Success() bool {
return j.Successful
}

func (j *JxaRunWindows) Result() string {
return j.Resultstring
}


func runCommand(encpayload string) (JxaRunWindows, error) {
n := JxaRunWindows{}
n.Resultstring = ""
n.Successful = false
return n, errors.New("Not implemented")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// +build windows

package keystate

import "errors"

func keyLogger() error {
return errors.New("Not implemented.")
}
28 changes: 28 additions & 0 deletions Payload_Type/poseidon/poseidon/agent_code/keys/keys_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//go:build windows
// +build windows

package keys

import "errors"

// KeyContents - struct that represent raw key contents
type WindowsKeyInformation struct {
KeyType string
KeyData []byte
}

// Type - The type of key information. Keyring or keychain
func (l *WindowsKeyInformation) Type() string {
return l.KeyType
}

// KeyData - Retrieve the keydata as a raw json string
func (l *WindowsKeyInformation) Data() []byte {
return l.KeyData
}

func getkeydata(opts Options) (WindowsKeyInformation, error) {
//Check if the types are available
d := WindowsKeyInformation{}
return d, errors.New("Not implemented")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//go:build windows

package libinject

import (
"errors"
)

type WindowsInjection struct {
}

func (l *WindowsInjection) Success() bool {
return false
}

func injectLibrary(pid int, path string) (WindowsInjection, error) {
return WindowsInjection{}, errors.New("Not implemented")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// +build windows

package list_entitlements

type WindowsListEntitlements struct {
Successful bool
Message string
CodeSign int
}

func listEntitlements(pid int) (WindowsListEntitlements, error) {
res := WindowsListEntitlements{}
res.Successful = false
res.Message = "Not Supported"
return res, nil
}
func listCodeSign(pid int) (WindowsListEntitlements, error) {
res := WindowsListEntitlements{}
res.Successful = false
res.Message = "Not Supported"
res.CodeSign = -1;
return res, nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// +build windows

package listtasks

import (
"errors"
)

type ListtasksLinux struct {
Results map[string]interface{}
}

func (l *ListtasksLinux) Result() map[string]interface{} {
return l.Results
}

func getAvailableTasks() (ListtasksLinux, error) {
n := ListtasksLinux{}
m := map[string]interface{}{
"result": "not implemented",
}

n.Results = m
return n, errors.New("Not implemented")
}
21 changes: 0 additions & 21 deletions Payload_Type/poseidon/poseidon/agent_code/ls/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ import (
// Standard
"encoding/json"
"os"
"os/user"
"path/filepath"
"strconv"
"strings"
"syscall"

// 3rd Party
"github.com/djherbis/atime"
Expand All @@ -18,24 +15,6 @@ import (
"github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs"
)

func GetPermission(finfo os.FileInfo) structs.FilePermission {
perms := structs.FilePermission{}
perms.Permissions = finfo.Mode().Perm().String()
systat := finfo.Sys().(*syscall.Stat_t)
if systat != nil {
perms.UID = int(systat.Uid)
perms.GID = int(systat.Gid)
tmpUser, err := user.LookupId(strconv.Itoa(perms.UID))
if err == nil {
perms.User = tmpUser.Username
}
tmpGroup, err := user.LookupGroupId(strconv.Itoa(perms.GID))
if err == nil {
perms.Group = tmpGroup.Name
}
}
return perms
}

func Run(task structs.Task) {
msg := task.NewResponse()
Expand Down
32 changes: 32 additions & 0 deletions Payload_Type/poseidon/poseidon/agent_code/ls/ls_posix.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//go:build linux || darwin
// +build linux,darwin
package ls

import (
// Standard
"os"
"os/user"
"strconv"
"syscall"

"github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs"
)

func GetPermission(finfo os.FileInfo) structs.FilePermission {
perms := structs.FilePermission{}
perms.Permissions = finfo.Mode().Perm().String()
systat := finfo.Sys().(*syscall.Stat_t)
if systat != nil {
perms.UID = int(systat.Uid)
perms.GID = int(systat.Gid)
tmpUser, err := user.LookupId(strconv.Itoa(perms.UID))
if err == nil {
perms.User = tmpUser.Username
}
tmpGroup, err := user.LookupGroupId(strconv.Itoa(perms.GID))
if err == nil {
perms.Group = tmpGroup.Name
}
}
return perms
}
20 changes: 20 additions & 0 deletions Payload_Type/poseidon/poseidon/agent_code/ls/ls_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//go:build windows
// +build windows
package ls

import (
"os"

"github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs"
)

func GetPermission(finfo os.FileInfo) structs.FilePermission {
// TODO: fixme
return structs.FilePermission {
UID: 0,
GID: 0,
Permissions: "",
User: "",
Group: "",
}
}
21 changes: 21 additions & 0 deletions Payload_Type/poseidon/poseidon/agent_code/lsopen/lsopen_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// +build windows

package lsopen

import (
"errors"
)

type LSOpenWindows struct {
Successful bool
}

func (j *LSOpenWindows) Success() bool {
return j.Successful
}

func runCommand(app string, hide bool, args []string) (LSOpenWindows, error) {
n := LSOpenWindows{}
n.Successful = false
return n, errors.New("Not implemented")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package persist_launchd

import (

// Poseidon

"github.com/MythicAgents/poseidon/Payload_Type/poseidon/agent_code/pkg/utils/structs"
)

func runCommand(task structs.Task) {
msg := task.NewResponse()
msg.SetError("Not implemented")
task.Job.SendResponses <- msg
return
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//go:build windows

package persist_loginitem

type PersistLoginItemWindows struct {
Message string
}

func runCommand(name string, path string, global bool, list bool, remove bool) PersistLoginItemWindows {
n := PersistLoginItemWindows{}
n.Message = "Not Implemented"
return n
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build (linux || darwin) && http
//go:build http

package profiles

Expand Down
Loading