Skip to content

Commit

Permalink
Remove session from server state on kill, fix issue #781
Browse files Browse the repository at this point in the history
  • Loading branch information
moloch-- committed Sep 3, 2022
1 parent 583edd7 commit 2ea605e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/rpc/rpc-kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"google.golang.org/protobuf/proto"
)

// Kill - Kill the implant proccess
// Kill - Kill the implant process
func (rpc *Server) Kill(ctx context.Context, kill *sliverpb.KillReq) (*commonpb.Empty, error) {
var (
beacon *models.Beacon
Expand All @@ -55,7 +55,9 @@ func (rpc *Server) killSession(kill *sliverpb.KillReq, session *core.Session) (*
return nil, err
}
timeout := time.Duration(kill.Request.GetTimeout())
session.Request(sliverpb.MsgNumber(kill), timeout, data)
// Do not block waiting for the msg send, the implant connection may already be dead
go session.Request(sliverpb.MsgNumber(kill), timeout, data)
core.Sessions.Remove(session.ID)
return &commonpb.Empty{}, nil
}

Expand Down

0 comments on commit 2ea605e

Please sign in to comment.