Skip to content

Commit f26796d

Browse files
committed
fix: enhance logging messages for server startup with success indicators
1 parent d5e819b commit f26796d

4 files changed

Lines changed: 12 additions & 3 deletions

File tree

core/internal/cc/server/kcp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111

1212
// KCPC2ListenAndServe KCP server that forwards to C2 port
1313
func KCPC2ListenAndServe() {
14-
logging.Printf("Starting KCP server at port %s", live.RuntimeConfig.KCPServerPort)
14+
logging.Successf("🚀 Starting KCP C2 server at port %s", live.RuntimeConfig.KCPServerPort)
1515
ctx, cancel := context.WithCancel(context.Background())
1616
transport.KCPTunServer("127.0.0.1:"+live.RuntimeConfig.CCPort,
1717
live.RuntimeConfig.KCPServerPort, live.RuntimeConfig.Password, def.MagicString, ctx, cancel)

core/internal/cc/server/mtls_server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func StartOperatorMTLSServer(port int) {
4545
TLSConfig: tlsConfig,
4646
}
4747
network.MTLSServerCtx, network.MTLSServerCancel = context.WithCancel(context.Background())
48-
logging.Printf("Starting C2 operator service with mTLS at port %d", port)
48+
logging.Successf("🚀 Starting C2 operator service with mTLS at port %d", port)
4949
err = network.MTLSServer.ListenAndServeTLS(transport.OperatorServerCrtFile, transport.OperatorServerKeyFile)
5050
if err != nil {
5151
if err == http.ErrServerClosed {

core/internal/cc/server/server_main.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ func ServerMain(wg_port int, hosts string, numOperators int) {
2323
wg(wg_port, numOperators)
2424
time.Sleep(3 * time.Second)
2525
go StartC2AgentTLSServer()
26+
27+
// Highlight the key ports for easy identification
28+
logging.Successf("\n🎯 ════════════════════ C2 SERVER PORTS ═══════════════════════════")
29+
logging.Successf(" 📡 C2 Agent Port (TLS): %s", live.RuntimeConfig.CCPort)
30+
logging.Successf(" 🔄 KCP C2 Port (UDP): %s", live.RuntimeConfig.KCPServerPort)
31+
logging.Successf(" 🌐 Operator Port (mTLS): %d", wg_port+1)
32+
logging.Successf(" 🔧 WireGuard Port: %d", wg_port)
33+
logging.Successf("══════════════════════════════════════════════════════════════════\n")
34+
2635
StartOperatorMTLSServer(wg_port + 1)
2736
}
2837

core/internal/cc/server/tls_server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func StartC2AgentTLSServer() {
3232
Handler: r,
3333
}
3434
network.EmpTLSServerCtx, network.EmpTLSServerCancel = context.WithCancel(context.Background())
35-
logging.Printf("Starting C2 agent listener service with TLS at port %s", live.RuntimeConfig.CCPort)
35+
logging.Successf("🚀 Starting C2 agent listener service with TLS at port %s", live.RuntimeConfig.CCPort)
3636
err := network.EmpTLSServer.ListenAndServeTLS(transport.ServerCrtFile, transport.ServerKeyFile)
3737
if err != nil {
3838
if err == http.ErrServerClosed {

0 commit comments

Comments
 (0)