-
Notifications
You must be signed in to change notification settings - Fork 47
/
main.go
51 lines (44 loc) · 1.74 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package main
import (
"flag"
"fmt"
"os"
"github.com/C-Sto/gosecretsdump/cmd"
)
var version string
//const version = "0.3.0"
func main() {
if version == "" {
version = "DEV"
}
//defer profile.Start(profile.ProfilePath("./")).Stop()
//defer profile.Start(profile.MemProfile, profile.ProfilePath("./")).Stop()
//defer profile.Start(profile.BlockProfile, profile.ProfilePath("./")).Stop()
fmt.Println("gosecretsdump v" + version + " (@C__Sto)")
s := cmd.Settings{}
var vers bool
flag.StringVar(&s.Outfile, "out", "", "Location to export output")
flag.StringVar(&s.NTDSLoc, "ntds", "", "Location of the NTDS file (required)")
flag.StringVar(&s.SystemLoc, "system", "", "Location of the SYSTEM file (required)")
flag.StringVar(&s.SAMLoc, "sam", "", "Location of SAM registry hive")
flag.BoolVar(&s.LiveSAM, "livesam", false, "Get hashes from live system. Only works on local machine hashes (SAM), only works on Windows.")
flag.BoolVar(&s.Status, "status", false, "Include status in hash output")
flag.BoolVar(&s.EnabledOnly, "enabled", false, "Only output enabled accounts")
flag.BoolVar(&s.NoPrint, "noprint", false, "Don't print output to screen (probably use this with the -out flag)")
flag.BoolVar(&s.Stream, "stream", false, "Stream to files rather than writing in a block. Can be much slower.")
flag.BoolVar(&vers, "version", false, "Print version and exit")
flag.BoolVar(&s.History, "history", false, "Include Password History")
flag.Parse()
if vers {
os.Exit(0)
}
if s.SystemLoc == "" && (s.NTDSLoc == "" && s.SAMLoc == "") && !s.LiveSAM {
flag.Usage()
os.Exit(1)
}
e := cmd.GoSecretsDump(s)
if e != nil {
panic(e)
}
}
//info dumped out of https://github.com/SecureAuthCorp/impacket/blob/master/impacket/examples/secretsdump.py