Skip to content

Commit

Permalink
Merge branch 'master' into multiextensions
Browse files Browse the repository at this point in the history
  • Loading branch information
rkervella authored Sep 25, 2023
2 parents b3ab5ea + a670538 commit b212e0f
Show file tree
Hide file tree
Showing 2 changed files with 7 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
4 changes: 4 additions & 0 deletions implant/sliver/ps/ps_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,14 @@ func getProcessOwner(pid uint32) (owner string, err error) {
if err != nil {
return
}
defer syscall.CloseHandle(handle)

var token syscall.Token
if err = syscall.OpenProcessToken(handle, syscall.TOKEN_QUERY, &token); err != nil {
return
}
defer token.Close()

tokenUser, err := getTokenOwner(token)
if err != nil {
return
Expand Down

0 comments on commit b212e0f

Please sign in to comment.