Skip to content

Commit

Permalink
Merge pull request #1409 from BishopFox/download-filter-fix
Browse files Browse the repository at this point in the history
Fix filters in the download command
  • Loading branch information
moloch-- authored Sep 17, 2023
2 parents f32d9a9 + d6ea479 commit a670538
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions implant/sliver/handlers/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand All @@ -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}}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a670538

Please sign in to comment.