Skip to content

Commit

Permalink
add daydaymap
Browse files Browse the repository at this point in the history
  • Loading branch information
wjlin0 committed May 15, 2024
1 parent 242e31f commit 2bbf8b0
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 40 deletions.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ uncover -h
This will display help for the tool. Here are all the flags it supports:

```console
quickly discover exposed assets on the internet using multiple search engines.

Usage:
uncover [flags]

Flags:
INPUT:
-q, -query string[] search query, supports: stdin,file,config input (example: -q 'example query', -q 'query.txt')
-e, -engine string[] search engine to query [shodan censys fofa quake hunter zoomeye netlas criminalip publicwww hunterhow binaryedge github fullhunt zone0 shodan-idb anubis-spider sitedossier-spider fofa-spider bing-spider chinaz-spider google-spider ip138-spider qianxun-spider rapiddns-spider baidu-spider yahoo-spider] (default fofa)
-e, -engine string[] search engine to query [shodan censys fofa quake hunter zoomeye netlas criminalip publicwww hunterhow binaryedge github fullhunt zone0 daydaymap shodan-idb anubis-spider sitedossier-spider fofa-spider bing-spider chinaz-spider google-spider ip138-spider qianxun-spider rapiddns-spider baidu-spider yahoo-spider zoomeye-spider] (default fofa)

SEARCH-ENGINE:
-s, -shodan string[] search query for shodan (example: -shodan 'query.txt')
Expand All @@ -92,6 +94,7 @@ SEARCH-ENGINE:
-ne, -netlas string[] search query for netlas (example: -netlas 'query.txt')
-be, -binaryedge string[] search query for binaryedge (example: -binaryedge 'query.txt')
-z0, -zone0 string[] search query for zone0 (example: -zone0 'query.txt')
-ddm, -daydaymap string[] search query for daydaymap (example: -daydaymap 'query.txt')
-cl, -criminalip string[] search query for criminalip (example: -criminalip 'query.txt')
-pw, -publicwww string[] search query for publicwww (example: -publicwww 'query.txt')
-hh, -hunterhow string[] search query for hunterhow (example: -hunterhow 'query.txt')
Expand All @@ -108,6 +111,7 @@ SEARCH-ENGINE:
-as, -anubis-spider string[] search query for anubis-spider (example: -anubis-spider 'query.txt')
-bus, -baidu-spider string[] search query for baidu-spider (example: -baidu-spider 'query.txt')
-ys, -yahoo-spider string[] search query for yahoo-spider (example: -yahoo-spider 'query.txt')
-zes, -zoomeye-spider string[] search query for zoomeye-spider (example: -zoomeye-spider 'query.txt')

CONFIG:
-pc, -provider string provider configuration file (default "/Users/wjl/.config/uncover/provider-config.yaml")
Expand All @@ -132,9 +136,12 @@ OUTPUT:
-nc, -no-color disable colors in output

DEBUG:
-silent show only results in output
-version show version of the project
-v show verbose output
-silent show only results in output
-version show version of the project
-da, -destruct-agent show destruct agent
-v show verbose output


```

## Using uncover as library
Expand Down Expand Up @@ -191,6 +198,9 @@ binaryedge:
zone0:
- ZONE0_API_KEY_1
- ZONE0_API_KEY_2
daydaymap:
- DAYDAYMAP_API_KEY_1
- DAYDAYMAP_API_KEY_2
```
When multiple keys/credentials are specified for same provider in the config file, random key will be used for each execution.
Expand All @@ -214,6 +224,7 @@ export HUNTERHOW_API_KEY=xxx
export PUBLICWWW_API_KEY=xxx
export CRIMINALIP_API_KEY=xxx
export ZOOE0_API_KEY=xxx
export DAYDAYMAP_API_KEY=xxx
```

