Skip to content

Commit

Permalink
Merge branch 'master' into go-donut
Browse files Browse the repository at this point in the history
  • Loading branch information
rkervella committed Nov 9, 2020
2 parents c40ae54 + 62ac671 commit 085e867
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/command/filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ func cat(ctx *grumble.Context, rpc rpcpb.SliverRPCClient) {
}
if ctx.Flags.Bool("colorize-output") {
if err = colorize(download); err != nil {
fmt.Printf(string(download.Data))
fmt.Println(string(download.Data))
}
} else {
fmt.Printf(string(download.Data))
fmt.Println(string(download.Data))
}
}

Expand Down
25 changes: 25 additions & 0 deletions client/command/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"fmt"
"io/ioutil"
"log"
"net"
"net/url"
"os"
"path"
Expand Down Expand Up @@ -162,6 +163,30 @@ func generateStager(ctx *grumble.Context, rpc rpcpb.SliverRPCClient) {
fmt.Println(Warn + "please specify a listening host")
return
}
match, err := regexp.MatchString(`^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$`, lhost)
if err != nil {
return
}
if !match {
addr, err := net.LookupHost(lhost)
if err != nil {
fmt.Printf(Warn+"Error resolving %s: %v\n", lhost, err)
return
}
if len(addr) > 1 {
prompt := &survey.Select{
Message: "Select an address",
Options: addr,
}
err := survey.AskOne(prompt, &lhost)
if err != nil {
fmt.Printf(Warn+"Error: %v\n", err)
return
}
} else {
lhost = addr[0]
}
}
lport := ctx.Flags.Int("lport")
stageOS := ctx.Flags.String("os")
arch := ctx.Flags.String("arch")
Expand Down

0 comments on commit 085e867

Please sign in to comment.