Documentation
¶
Overview ¶
core - the "core" package is used to organize all primary libraries and utilities that are made use of across several aspects of the application.
This can include anything from custom data structures, to colors for text output.
Index ¶
- Variables
- func AckFileChunk(sessionID int, chunkIndex int) bool
- func AssignWolfBroadcast(username string, rhost string, response string)
- func AssignWolfResponse(username string, rhost string, response string)
- func BroadcastSession(session string)
- func BroadcastSessionData(sessionID string, data string)
- func BroadcastWolfPackChat(response string)
- func ChatLog(data string) error
- func ClientLoadExtendedFunctions(activeSession int) []byte
- func CmdExec(activeSession int, cmdString string, operator string) error
- func CompleteFileTransfer(sessionID int)
- func DownloadFile(filename string, fileb64 string)
- func ExecuteConnection(rhost string, rport int, protocol string, path string, commandQuery string, ...) (string, error)
- func GeneratePSK() string
- func GenerateSelfSignedCert(ip, host string, days int) error
- func GetFileTransferProgress(sessionID int) int
- func GetFirstUsePSK() (response string, psk string, instructions string, help string)
- func GetNextFileChunk(sessionID int) (string, int, int, bool)
- func KillListener(id int) (responseSuccess string, responseFail string)
- func KillStager(id int) (responseSuccess string, responseFail string)
- func LoadExtendedFunctions(sessionApp *grumble.App, activeSession int)
- func LogData(data string) error
- func ManagePSK(psk string, isRandom bool, operator string) (response string, currentPSK string, instruction string)
- func QueueImplantCommand(sessionID int, cmd string, operator string)
- func RegisterSession(sessionID int, protocol string, implant Implant, rhost string, rport int, ...)
- func SessionCheckIn(sessionID int, protocol string)
- func SessionExists(session int) bool
- func SessionStatusUpdate(sessionID int, status string)
- func ShowListeners() map[string]ListenerStrings
- func ShowSessions() map[string]SessionStrings
- func ShowStagers() map[string]StagerStrings
- func StartConnector(id int, rhost string, rport int, protocol string, requestType string, ...) (string, error)
- func StartFileTransfer(sessionID int, fileData string, chunkSize int) int
- func UpdateImplant(sessionID int, updateInterval float64, arch string, ...)
- func UpdateWolf(username string, rhost string)
- func UploadFile(file string) string
- func WebShellStatus(id int, rhost string, rport int, protocol string, requestType string, ...) (bool, error)
- type Commands
- type DNSData
- type FileTransferState
- type Implant
- type Listener
- type ListenerStrings
- type ManageResponse
- type ResponseChunk
- type Session
- type SessionStrings
- type Stager
- type StagerStrings
- type StartResponse
- type TCPData
- type Wolf
Constants ¶
This section is empty.
Variables ¶
var ActiveSession = -1
var DidDisplayPsk = false
DidDisplayPsk - a boolean to check if the pre-generated PSK was already given to the user so it is not printed each time
ErrorColorBold - bold red color useful for error messages
ErrorColorBoldIns - insert variant for variables, bold red color useful for error messages
ErrorColorUnderline - underlined bold red color useful for strong error messages
var FileTransfers = make(map[int]*FileTransferState)
var FileTransfersMutex = sync.RWMutex{}
var GreenColor = color.New(color.FgGreen)
GreenColor - green color for text output
var GreenColorIns = color.New(color.FgGreen).SprintFunc()
GreenColorIns - insert variant for variables, green color for text output
var Listeners = make(map[int]Listener)
Listeners - a map of Listeners. This is used to manage listeners that are created by the user. The map structure makes it easy to search, add, modify, and delete a large amount of Listeners.
var MagentaColor = color.New(color.FgMagenta)
MagentaColor - magenta color for text output
MagentaColorBold - bold magenta color for text output
var PSK string
PSK - global PSK for listeners to manage and set the server PSK
var PersistenceMode bool
PersistenceMode - a boolean to check to see if persistence mode is enabled/disabled
var RedColor = color.New(color.FgRed)
RedColor - red color for text output
var RedColorIns = color.New(color.FgRed).SprintFunc()
RedColorIns - insert variant for variables, red color for text output
var ResponseChunks = make(map[int]ResponseChunk)
var ResponseChunksMutex = sync.RWMutex{}
var SessionID int = 0
var Sessions sync.Map
var Stagers = make(map[int]Stager)
Stagers - a map of Stagers. This is used to manage stagers that are created by the user.
SuccessColorBold - bold green color useful for success messages
WarningColorBold - bold yellow color useful for warning messages
var Wolves = make(map[string]Wolf)
Wolves - map of all operators (wolves). This is used to manage wolf pack server users that have been generated. The map structure makes it easy to search, add, modify, and delete a large amount of Wolves.
var ZeroedUUID, _ = uuid.Parse("00000000-0000-0000-0000-000000000000")
ZeroedUUID - zeroed global used to clear UUIDs wherever applicable
Functions ¶
func AckFileChunk ¶ added in v1.3.0
AckFileChunk marks a chunk as received
func AssignWolfBroadcast ¶
AssignWolfBroadcast - this function takes in a username and rhost to keep track of the user being assigned the broadcast message. The response parameter is then updated and linked to a wolf which will be returned by the WolfPack Server.
func AssignWolfResponse ¶
AssignWolfResponse - this function takes in a username and rhost to keep track of the user being assigned the response. The response parameter is then updated and linked to a wolf which will be returned by the WolfPack Server.
func BroadcastSession ¶
func BroadcastSession(session string)
func BroadcastSessionData ¶ added in v1.3.1
BroadcastSessionData broadcasts session output data to all connected wolfpack operators. data should already be URL-decoded and have backslashes escaped.
func BroadcastWolfPackChat ¶
func BroadcastWolfPackChat(response string)
BroadcastWolfPackChat - this function takes in a chat message response and broadcasts it to all wolves, they will only receive it if making a request from the Chat CLI. The response parameter is then updated and linked to each wolf which will be returned by the WolfPack Server.
func CompleteFileTransfer ¶ added in v1.3.0
func CompleteFileTransfer(sessionID int)
CompleteFileTransfer marks transfer as done and cleans up
func DownloadFile ¶
DownloadFile - Reads a base64 encoded string and writes it out to a local file
func ExecuteConnection ¶
func GeneratePSK ¶
func GeneratePSK() string
GeneratePSK - Generates a random 32 character string, encodes it with SHA256 as a PSK that is set by default on startup unless the user specifies a static PSK
func GenerateSelfSignedCert ¶ added in v1.1.0
func GetFileTransferProgress ¶ added in v1.3.0
GetFileTransferProgress returns the current progress percentage and logs if it crosses 10% threshold
func GetFirstUsePSK ¶
func GetNextFileChunk ¶ added in v1.3.0
GetNextFileChunk retrieves the next chunk to send, or a missing chunk if one was lost
func KillListener ¶
KillListener - kills a listener with the specified id and returns the response
func KillStager ¶ added in v1.3.1
KillStager - kills a stager with the specified id and returns the response
func LoadExtendedFunctions ¶
func LogData ¶
LogData - wrapper function to use golang's built in logger and append all operational data to a central log file
func QueueImplantCommand ¶
QueueImplantCommand - adds a command to the implant’s queue
func RegisterSession ¶
func SessionCheckIn ¶
func SessionExists ¶
func SessionStatusUpdate ¶
func ShowListeners ¶
func ShowListeners() map[string]ListenerStrings
ShowListeners - returns a string map of Listeners and their details
func ShowSessions ¶
func ShowSessions() map[string]SessionStrings
func ShowStagers ¶ added in v1.3.1
func ShowStagers() map[string]StagerStrings
ShowStagers - returns a string map of Stagers and their details
func StartConnector ¶
func StartFileTransfer ¶ added in v1.3.0
StartFileTransfer initializes a file transfer session, breaking the file into chunks
func UpdateImplant ¶
func UpdateImplant(sessionID int, updateInterval float64, arch string, functions map[string]interface{})
UpdateImplant - updates fields of an implant during check-in
func UpdateWolf ¶
UpdateWolf - updates the properties of an individual wolfpack user for processing elsewhere in the application. Updates the current command in the queue and the remote host connection value.
func UploadFile ¶
UploadFile - Reads a file to be uploaded and converts it to base64 to pass to the server as a response for the session
Types ¶
type FileTransferState ¶ added in v1.3.0
type FileTransferState struct {
SessionID int
Chunks []string // All chunks of the file
TotalChunks int
CurrentChunk int // Next chunk to send
AckedChunks map[int]bool // Which chunks have been acknowledged
Timestamp time.Time
LastChunkTime time.Time
LastProgress int // Last reported progress percentage (0-100)
}
FileTransferState - tracks ongoing file transfers to implants Key: sessionID, Value: file transfer metadata
type Implant ¶
type Implant struct {
ID uuid.UUID
Arch string
Commands []Commands
Update float64
Functions map[string]interface{}
// contains filtered or unexported fields
}
Implant - defines an implant structure composed of:
type Listener ¶
type Listener struct {
ID int
Lhost string
Lport int
Protocol string
HTTPInstance *http.Server
TCPInstance net.Listener
DNSInstance *dns.Server
CryptoPSK string
}
Listener - defines a listener structure composed of:
id - unique identifier that is autoincremented on creation of a new listener
lhost - the "listening" host address. This tells a listener what interface to listen on based on the address it is tied to.
lport - the "listening" port. This tells a listener what port the lhost of the listener should open to receive connections on.
protocol - the protocol to use when listening for incoming connections. Currenlty supports HTTP(S) and TCP.
httpInstance - a pointer to an instance of the http.Server struct. This is used to reference the core HTTP Server itself when conducting operations such as starting/stopping a listener.
tcpInstance - a copy of the net.Listener struct. This is used to interact with the core TCP Server itself when conducting operations such as starting/stopping a listener.
type ListenerStrings ¶
ListenerStrings - more loose structure for handling listener data, primarily used to hand off as JSON to the lupo client. Contains all the same fields as a Listener structure but as string data types and omits the HTTP/TCPInstance values.
type ManageResponse ¶
type ResponseChunk ¶ added in v1.3.0
ResponseChunkBuffer - stores chunked DNS responses temporarily for implants to retrieve Format: map[sessionID] -> { "chunks": []string, "timestamp": time.Time, "totalChunks": int }
type SessionStrings ¶
type Stager ¶ added in v1.3.1
type Stager struct {
ID int
Lhost string
Lport int
Protocol string
Dir string
HTTPInstance *http.Server
}
Stager - defines a stager structure composed of:
ID - unique identifier that is autoincremented on creation of a new stager ¶
Lhost - the "listening" host address. This tells the stager what interface to listen on.
Lport - the "listening" port.
Protocol - the protocol to use when serving files. Supports HTTP and HTTPS.
Dir - the directory path to serve files from. Created on startup if it does not exist.
HTTPInstance - a pointer to the underlying http.Server used to start/stop the stager.
type StagerStrings ¶ added in v1.3.1
StagerStrings - more loose structure for handling stager data, primarily used to hand off as JSON to the lupo client. Contains all the same fields as a Stager structure but as string data types and omits the HTTPInstance value.
type StartResponse ¶
type Wolf ¶
type Wolf struct {
WolfPSK string
Username string
Rhost string
Response string
Broadcast string
Checkin string
}
Wolf - defines a user structure known as a "wolf" composed of:
WolfPSK - unique PSK randomly generated and seeded into the compilation of the wolfpack client binary on creation of a new user for authentication to the wolfpack server ¶
Username - a username to identify the user connecting to the wolfpack server ¶
Rhost - the "remote" host address. This contains a value of the external IP where a wolpack user is connecting from.
Response - a response to transmit to the wolfpack user (may not be necessary if the server handler loop takes care of this once implemented)