Skip to content

Commit 679b312

Browse files
committed
fix: update command formatting for client connection commands and improve readability
1 parent c5437c2 commit 679b312

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

core/internal/cc/operator/agent.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ func RenderAgentTable(agents []*def.Emp3r0rAgent) {
1919

2020
for _, target := range agents {
2121
agentProc := *target.Process
22-
procInfo := fmt.Sprintf("%s (%d)\n<- %s (%d)",
22+
procInfo := fmt.Sprintf("%s (%d) <- %s (%d)",
2323
agentProc.Cmdline, agentProc.PID, agentProc.Parent, agentProc.PPID)
24-
ips := strings.Join(target.IPs, ",\n")
24+
ips := strings.Join(target.IPs, ", ")
2525
infoMap := map[string]string{
2626
"OS": util.SplitLongLine(target.OS, 20),
2727
"Process": util.SplitLongLine(procInfo, 20),
2828
"User": util.SplitLongLine(target.User, 20),
29-
"From": fmt.Sprintf("%s\nvia %s", target.From, target.Transport),
29+
"From": fmt.Sprintf("%s via %s", target.From, target.Transport),
3030
"IPs": ips,
3131
}
3232
row := []string{

core/internal/cc/server/server_main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ func generateConnectionCommands(wg_port int, server_pubkey string, operators []O
180180
// Generate example commands for local and remote usage
181181
if len(operators) > 0 {
182182
op := operators[0]
183-
localCmd := fmt.Sprintf("./emp3r0r client --c2-host 127.0.0.1 --c2-port %d --server-wg-key %s --server-wg-ip %s --operator-wg-ip %s",
183+
localCmd := fmt.Sprintf("emp3r0r client --c2-host 127.0.0.1 --c2-port %d --server-wg-key '%s' --server-wg-ip '%s' --operator-wg-ip '%s'",
184184
wg_port, server_pubkey, netutil.WgServerIP, op.IP)
185-
remoteCmd := fmt.Sprintf("./emp3r0r client --c2-host <YOUR_PUBLIC_IP> --c2-port %d --server-wg-key %s --server-wg-ip %s --operator-wg-ip %s",
185+
remoteCmd := fmt.Sprintf("emp3r0r client --c2-host <YOUR_PUBLIC_IP> --c2-port %d --server-wg-key '%s' --server-wg-ip '%s' --operator-wg-ip '%s'",
186186
wg_port, server_pubkey, netutil.WgServerIP, op.IP)
187187

188188
logging.Successf("\n💡 Example Commands (for Operator 1):")
@@ -193,6 +193,6 @@ func generateConnectionCommands(wg_port int, server_pubkey string, operators []O
193193

194194
// generateClientCommand generates a client connection command for a specific operator
195195
func generateClientCommand(wg_port int, server_pubkey string, op OperatorConfig) string {
196-
return fmt.Sprintf("./emp3r0r client --c2-port %d --server-wg-key %s --server-wg-ip %s --operator-wg-ip %s --c2-host <C2_PUBLIC_IP>",
196+
return fmt.Sprintf("emp3r0r client --c2-port %d --server-wg-key '%s' --server-wg-ip '%s' --operator-wg-ip '%s' --c2-host <C2_PUBLIC_IP>",
197197
wg_port, server_pubkey, netutil.WgServerIP, op.IP)
198198
}

0 commit comments

Comments
 (0)