diff --git a/agent/agent.go b/agent/agent.go index d794df5..dd856b6 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -64,7 +64,7 @@ type Agent struct { exe_name string paw string initialDelay float64 - originLinkID int + originLinkID string hostIPAddrs []string availableDataEncoders []string @@ -89,7 +89,7 @@ type Agent struct { } // Set up agent variables. -func (a *Agent) Initialize(server string, tunnelConfig *contact.TunnelConfig, group string, c2Config map[string]string, enableLocalP2pReceivers bool, initialDelay int, paw string, originLinkID int) error { +func (a *Agent) Initialize(server string, tunnelConfig *contact.TunnelConfig, group string, c2Config map[string]string, enableLocalP2pReceivers bool, initialDelay int, paw string, originLinkID string) error { host, err := os.Hostname() if err != nil { return err diff --git a/agent/agent_factory.go b/agent/agent_factory.go index 83668f6..0084172 100644 --- a/agent/agent_factory.go +++ b/agent/agent_factory.go @@ -6,7 +6,7 @@ import ( // Creates and initializes a new Agent. Upon success, returns a pointer to the agent and nil Error. // Upon failure, returns nil and an error. -func AgentFactory(server string, tunnelConfig *contact.TunnelConfig, group string, c2Config map[string]string, enableLocalP2pReceivers bool, initialDelay int, paw string, originLinkID int) (*Agent, error) { +func AgentFactory(server string, tunnelConfig *contact.TunnelConfig, group string, c2Config map[string]string, enableLocalP2pReceivers bool, initialDelay int, paw string, originLinkID string) (*Agent, error) { newAgent := &Agent{} if err := newAgent.Initialize(server, tunnelConfig, group, c2Config, enableLocalP2pReceivers, initialDelay, paw, originLinkID); err != nil { return nil, err diff --git a/core/core.go b/core/core.go index af76831..2ed57a7 100644 --- a/core/core.go +++ b/core/core.go @@ -17,14 +17,14 @@ import ( ) // Initializes and returns sandcat agent. -func initializeCore(server string, tunnelConfig *contact.TunnelConfig, group string, contactConfig map[string]string, p2pReceiversOn bool, initialDelay int, verbose bool, paw string, originLinkID int) (*agent.Agent, error) { +func initializeCore(server string, tunnelConfig *contact.TunnelConfig, group string, contactConfig map[string]string, p2pReceiversOn bool, initialDelay int, verbose bool, paw string, originLinkID string) (*agent.Agent, error) { output.SetVerbose(verbose) output.VerbosePrint("Starting sandcat in verbose mode.") return agent.AgentFactory(server, tunnelConfig, group, contactConfig, p2pReceiversOn, initialDelay, paw, originLinkID) } //Core is the main function as wrapped by sandcat.go -func Core(server string, tunnelConfig *contact.TunnelConfig, group string, delay int, contactConfig map[string]string, p2pReceiversOn bool, verbose bool, paw string, originLinkID int) { +func Core(server string, tunnelConfig *contact.TunnelConfig, group string, delay int, contactConfig map[string]string, p2pReceiversOn bool, verbose bool, paw string, originLinkID string) { sandcatAgent, err := initializeCore(server, tunnelConfig, group, contactConfig, p2pReceiversOn, delay, verbose, paw, originLinkID) if err != nil { output.VerbosePrint(fmt.Sprintf("[-] Error when initializing agent: %s", err.Error())) diff --git a/sandcat.go b/sandcat.go index a816e54..8b7c65c 100644 --- a/sandcat.go +++ b/sandcat.go @@ -38,7 +38,7 @@ func main() { delay := flag.Int("delay", 0, "Delay starting this agent by n-seconds") verbose := flag.Bool("v", false, "Enable verbose output") listenP2P := flag.Bool("listenP2P", parsedListenP2P, "Enable peer-to-peer receivers") - originLinkID := flag.Int("originLinkID", 0, "Optionally set originating link ID") + originLinkID := flag.String("originLinkID", "", "Optionally set originating link ID") tunnelProtocol := flag.String("tunnelProtocol", "", "C2 comms tunnel type to use.") tunnelAddr := flag.String("tunnelAddr", "", "Address used to connect to or start the tunnel.") tunnelUsername := flag.String("tunnelUser", "", "Username used to authenticate to the tunnel.")