Skip to content

Commit

Permalink
Merge branch 'master' into fix-1444
Browse files Browse the repository at this point in the history
  • Loading branch information
RafBishopFox authored Nov 3, 2023
2 parents c1d1bf7 + 16db603 commit 4da9233
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions implant/sliver/transports/httpclient/httpclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -648,13 +648,15 @@ func (s *SliverHTTPClient) closeURL() *url.URL {
// Must return at least a file name, path segments are optional
func (s *SliverHTTPClient) randomPath(segments []string, filenames []string, ext string) []string {
genSegments := []string{}
if 0 < len(segments) {
n := insecureRand.Intn(len(segments)) // How many segments?
for index := 0; index < n; index++ {
seg := segments[insecureRand.Intn(len(segments))]
genSegments = append(genSegments, seg)
}
}
if 0 < len(segments) {
min, _ := strconv.Atoi("{{.HTTPC2ImplantConfig.MinPaths}}")
max, _ := strconv.Atoi("{{.HTTPC2ImplantConfig.MaxPaths}}")
n := insecureRand.Intn(max-min+1) + min // How many segments?
for index := 0; index < n; index++ {
seg := segments[insecureRand.Intn(len(segments))]
genSegments = append(genSegments, seg)
}
}
filename := filenames[insecureRand.Intn(len(filenames))]

// {{if .Config.Debug}}
Expand Down

0 comments on commit 4da9233

Please sign in to comment.