-
Notifications
You must be signed in to change notification settings - Fork 9
/
godehashed.go
55 lines (44 loc) · 1.26 KB
/
godehashed.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
package main
import (
"flag"
"fmt"
"godehashed/dhconn"
"godehashed/parsedh"
"io/ioutil"
"log"
)
func Importkey(data string) string {
keydata, err := ioutil.ReadFile(data)
if err != nil {
log.Fatal("Error reading key: ", err)
fmt.Println(string(keydata))
}
apikey := string(keydata)
return apikey
}
func main() {
keyname := ""
email := ""
outfile := ""
name := ""
phone := 0
searchterm := ""
uname := ""
elist := ""
flag.StringVar(&keyname, "i", "", "Name of apikey to import.")
flag.StringVar(&name, "n", "", "Name we are searching for.")
flag.StringVar(&email, "e", "", "Email we are searching for")
flag.StringVar(&uname, "u", "", "Username we are searching for")
flag.IntVar(&phone, "p", 0, "Phone number we are searching for")
flag.StringVar(&searchterm, "s", "", "Specify what we are searching for: name, email or username. Then add corresponding switch.")
flag.StringVar(&outfile, "o", "", "Outfile file name, will output in CSV Format.")
flag.StringVar(&elist, "l", "", "Search a list of emails.")
flag.Parse()
if keyname == "" {
fmt.Println("You must include a api key to use '-i'")
} else {
apikey := Importkey(keyname)
parsedh.SetHeader(outfile)
dhconn.DHConn(apikey, email, name, searchterm, uname, outfile, elist, phone)
}
}