Merge pull request #10 from Kraken-OffSec/reduce-default-results-columns
Refactor user and credential handling: rename Creds to User, update d…
This commit is contained in:
+1
-8
@@ -239,24 +239,17 @@ var (
|
|||||||
|
|
||||||
// Pretty Print Hunter.io Email Verification Result
|
// Pretty Print Hunter.io Email Verification Result
|
||||||
var (
|
var (
|
||||||
headers = []string{"Email", "Status", "Result", "Score", "Regexp", "Gibberish", "Disposable", "Webmail", "MX Records", "SMTP Server", "SMTP Check", "Accept All", "Block", "Sources"}
|
headers = []string{"Email", "Result", "Score", "Disposable", "MX Records", "SMTP Server", "SMTP Check"}
|
||||||
rows [][]string
|
rows [][]string
|
||||||
)
|
)
|
||||||
rows = append(rows, []string{
|
rows = append(rows, []string{
|
||||||
result.Email,
|
result.Email,
|
||||||
result.Status,
|
|
||||||
result.Result,
|
result.Result,
|
||||||
fmt.Sprintf("%d", result.Score),
|
fmt.Sprintf("%d", result.Score),
|
||||||
fmt.Sprintf("%t", result.Regexp),
|
|
||||||
fmt.Sprintf("%t", result.Gibberish),
|
|
||||||
fmt.Sprintf("%t", result.Disposable),
|
fmt.Sprintf("%t", result.Disposable),
|
||||||
fmt.Sprintf("%t", result.Webmail),
|
|
||||||
fmt.Sprintf("%t", result.MXRecords),
|
fmt.Sprintf("%t", result.MXRecords),
|
||||||
fmt.Sprintf("%t", result.SMTPServer),
|
fmt.Sprintf("%t", result.SMTPServer),
|
||||||
fmt.Sprintf("%t", result.SMTPCheck),
|
fmt.Sprintf("%t", result.SMTPCheck),
|
||||||
fmt.Sprintf("%t", result.AcceptAll),
|
|
||||||
fmt.Sprintf("%t", result.Block),
|
|
||||||
fmt.Sprintf("%v", result.Sources),
|
|
||||||
})
|
})
|
||||||
|
|
||||||
fmt.Println("Email Verification Result:")
|
fmt.Println("Email Verification Result:")
|
||||||
|
|||||||
+3
-2
@@ -26,7 +26,7 @@ func init() {
|
|||||||
queryCmd.Flags().StringVarP(&dbQueryRawQuery, "raw-query", "r", "", "Raw SQL query to execute")
|
queryCmd.Flags().StringVarP(&dbQueryRawQuery, "raw-query", "r", "", "Raw SQL query to execute")
|
||||||
queryCmd.Flags().BoolVarP(&dbQueryListAll, "list-all", "a", false, "List all tables and their columns")
|
queryCmd.Flags().BoolVarP(&dbQueryListAll, "list-all", "a", false, "List all tables and their columns")
|
||||||
queryCmd.Flags().StringVarP(&dbQueryFormat, "format", "f", "json", "Output format (json, yaml, xml, txt)")
|
queryCmd.Flags().StringVarP(&dbQueryFormat, "format", "f", "json", "Output format (json, yaml, xml, txt)")
|
||||||
queryCmd.Flags().StringVarP(&dbQueryFile, "file", "o", "query", "File to output results to including extension")
|
queryCmd.Flags().StringVarP(&dbQueryFile, "file", "o", "query", "File to output results to")
|
||||||
|
|
||||||
// Add mutually exclusive flags to query and raw-query
|
// Add mutually exclusive flags to query and raw-query
|
||||||
// Cannot use query and raw-query at the same time
|
// Cannot use query and raw-query at the same time
|
||||||
@@ -51,7 +51,8 @@ var (
|
|||||||
queryCmd = &cobra.Command{
|
queryCmd = &cobra.Command{
|
||||||
Use: "query",
|
Use: "query",
|
||||||
Short: "Query the database",
|
Short: "Query the database",
|
||||||
Long: `Query the database for various information.`,
|
Long: `Query the database for various information.
|
||||||
|
If file is specified, results are written to file and not displayed in the terminal.`,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
// If list-all flag is set, list all tables and columns
|
// If list-all flag is set, list all tables and columns
|
||||||
if dbQueryListAll {
|
if dbQueryListAll {
|
||||||
|
|||||||
@@ -255,25 +255,25 @@ func (dh *Dehasher) parseResults() {
|
|||||||
debug.PrintInfo("printing results table")
|
debug.PrintInfo("printing results table")
|
||||||
}
|
}
|
||||||
|
|
||||||
headers = []string{"Name", "Email", "Username", "Password", "Address", "Phone", "Social", "Crypto Address", "Company"}
|
headers = []string{"Email", "Username", "Password", "Phone", "Company"}
|
||||||
if len(results.Results) > 50 {
|
if len(results.Results) > 50 {
|
||||||
fmt.Println(" [-] Large number of results recovered, displaying first 50...")
|
fmt.Println(" [-] Large number of results recovered, displaying first 50...")
|
||||||
for i := 0; i < 50; i++ {
|
for i := 0; i < 50; i++ {
|
||||||
r := results.Results[i]
|
r := results.Results[i]
|
||||||
rows = append(rows, []string{
|
rows = append(rows, []string{
|
||||||
strings.Join(r.Name, ", "), strings.Join(r.Email, ", "),
|
strings.Join(r.Email, ", "),
|
||||||
strings.Join(r.Username, ", "), strings.Join(r.Password, ", "),
|
strings.Join(r.Username, ", "),
|
||||||
strings.Join(r.Address, ", "), strings.Join(r.Phone, ", "),
|
strings.Join(r.Password, ", "),
|
||||||
strings.Join(r.Social, ", "), strings.Join(r.CryptoCurrencyAddress, ", "),
|
strings.Join(r.Phone, ", "),
|
||||||
strings.Join(r.Company, ", ")})
|
strings.Join(r.Company, ", ")})
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for _, r := range results.Results {
|
for _, r := range results.Results {
|
||||||
rows = append(rows, []string{
|
rows = append(rows, []string{
|
||||||
strings.Join(r.Name, ", "), strings.Join(r.Email, ", "),
|
strings.Join(r.Email, ", "),
|
||||||
strings.Join(r.Username, ", "), strings.Join(r.Password, ", "),
|
strings.Join(r.Username, ", "),
|
||||||
strings.Join(r.Address, ", "), strings.Join(r.Phone, ", "),
|
strings.Join(r.Password, ", "),
|
||||||
strings.Join(r.Social, ", "), strings.Join(r.CryptoCurrencyAddress, ", "),
|
strings.Join(r.Phone, ", "),
|
||||||
strings.Join(r.Company, ", ")})
|
strings.Join(r.Company, ", ")})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user