From d6ea4794b7e1c54a7dd8e8e0f13fa5cb597afb9c Mon Sep 17 00:00:00 2001 From: Raf <84349012+RafBishopFox@users.noreply.github.com> Date: Fri, 15 Sep 2023 09:10:42 -0400 Subject: [PATCH] Removed a check from the implant download code that broke filters --- implant/sliver/handlers/handlers.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/implant/sliver/handlers/handlers.go b/implant/sliver/handlers/handlers.go index 07ec6d8be9..d2b50441a8 100644 --- a/implant/sliver/handlers/handlers.go +++ b/implant/sliver/handlers/handlers.go @@ -329,7 +329,7 @@ func cpHandler(data []byte, resp RPCResponse) { return } defer srcFile.Close() - + dstFile, err := os.Create(cpReq.Dst) if err != nil { // {{if .Config.Debug}} @@ -342,7 +342,7 @@ func cpHandler(data []byte, resp RPCResponse) { return } defer dstFile.Close() - + bytesWritten, err := io.Copy(dstFile, srcFile) if err != nil { // {{if .Config.Debug}} @@ -452,9 +452,7 @@ func prepareDownload(path string, filter string, recurse bool) ([]byte, bool, in to download a single file */ fileInfo, err := os.Stat(path + filter) - if err != nil { - return nil, false, 0, 1, err - } + if err == nil && !fileInfo.IsDir() { // Then this is a single file rawData, err := os.ReadFile(path + filter)