mirror of
https://github.com/anotherhadi/iknowyou.git
synced 2026-04-12 00:47:26 +02:00
init
This commit is contained in:
55
back/internal/tools/gravatar-recon/tool.go
Normal file
55
back/internal/tools/gravatar-recon/tool.go
Normal file
@@ -0,0 +1,55 @@
|
||||
package gravatarrecon
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os/exec"
|
||||
|
||||
"github.com/anotherhadi/iknowyou/internal/tools"
|
||||
)
|
||||
|
||||
const (
|
||||
name = "gravatar-recon"
|
||||
description = "Gravatar OSINT tool. Extracts public profile data from a Gravatar account: name, bio, location, employment, social accounts, phone, and more."
|
||||
link = "https://github.com/anotherhadi/gravatar-recon"
|
||||
icon = ""
|
||||
)
|
||||
|
||||
type Runner struct{}
|
||||
|
||||
func New() tools.ToolRunner { return &Runner{} }
|
||||
|
||||
func (r *Runner) Name() string { return name }
|
||||
func (r *Runner) Description() string { return description }
|
||||
func (r *Runner) Link() string { return link }
|
||||
func (r *Runner) Icon() string { return icon }
|
||||
|
||||
func (r *Runner) InputTypes() []tools.InputType {
|
||||
return []tools.InputType{tools.InputTypeEmail}
|
||||
}
|
||||
|
||||
func (r *Runner) Available() (bool, string) {
|
||||
if _, err := exec.LookPath("gravatar-recon"); err != nil {
|
||||
return false, "gravatar-recon binary not found in PATH"
|
||||
}
|
||||
return true, ""
|
||||
}
|
||||
|
||||
func (r *Runner) Dependencies() []string { return []string{"gravatar-recon"} }
|
||||
|
||||
func (r *Runner) Run(ctx context.Context, target string, _ tools.InputType, out chan<- tools.Event) error {
|
||||
defer close(out)
|
||||
|
||||
cmd := exec.CommandContext(ctx, "gravatar-recon", "--silent", target)
|
||||
output, err := tools.RunWithPTY(ctx, cmd)
|
||||
|
||||
count := 0
|
||||
if err != nil && ctx.Err() != nil {
|
||||
out <- tools.Event{Tool: name, Type: tools.EventTypeError, Payload: "scan cancelled"}
|
||||
} else if output != "" {
|
||||
out <- tools.Event{Tool: name, Type: tools.EventTypeOutput, Payload: output}
|
||||
count = 1
|
||||
}
|
||||
out <- tools.Event{Tool: name, Type: tools.EventTypeCount, Payload: count}
|
||||
out <- tools.Event{Tool: name, Type: tools.EventTypeDone}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user