Required API keys can be obtained by signing up on following platform [Shodan](https://account.shodan.io/register), [Censys](https://censys.io/register), [Fofa](https://fofa.info/toLogin), [Quake](https://quake.360.net/quake/#/index), [Hunter](https://user.skyeye.qianxin.com/user/register?next=https%3A//hunter.qianxin.com/api/uLogin&fromLogin=1), [ZoomEye](https://www.zoomeye.org/login), [Netlas](https://app.netlas.io/registration/), [CriminalIP](https://www.criminalip.io/register), [Publicwww](https://publicwww.com/profile/signup.html) and [binary](https://app.binaryedge.io/login)
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ require (
github.com/projectdiscovery/ratelimit v0.0.19
github.com/projectdiscovery/retryablehttp-go v1.0.52
github.com/projectdiscovery/utils v0.0.84
github.com/remeh/sizedwaitgroup v1.0.0
github.com/stretchr/testify v1.9.0
github.com/tj/go-update v2.2.5-0.20200519121640-62b4b798fd68+incompatible
golang.org/x/net v0.21.0
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,6 @@ github.com/quic-go/quic-go v0.38.1 h1:M36YWA5dEhEeT+slOu/SwMEucbYd0YFidxG3KlGPZa
github.com/quic-go/quic-go v0.38.1/go.mod h1:ijnZM7JsFIkp4cRyjxJNIzdSfCLmUMg9wdyhGmg+SN4=
github.com/refraction-networking/utls v1.5.4 h1:9k6EO2b8TaOGsQ7Pl7p9w6PUhx18/ZCeT0WNTZ7Uw4o=
github.com/refraction-networking/utls v1.5.4/go.mod h1:SPuDbBmgLGp8s+HLNc83FuavwZCFoMmExj+ltUHiHUw=
github.com/remeh/sizedwaitgroup v1.0.0 h1:VNGGFwNo/R5+MJBf6yrsr110p0m4/OX4S3DCy7Kyl5E=
github.com/remeh/sizedwaitgroup v1.0.0/go.mod h1:3j2R4OIe/SeS6YDhICBy22RWjJC5eNCJ1V+9+NVNYlo=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
Expand Down
57 changes: 29 additions & 28 deletions integration-tests/integration-test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,38 +20,39 @@ var (

tests = map[string]testutils.TestCase{
// source tests
"zoomeye": zoomeyeTestcases{},
"fofa": fofaTestcases{},
"hunter": hunterTestcases{},
"quake": quakeTestcases{},
"binaryedge": binaryTestcases{},
"github": githubTestcases{},
"publicwww": publicwwwTestcases{},
"netlas": netlasTestcases{},
"censys": censysTestcases{},
"shodan": shodanTestcases{},
"criminalip": criminalipTestcases{},
"hunterhow": hunterhowTestcases{},
"fullhunt": fullhuntTestcases{},
"zone0": zone0Testcases{},
//"zoomeye": zoomeyeTestcases{},
//"fofa": fofaTestcases{},
//"hunter": hunterTestcases{},
//"quake": quakeTestcases{},
//"binaryedge": binaryTestcases{},
//"github": githubTestcases{},
//"publicwww": publicwwwTestcases{},
//"netlas": netlasTestcases{},
//"censys": censysTestcases{},
//"shodan": shodanTestcases{},
//"criminalip": criminalipTestcases{},
//"hunterhow": hunterhowTestcases{},
//"fullhunt": fullhuntTestcases{},
//"zone0": zone0Testcases{},
"daydaymap": daydaymapTestcases{},

//spider tests
"shodan-idb": shodanidbTestcases{},
"fofa-spider": fofaSpiderTestcases{},
"chinaz-spider": chinazSpiderTestcases{},
"google-spider": googleSpiderTestcases{},
"ip138-spider": ip138SpiderTestcases{},
"anubis-spider": anubisSpiderTestcases{},
"sitedossier-spider": sitedossierSpiderTestcases{},
"bing-spider": bingSpiderTestcases{},
//"qianxun-spider": qianxunSpiderTestcases{},
"rapiddns-spider": rapiddnsSpiderTestcases{},
"baidu-spider": baiduSpiderTestcases{},
"yahoo-spider": yahooSpiderTestcases{},
"zoomeye-spider": zoomeyeSpiderTestcases{},
//"shodan-idb": shodanidbTestcases{},
//"fofa-spider": fofaSpiderTestcases{},
//"chinaz-spider": chinazSpiderTestcases{},
//"google-spider": googleSpiderTestcases{},
//"ip138-spider": ip138SpiderTestcases{},
//"anubis-spider": anubisSpiderTestcases{},
//"sitedossier-spider": sitedossierSpiderTestcases{},
//"bing-spider": bingSpiderTestcases{},
////"qianxun-spider": qianxunSpiderTestcases{},
//"rapiddns-spider": rapiddnsSpiderTestcases{},
//"baidu-spider": baiduSpiderTestcases{},
//"yahoo-spider": yahooSpiderTestcases{},
//"zoomeye-spider": zoomeyeSpiderTestcases{},

//feature tests
"output": outputTestcases{},
//"output": outputTestcases{},
}
)

Expand Down
10 changes: 10 additions & 0 deletions integration-tests/source-test.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,3 +428,13 @@ func (z zoomeyeSpiderTestcases) Execute() error {
}
return expectResultsGreaterThanCount(results, 0)
}

type daydaymapTestcases struct{}

func (d daydaymapTestcases) Execute() error {
results, err := testutils.RunUncoverAndGetResults(debug, "-daydaymap", "'domain=\"baidu.com\"'")
if err != nil {
return err
}
return expectResultsGreaterThanCount(results, 0)
}
2 changes: 1 addition & 1 deletion runner/banners.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const banner = `
`

// Version is the current version of uncover
const version = `v1.1.2`
const version = `v1.1.3`

// showBanner is used to show the banner to the user
func showBanner() {
Expand Down
6 changes: 6 additions & 0 deletions runner/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ type Options struct {
FoFaSpider goflags.StringSlice
Binaryedge goflags.StringSlice
Zone goflags.StringSlice
DayDayMap goflags.StringSlice
GoogleSpider goflags.StringSlice
BingSpider goflags.StringSlice
ChinazSpider goflags.StringSlice
Expand Down Expand Up @@ -100,6 +101,7 @@ func ParseOptions() *Options {
flagSet.StringSliceVarP(&options.Netlas, "netlas", "ne", nil, "search query for netlas (example: -netlas 'query.txt')", goflags.FileStringSliceOptions),
flagSet.StringSliceVarP(&options.Binaryedge, "binaryedge", "be", nil, "search query for binaryedge (example: -binaryedge 'query.txt')", goflags.FileStringSliceOptions),
flagSet.StringSliceVarP(&options.Zone, "zone0", "z0", nil, "search query for zone0 (example: -zone0 'query.txt')", goflags.FileStringSliceOptions),
flagSet.StringSliceVarP(&options.DayDayMap, "daydaymap", "ddm", nil, "search query for daydaymap (example: -daydaymap 'query.txt')", goflags.FileStringSliceOptions),
flagSet.StringSliceVarP(&options.CriminalIP, "criminalip", "cl", nil, "search query for criminalip (example: -criminalip 'query.txt')", goflags.FileStringSliceOptions),
flagSet.StringSliceVarP(&options.Publicwww, "publicwww", "pw", nil, "search query for publicwww (example: -publicwww 'query.txt')", goflags.FileStringSliceOptions),
flagSet.StringSliceVarP(&options.HunterHow, "hunterhow", "hh", nil, "search query for hunterhow (example: -hunterhow 'query.txt')", goflags.FileStringSliceOptions),
Expand Down Expand Up @@ -194,6 +196,7 @@ func ParseOptions() *Options {
len(options.HunterHow),
len(options.Github),
len(options.FullHunt),
len(options.DayDayMap),
len(options.FoFaSpider),
len(options.GoogleSpider),
len(options.BingSpider),
Expand Down Expand Up @@ -272,6 +275,7 @@ func (options *Options) validateOptions() error {
len(options.HunterHow),
len(options.Github),
len(options.FullHunt),
len(options.DayDayMap),
len(options.FoFaSpider),
len(options.GoogleSpider),
len(options.BingSpider),
Expand Down Expand Up @@ -306,6 +310,7 @@ func (options *Options) validateOptions() error {
len(options.Netlas),
len(options.Binaryedge),
len(options.Zone),
len(options.DayDayMap),
len(options.CriminalIP),
len(options.Publicwww),
len(options.HunterHow),
Expand Down Expand Up @@ -363,6 +368,7 @@ func appendAllQueries(options *Options) {
appendQuery(options, "github", options.Github...)
appendQuery(options, "zone0", options.Zone...)
appendQuery(options, "fullhunt", options.FullHunt...)
appendQuery(options, "daydaymap", options.DayDayMap...)
appendQuery(options, "fofa-spider", options.FoFaSpider...)
appendQuery(options, "google-spider", options.GoogleSpider...)
appendQuery(options, "bing-spider", options.BingSpider...)
Expand Down
4 changes: 3 additions & 1 deletion sources/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type Keys struct {
GithubToken string
FullHuntToken string
Zone0Token string
DayDayMapToken string
}

func (keys Keys) Empty() bool {
Expand All @@ -35,5 +36,6 @@ func (keys Keys) Empty() bool {
keys.BinaryedgeToken == "" &&
keys.GithubToken == "" &&
keys.FullHuntToken == "" &&
keys.Zone0Token == ""
keys.Zone0Token == "" &&
keys.DayDayMapToken == ""
}
6 changes: 6 additions & 0 deletions sources/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type Provider struct {
Github []string `yaml:"github"`
FullHunt []string `json:"fullhunt"`
Zone0 []string `json:"zone0"`
DayDayMap []string `json:"daydaymap"`
}

// NewProvider loads provider keys from default location and env variables
Expand Down Expand Up @@ -115,6 +116,9 @@ func (provider *Provider) GetKeys() Keys {
if len(provider.Zone0) > 0 {
keys.Zone0Token = provider.Zone0[rand.Intn(len(provider.Zone0))]
}
if len(provider.DayDayMap) > 0 {
keys.DayDayMapToken = provider.DayDayMap[rand.Intn(len(provider.DayDayMap))]
}
return keys
}

Expand Down Expand Up @@ -158,6 +162,7 @@ func (provider *Provider) LoadProviderKeysFromEnv() {
}
provider.Fofa = appendIfAllExists(provider.Fofa, "FOFA_EMAIL", "FOFA_KEY")
provider.Censys = appendIfAllExists(provider.Censys, "CENSYS_API_ID", "CENSYS_API_SECRET")
provider.DayDayMap = appendIfExists(provider.DayDayMap, "DAYDAYMAP_API_KEY")
}

// HasKeys returns true if at least one agent/source has keys
Expand All @@ -176,6 +181,7 @@ func (provider *Provider) HasKeys() bool {
len(provider.Github) > 0,
len(provider.FullHunt) > 0,
len(provider.Zone0) > 0,
len(provider.DayDayMap) > 0,
)
}

Expand Down
1 change: 1 addition & 0 deletions sources/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var DefaultRateLimits = map[string]*ratelimit.Options{
"binaryedge": {Key: "binaryedge", MaxCount: 1, Duration: time.Second},
"fullhunt": {Key: "fullhunt", MaxCount: 1, Duration: time.Second},
"zone0": {Key: "zone0", MaxCount: 1, Duration: time.Second},
"daydaymap": {Key: "daydaymap", MaxCount: 1, Duration: time.Second},
"fofa-spider": {Key: "fofa-spider", MaxCount: 5, Duration: time.Second},
"bing-spider": {Key: "bing-spider", MaxCount: 1, Duration: time.Second},
"google-spider": {Key: "google-spider", MaxCount: 1, Duration: time.Second},
Expand Down
9 changes: 6 additions & 3 deletions uncover.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/wjlin0/uncover/sources/agent/binaryedge"
bing_spider "github.com/wjlin0/uncover/sources/agent/bing-spider"
chinaz_spider "github.com/wjlin0/uncover/sources/agent/chinaz-spider"
"github.com/wjlin0/uncover/sources/agent/daydaymap"
fofa_spider "github.com/wjlin0/uncover/sources/agent/fofa-spider"
"github.com/wjlin0/uncover/sources/agent/fullhunt"
"github.com/wjlin0/uncover/sources/agent/github"
Expand Down Expand Up @@ -101,6 +102,8 @@ func New(opts *Options) (*Service, error) {
s.Agents = append(s.Agents, &binaryedge.Agent{})
case "zone0":
s.Agents = append(s.Agents, &zone0.Agent{})
case "daydaymap":
s.Agents = append(s.Agents, &daydaymap.Agent{})
case "github":
s.Agents = append(s.Agents, &github.Agent{})
case "fullhunt":
Expand Down Expand Up @@ -240,7 +243,7 @@ func (s *Service) ExecuteWithCallback(ctx context.Context, callback func(result
// AllAgents returns all supported uncover Agents
func (s *Service) AllAgents() []string {
return []string{
"shodan", "censys", "fofa", "quake", "hunter", "zoomeye", "netlas", "criminalip", "publicwww", "hunterhow", "binaryedge", "github", "fullhunt", "zone0",
"shodan", "censys", "fofa", "quake", "hunter", "zoomeye", "netlas", "criminalip", "publicwww", "hunterhow", "binaryedge", "github", "fullhunt", "zone0", "daydaymap",
"shodan-idb", "anubis-spider", "sitedossier-spider", "fofa-spider", "google-spider", "bing-spider", "chinaz-spider", "ip138-spider", "qianxun-spider", "rapiddns-spider", "baidu-spider", "yahoo-spider", "zoomeye-spider",
}
}
Expand All @@ -251,7 +254,7 @@ func DestructAgents() []string {
}
func UncoverAgents() []string {
return []string{
"shodan", "censys", "fofa", "quake", "hunter", "zoomeye", "netlas", "criminalip", "publicwww", "hunterhow", "binaryedge", "github", "fullhunt", "zone0",
"shodan", "censys", "fofa", "quake", "hunter", "zoomeye", "netlas", "criminalip", "publicwww", "hunterhow", "binaryedge", "github", "fullhunt", "zone0", "daydaymap",
}
}
func AnonymousAgents() []string {
Expand Down Expand Up @@ -284,7 +287,7 @@ func (s *Service) hasAnyAnonymousProvider() bool {
}
func AllAgents() []string {
return []string{
"shodan", "censys", "fofa", "quake", "hunter", "zoomeye", "netlas", "criminalip", "publicwww", "hunterhow", "binaryedge", "github", "fullhunt", "zone0",
"shodan", "censys", "fofa", "quake", "hunter", "zoomeye", "netlas", "criminalip", "publicwww", "hunterhow", "binaryedge", "github", "fullhunt", "zone0", "daydaymap",
"shodan-idb", "anubis-spider", "sitedossier-spider", "fofa-spider", "bing-spider", "chinaz-spider", "google-spider", "ip138-spider", "qianxun-spider", "rapiddns-spider", "baidu-spider", "yahoo-spider", "zoomeye-spider",
}
}
Expand Down

0 comments on commit 2bbf8b0

Please sign in to comment.