Skip to content

Commit

Permalink
Restoring --hashfile and --passfile to fix #8.
Browse files Browse the repository at this point in the history
  • Loading branch information
Macmod committed Jun 25, 2024
1 parent 128a27d commit c9ca647
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion godap.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package main

import (
"fmt"
"fmt"
"log"
"os"
"strings"

"github.com/Macmod/godap/v2/tui"
"github.com/spf13/cobra"
)
Expand All @@ -13,6 +17,23 @@ func main() {
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
tui.LdapServer = args[0]

if tui.LdapPasswordFile != "" {
pw, err := os.ReadFile(tui.LdapPasswordFile)
if err != nil {
log.Fatal(err)
}
tui.LdapPassword = strings.TrimSpace(string(pw))
}

if tui.NtlmHashFile != "" {
hash, err := os.ReadFile(tui.NtlmHashFile)
if err != nil {
log.Fatal(err)
}
tui.NtlmHash = strings.TrimSpace(string(hash))
}

tui.SetupApp()
},
}
Expand Down

0 comments on commit c9ca647

Please sign in to comment.