Skip to content

Commit

Permalink
Only try to read keytab if it was supplied as an argument
Browse files Browse the repository at this point in the history
  • Loading branch information
rkervella committed Mar 3, 2023
1 parent 71f9492 commit e3a2ff8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions client/command/exec/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,13 @@ func SSHCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
con.PrintErrorf("You must specify a keytab file with the --kerberos-keytab flag\n")
return
}
kerberosKeytab, err := os.ReadFile(kerberosKeytabFile)
if err != nil {
con.PrintErrorf("%s\n", err)
return
kerberosKeytab := []byte{}
if kerberosKeytabFile != "" {
kerberosKeytab, err = os.ReadFile(kerberosKeytabFile)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
}

if password == "" && len(privKey) == 0 && !ctx.Flags.Bool("skip-loot") {
Expand Down

0 comments on commit e3a2ff8

Please sign in to comment.