Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning for passivetotal #942

Merged
merged 4 commits into from
Sep 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions v2/pkg/passive/sources.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import (
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/whoisxmlapi"
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/zoomeye"
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/zoomeyeapi"
mapsutil "github.com/projectdiscovery/utils/maps"
)

var AllSources = [...]subscraping.Source{
Expand Down Expand Up @@ -93,6 +94,11 @@ var AllSources = [...]subscraping.Source{
// &reconcloud.Source{}, // failing due to cloudflare bot protection
}

var sourceWarnings = mapsutil.NewSyncLockMap[string, string](
mapsutil.WithMap(mapsutil.Map[string, string]{
"passivetotal": "New API credentials for PassiveTotal can't be generated, but existing user account credentials are still functional. Please ensure your integrations are using valid credentials.",
}))

var NameSourceMap = make(map[string]subscraping.Source, len(AllSources))

func init() {
Expand Down Expand Up @@ -148,6 +154,12 @@ func New(sourceNames, excludedSourceNames []string, useAllSources, useSourcesSup

gologger.Debug().Msgf(fmt.Sprintf("Selected source(s) for this search: %s", strings.Join(maps.Keys(sources), ", ")))

for _, currentSource := range sources {
if warning, ok := sourceWarnings.Get(strings.ToLower(currentSource.Name())); ok {
gologger.Warning().Msg(warning)
}
}

// Create the agent, insert the sources and remove the excluded sources
agent := &Agent{sources: maps.Values(sources)}

Expand Down