Skip to content

Adds sleeps #366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions c2/cli/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down Expand Up @@ -83,6 +84,7 @@ func Basic(conn net.Conn, ch *channel.Channel) {
output.PrintShell(response)
default:
}
time.Sleep(10 * time.Millisecond)
}
}(ch)

Expand All @@ -109,6 +111,7 @@ func Basic(conn net.Conn, ch *channel.Channel) {

break
}
time.Sleep(10 * time.Millisecond)
}
}(ch)

Expand Down
2 changes: 2 additions & 0 deletions c2/httpservefile/httpservefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ func (httpServer *Server) Run(timeout int) {

break
}
time.Sleep(10 * time.Millisecond)
}
}()
// Handle timeouts
Expand Down Expand Up @@ -292,6 +293,7 @@ func (httpServer *Server) Run(timeout int) {

break
}
time.Sleep(10 * time.Millisecond)
}
}()
// Handle timeouts
Expand Down
4 changes: 4 additions & 0 deletions c2/httpserveshell/httpserveshell.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ package httpserveshell
import (
"flag"
"sync"
"time"
"sync/atomic"

"github.com/vulncheck-oss/go-exploit/c2/channel"
Expand Down Expand Up @@ -139,6 +140,7 @@ func (serveShell *Server) Run(timeout int) {

break
}
time.Sleep(10 * time.Millisecond)
}
}()
// Spin up the shell
Expand All @@ -155,6 +157,7 @@ func (serveShell *Server) Run(timeout int) {

break
}
time.Sleep(10 * time.Millisecond)
}
}()
} else {
Expand All @@ -168,6 +171,7 @@ func (serveShell *Server) Run(timeout int) {

break
}
time.Sleep(10 * time.Millisecond)
}
}()
}
Expand Down
2 changes: 2 additions & 0 deletions c2/httpshellserver/httpshellserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ func (httpServer *Server) Run(timeout int) {

break
}
time.Sleep(10 * time.Millisecond)
}
}()
// Handle timeouts
Expand Down Expand Up @@ -271,6 +272,7 @@ func (httpServer *Server) Run(timeout int) {

break
}
time.Sleep(10 * time.Millisecond)
}
}()
// Handle timeouts
Expand Down
2 changes: 2 additions & 0 deletions c2/shelltunnel/shelltunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ func (shellTunnel *Server) Run(timeout int) {

break
}
time.Sleep(10 * time.Millisecond)
}
}()

Expand All @@ -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)
}
}

Expand Down
1 change: 1 addition & 0 deletions c2/simpleshell/simpleshellclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func (shellClient *Client) Run(timeout int) {

break
}
time.Sleep(10 * time.Millisecond)
}
}()

Expand Down
1 change: 1 addition & 0 deletions c2/simpleshell/simpleshellserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions c2/sslshell/sslshellserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down