-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"fmt" | ||
"godehashed/dhconn" | ||
"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 := "" | ||
|
||
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.Parse() | ||
|
||
if keyname == "" { | ||
fmt.Println("You must include a api key to use '-i'") | ||
} else { | ||
apikey := Importkey(keyname) | ||
dhconn.DHConn(apikey, email, name, searchterm, uname, outfile, phone) | ||
|
||
} | ||
|
||
} |