From e3e60d0ba8cee1fcdd07992756c174621323757c Mon Sep 17 00:00:00 2001 From: Alexandre ZANNI <16578570+noraj@users.noreply.github.com> Date: Mon, 20 Feb 2023 19:53:11 +0100 Subject: [PATCH] uncover: add criminalip support (#3162) * update uncover engine options * add criminalip support * update criminalIP variable --------- Co-authored-by: Sandeep Singh Co-authored-by: shubhamrasal --- README.md | 2 +- v2/pkg/protocols/common/uncover/uncover.go | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 57f7c39d3..4a0845163 100644 --- a/README.md +++ b/README.md @@ -203,7 +203,7 @@ INTERACTSH: UNCOVER: -uc, -uncover enable uncover engine -uq, -uncover-query string[] uncover search query - -ue, -uncover-engine string[] uncover search engine (shodan,shodan-idb,fofa,censys,quake,hunter,zoomeye,netlas) (default shodan) + -ue, -uncover-engine string[] uncover search engine (shodan,shodan-idb,fofa,censys,quake,hunter,zoomeye,netlas,criminalip) (default shodan) -uf, -uncover-field string uncover fields to return (ip,port,host) (default "ip:port") -ul, -uncover-limit int uncover results to return (default 100) -ucd, -uncover-delay int delay between uncover query requests in seconds (0 to disable) (default 1) diff --git a/v2/pkg/protocols/common/uncover/uncover.go b/v2/pkg/protocols/common/uncover/uncover.go index b4a600495..812b32988 100644 --- a/v2/pkg/protocols/common/uncover/uncover.go +++ b/v2/pkg/protocols/common/uncover/uncover.go @@ -15,6 +15,7 @@ import ( ucRunner "github.com/projectdiscovery/uncover/runner" "github.com/projectdiscovery/uncover/uncover" "github.com/projectdiscovery/uncover/uncover/agent/censys" + "github.com/projectdiscovery/uncover/uncover/agent/criminalip" "github.com/projectdiscovery/uncover/uncover/agent/fofa" "github.com/projectdiscovery/uncover/uncover/agent/hunter" "github.com/projectdiscovery/uncover/uncover/agent/netlas" @@ -29,7 +30,7 @@ import ( const maxConcurrentAgents = 50 func GetUncoverSupportedAgents() string { - uncoverSupportedAgents := []string{"shodan", "shodan-idb", "fofa", "censys", "quake", "hunter", "zoomeye", "netlas"} + uncoverSupportedAgents := []string{"shodan", "shodan-idb", "fofa", "censys", "quake", "hunter", "zoomeye", "netlas", "criminalip"} return strings.Join(uncoverSupportedAgents, ",") } @@ -72,6 +73,8 @@ func GetUncoverTargetsFromMetadata(templates []*templates.Template, delay, limit eng = "zoomeye" case "netlas-query": eng = "netlas" + case "criminalip-query": + eng = "criminalip" default: continue } @@ -131,6 +134,8 @@ func getTargets(uncoverOptions *ucRunner.Options, field string) (chan string, er agent, err = zoomeye.NewWithOptions(&uncover.AgentOptions{RateLimiter: rateLimiter}) case "netlas": agent, err = netlas.NewWithOptions(&uncover.AgentOptions{RateLimiter: rateLimiter}) + case "criminalip": + agent, err = criminalip.NewWithOptions(&uncover.AgentOptions{RateLimiter: rateLimiter}) default: err = errors.Errorf("%s unknown uncover agent type", engine) } @@ -231,6 +236,12 @@ func loadKeys(engine string, options *ucRunner.Options) error { } else { return errors.Errorf("NETLAS_API_KEY env variable is not configured") } + case "criminalip": + if key, exists := os.LookupEnv("CRIMINALIP_API_KEY"); exists { + options.Provider.CriminalIP = append(options.Provider.CriminalIP, key) + } else { + return errors.Errorf("CRIMINALIP_API_KEY env variable is not configured") + } default: return errors.Errorf("unknown uncover agent") }