From fb3050180340af52d4061ebabe58d59c6fa2f8e1 Mon Sep 17 00:00:00 2001 From: lobsterjerusalem Date: Fri, 2 May 2025 15:47:39 -0600 Subject: [PATCH] added sleeps --- c2/cli/basic.go | 3 +++ c2/httpservefile/httpservefile.go | 2 ++ c2/httpserveshell/httpserveshell.go | 4 ++++ c2/httpshellserver/httpshellserver.go | 2 ++ c2/shelltunnel/shelltunnel.go | 2 ++ c2/simpleshell/simpleshellclient.go | 1 + c2/simpleshell/simpleshellserver.go | 1 + c2/sslshell/sslshellserver.go | 1 + 8 files changed, 16 insertions(+) diff --git a/c2/cli/basic.go b/c2/cli/basic.go index ccfc927..11d6c23 100644 --- a/c2/cli/basic.go +++ b/c2/cli/basic.go @@ -49,6 +49,7 @@ func backgroundResponse(ch *channel.Channel, wg *sync.WaitGroup, conn net.Conn, // below. I that that's tolerable for now. responseCh <- string(responseBuffer[:bytesRead]) } + time.Sleep(10 * time.Millisecond) } } @@ -83,6 +84,7 @@ func Basic(conn net.Conn, ch *channel.Channel) { output.PrintShell(response) default: } + time.Sleep(10 * time.Millisecond) } }(ch) @@ -109,6 +111,7 @@ func Basic(conn net.Conn, ch *channel.Channel) { break } + time.Sleep(10 * time.Millisecond) } }(ch) diff --git a/c2/httpservefile/httpservefile.go b/c2/httpservefile/httpservefile.go index 0ed6d1e..2e7b02b 100644 --- a/c2/httpservefile/httpservefile.go +++ b/c2/httpservefile/httpservefile.go @@ -265,6 +265,7 @@ func (httpServer *Server) Run(timeout int) { break } + time.Sleep(10 * time.Millisecond) } }() // Handle timeouts @@ -292,6 +293,7 @@ func (httpServer *Server) Run(timeout int) { break } + time.Sleep(10 * time.Millisecond) } }() // Handle timeouts diff --git a/c2/httpserveshell/httpserveshell.go b/c2/httpserveshell/httpserveshell.go index 49746e2..b0e38d0 100644 --- a/c2/httpserveshell/httpserveshell.go +++ b/c2/httpserveshell/httpserveshell.go @@ -33,6 +33,7 @@ package httpserveshell import ( "flag" "sync" + "time" "sync/atomic" "github.com/vulncheck-oss/go-exploit/c2/channel" @@ -139,6 +140,7 @@ func (serveShell *Server) Run(timeout int) { break } + time.Sleep(10 * time.Millisecond) } }() // Spin up the shell @@ -155,6 +157,7 @@ func (serveShell *Server) Run(timeout int) { break } + time.Sleep(10 * time.Millisecond) } }() } else { @@ -168,6 +171,7 @@ func (serveShell *Server) Run(timeout int) { break } + time.Sleep(10 * time.Millisecond) } }() } diff --git a/c2/httpshellserver/httpshellserver.go b/c2/httpshellserver/httpshellserver.go index 2e9cf8b..11781a1 100644 --- a/c2/httpshellserver/httpshellserver.go +++ b/c2/httpshellserver/httpshellserver.go @@ -244,6 +244,7 @@ func (httpServer *Server) Run(timeout int) { break } + time.Sleep(10 * time.Millisecond) } }() // Handle timeouts @@ -271,6 +272,7 @@ func (httpServer *Server) Run(timeout int) { break } + time.Sleep(10 * time.Millisecond) } }() // Handle timeouts diff --git a/c2/shelltunnel/shelltunnel.go b/c2/shelltunnel/shelltunnel.go index f116d16..fda5c58 100644 --- a/c2/shelltunnel/shelltunnel.go +++ b/c2/shelltunnel/shelltunnel.go @@ -191,6 +191,7 @@ func (shellTunnel *Server) Run(timeout int) { break } + time.Sleep(10 * time.Millisecond) } }() @@ -214,6 +215,7 @@ func (shellTunnel *Server) Run(timeout int) { // but may not be immediately clear. shellTunnel.Channel().AddSession(&client, client.RemoteAddr().String()) go handleTunnelConn(client, shellTunnel.ConnectBackHost, shellTunnel.ConnectBackPort, shellTunnel.ConnectBackSSL, shellTunnel.channel) + time.Sleep(10 * time.Millisecond) } } diff --git a/c2/simpleshell/simpleshellclient.go b/c2/simpleshell/simpleshellclient.go index 8e27f60..ae0bfe1 100644 --- a/c2/simpleshell/simpleshellclient.go +++ b/c2/simpleshell/simpleshellclient.go @@ -84,6 +84,7 @@ func (shellClient *Client) Run(timeout int) { break } + time.Sleep(10 * time.Millisecond) } }() diff --git a/c2/simpleshell/simpleshellserver.go b/c2/simpleshell/simpleshellserver.go index 608b156..22ccbb1 100644 --- a/c2/simpleshell/simpleshellserver.go +++ b/c2/simpleshell/simpleshellserver.go @@ -107,6 +107,7 @@ func (shellServer *Server) Run(timeout int) { break } + time.Sleep(10 * time.Millisecond) } }() // Accept arbitrary connections. In the future we need something for the diff --git a/c2/sslshell/sslshellserver.go b/c2/sslshell/sslshellserver.go index 2342585..befc98a 100644 --- a/c2/sslshell/sslshellserver.go +++ b/c2/sslshell/sslshellserver.go @@ -154,6 +154,7 @@ func (shellServer *Server) Run(timeout int) { break } + time.Sleep(10 * time.Millisecond) } }() // Accept arbitrary connections. In the future we need something for the