Removed unnecessary "chan" and "select" blocks from listener.go and remove some other minor redundant pieces of code.
This commit is contained in:
@@ -6,8 +6,8 @@ import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/chzyer/readline"
|
||||
@@ -26,7 +26,7 @@ var availableCommands = []struct {
|
||||
command string
|
||||
subcommands map[string][]string // Changed to a map for better nesting
|
||||
}{
|
||||
{"show agents", nil},
|
||||
{"agents", nil},
|
||||
{"show agent", map[string][]string{
|
||||
"": {""}, // To be dynamically updated
|
||||
}},
|
||||
@@ -46,10 +46,10 @@ var availableCommands = []struct {
|
||||
{"sleep", map[string][]string{
|
||||
"": {""},
|
||||
}},
|
||||
{"shell", map[string][]string{
|
||||
{"cmd", map[string][]string{
|
||||
"": {""},
|
||||
}},
|
||||
{"ps", map[string][]string{
|
||||
{"powershell", map[string][]string{
|
||||
"": {""},
|
||||
}},
|
||||
{"run", map[string][]string{
|
||||
@@ -189,7 +189,7 @@ func main() {
|
||||
fmt.Println("Client's username and password provided")
|
||||
|
||||
// Load CA certificate
|
||||
caCert, err := ioutil.ReadFile(caCertPath)
|
||||
caCert, err := os.ReadFile(caCertPath)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to read CA certificate: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user