Skip to content

Commit 0d34c55

Browse files
Merge pull request #1549 from projectdiscovery/dev
v2.7.0
2 parents eaefdec + aa7fd52 commit 0d34c55

File tree

15 files changed

+312
-175
lines changed

15 files changed

+312
-175
lines changed

.github/workflows/build-test.yml

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ jobs:
5151
HUNTER_API_KEY: ${{secrets.HUNTER_API_KEY}}
5252
INTELX_API_KEY: ${{secrets.INTELX_API_KEY}}
5353
LEAKIX_API_KEY: ${{secrets.LEAKIX_API_KEY}}
54-
PASSIVETOTAL_API_KEY: ${{secrets.PASSIVETOTAL_API_KEY}}
5554
QUAKE_API_KEY: ${{secrets.QUAKE_API_KEY}}
5655
ROBTEX_API_KEY: ${{secrets.ROBTEX_API_KEY}}
5756
SECURITYTRAILS_API_KEY: ${{secrets.SECURITYTRAILS_API_KEY}}

v2/go.mod

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ require (
88
github.com/json-iterator/go v1.1.12
99
github.com/lib/pq v1.10.9
1010
github.com/projectdiscovery/chaos-client v0.5.2
11-
github.com/projectdiscovery/dnsx v1.2.1
11+
github.com/projectdiscovery/dnsx v1.2.2
1212
github.com/projectdiscovery/fdmax v0.0.4
13-
github.com/projectdiscovery/gologger v1.1.40
14-
github.com/projectdiscovery/ratelimit v0.0.68
15-
github.com/projectdiscovery/retryablehttp-go v1.0.95
16-
github.com/projectdiscovery/utils v0.4.6
13+
github.com/projectdiscovery/gologger v1.1.44
14+
github.com/projectdiscovery/ratelimit v0.0.70
15+
github.com/projectdiscovery/retryablehttp-go v1.0.99
16+
github.com/projectdiscovery/utils v0.4.11
1717
github.com/rs/xid v1.5.0
1818
github.com/stretchr/testify v1.9.0
1919
github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80
@@ -71,10 +71,10 @@ require (
7171
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
7272
github.com/projectdiscovery/blackrock v0.0.1 // indirect
7373
github.com/projectdiscovery/cdncheck v1.1.0 // indirect
74-
github.com/projectdiscovery/fastdialer v0.2.14 // indirect
75-
github.com/projectdiscovery/hmap v0.0.74 // indirect
74+
github.com/projectdiscovery/fastdialer v0.3.0 // indirect
75+
github.com/projectdiscovery/hmap v0.0.80 // indirect
7676
github.com/projectdiscovery/machineid v0.0.0-20240226150047-2e2c51e35983 // indirect
77-
github.com/projectdiscovery/networkpolicy v0.0.9 // indirect
77+
github.com/projectdiscovery/networkpolicy v0.1.1 // indirect
7878
github.com/refraction-networking/utls v1.6.7 // indirect
7979
github.com/rivo/uniseg v0.4.7 // indirect
8080
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d // indirect
@@ -124,8 +124,8 @@ require (
124124
github.com/modern-go/reflect2 v1.0.2 // indirect
125125
github.com/pkg/errors v0.9.1 // indirect
126126
github.com/pmezard/go-difflib v1.0.0 // indirect
127-
github.com/projectdiscovery/goflags v0.1.64
128-
github.com/projectdiscovery/retryabledns v1.0.93 // indirect
127+
github.com/projectdiscovery/goflags v0.1.72
128+
github.com/projectdiscovery/retryabledns v1.0.94 // indirect
129129
golang.org/x/net v0.33.0 // indirect
130130
golang.org/x/sys v0.28.0 // indirect
131131
)

v2/go.sum

+22-21
Original file line numberDiff line numberDiff line change
@@ -194,38 +194,39 @@ github.com/projectdiscovery/cdncheck v1.1.0 h1:qDITidmJsejzpk3rMkauCh6sjI2GH9hW/
194194
github.com/projectdiscovery/cdncheck v1.1.0/go.mod h1:sZ8U4MjHSsyaTVjBbYWHT1cwUVvUYwDX1W+WvWRicIc=
195195
github.com/projectdiscovery/chaos-client v0.5.2 h1:dN+7GXEypsJAbCD//dBcUxzAEAEH1fjc/7Rf4F/RiNU=
196196
github.com/projectdiscovery/chaos-client v0.5.2/go.mod h1:KnoJ/NJPhll42uaqlDga6oafFfNw5l2XI2ajRijtDuU=
197-
github.com/projectdiscovery/dnsx v1.2.1 h1:TxslYvp1Z/YZ4CP/J0gx5RYpvXREnVmyoacmTcGu5yg=
198-
github.com/projectdiscovery/dnsx v1.2.1/go.mod h1:6dAsMCEDu7FArZy2qjyTeUQrqpZ4ITLU11fcmUvFqt0=
199-
github.com/projectdiscovery/fastdialer v0.2.14 h1:/cndy+5celjoYzbk4LksHYOCTpFGIJY8RF/EK31Opjs=
200-
github.com/projectdiscovery/fastdialer v0.2.14/go.mod h1:z5yKQ/YWaVrBMfdL6f5J7VytUx9wxc5vs/Lf51QelCw=
197+
github.com/projectdiscovery/dnsx v1.2.2 h1:ZjUov0GOyrS8ERlKAAhk+AOkqzaYHBzCP0qZfO+6Ihg=
198+
github.com/projectdiscovery/dnsx v1.2.2/go.mod h1:3iYm86OEqo0WxeGDkVl5WZNmG0qYE5TYNx8fBg6wX1I=
199+
github.com/projectdiscovery/fastdialer v0.3.0 h1:/wMptjdsrAU/wiaA/U3lSgYGaYCGJH6xm0mLei6oMxk=
200+
github.com/projectdiscovery/fastdialer v0.3.0/go.mod h1:Q0YLArvpx9GAfY/NcTPMCA9qZuVOGnuVoNYWzKBwxdQ=
201201
github.com/projectdiscovery/fdmax v0.0.4 h1:K9tIl5MUZrEMzjvwn/G4drsHms2aufTn1xUdeVcmhmc=
202202
github.com/projectdiscovery/fdmax v0.0.4/go.mod h1:oZLqbhMuJ5FmcoaalOm31B1P4Vka/CqP50nWjgtSz+I=
203-
github.com/projectdiscovery/goflags v0.1.64 h1:FDfwdt9N97Hi8OuhbkDlKtVttpc/CRMIWQVa08VsHsI=
204-
github.com/projectdiscovery/goflags v0.1.64/go.mod h1:3FyHIVQtnycNOc1LE3O1jj/XR5XuMdF9QfHd0ujhnX4=
205-
github.com/projectdiscovery/gologger v1.1.40 h1:FSIhKnYKzuIEIz3RTg6JX9JtDKgkEzIEf2v5RYckoQ4=
206-
github.com/projectdiscovery/gologger v1.1.40/go.mod h1:8AUxYXmClqOWJgZ5wknNn5rRK3UlrXQ/r9JjX+gp5Gg=
207-
github.com/projectdiscovery/hmap v0.0.74 h1:j0TpS9fJxisfdGcIRjaZ3qgyjP3pBkRJf12ZWv64rOI=
208-
github.com/projectdiscovery/hmap v0.0.74/go.mod h1:qEPAdq/gWQU/IEI+QMzSyL+HYdqayR64V9vGTI/W38c=
203+
github.com/projectdiscovery/goflags v0.1.72 h1:tSR+BnfDLbfTGYYVg4k1oQcFOoYXPY1pllV0MHtx3ek=
204+
github.com/projectdiscovery/goflags v0.1.72/go.mod h1:C2cZ+PJRx7bbArEp/qFUixjsYFDd3etFNNHMUdJqfr8=
205+
github.com/projectdiscovery/gologger v1.1.44 h1:tprWkKzKt37pz4HG2tvhzrOCQNIn8A3CEki6BRzXE5o=
206+
github.com/projectdiscovery/gologger v1.1.44/go.mod h1:ZQS0eJq7BwKM0xxFqwZFUkAH1bkIqe90EOFBP4LENH4=
207+
github.com/projectdiscovery/hmap v0.0.80 h1:2PSo3qQNKanK6i6DF4NzsVEJANe6tMIBmBtxvF4AKK8=
208+
github.com/projectdiscovery/hmap v0.0.80/go.mod h1:YmZ9qwtl7MDJYrpxJ+MEw4N4V58w18WGPsQHgpdIV0s=
209209
github.com/projectdiscovery/machineid v0.0.0-20240226150047-2e2c51e35983 h1:ZScLodGSezQVwsQDtBSMFp72WDq0nNN+KE/5DHKY5QE=
210210
github.com/projectdiscovery/machineid v0.0.0-20240226150047-2e2c51e35983/go.mod h1:3G3BRKui7nMuDFAZKR/M2hiOLtaOmyukT20g88qRQjI=
211-
github.com/projectdiscovery/networkpolicy v0.0.9 h1:IrlDoYZagNNO8y+7iZeHT8k5izE+nek7TdtvEBwCxqk=
212-
github.com/projectdiscovery/networkpolicy v0.0.9/go.mod h1:XFJ2Lnv8BE/ziQCFjBHMsH1w6VmkPiQtk+NlBpdMU7M=
213-
github.com/projectdiscovery/ratelimit v0.0.68 h1:gMLD1aB4R8w7BIpKvtQf6TNb6+5zsJO9WSRWZ9pxwe4=
214-
github.com/projectdiscovery/ratelimit v0.0.68/go.mod h1:ieU9nNu9Ie8nVMKdj3bsX3JA3kfNI8qn4pkNXsyRxsw=
215-
github.com/projectdiscovery/retryabledns v1.0.93 h1:iKcEEEH77WwUf5EGimhHxCDdqBF2kOl7WhQi3VQXB8Q=
216-
github.com/projectdiscovery/retryabledns v1.0.93/go.mod h1:f5HmPdVr3CUm4tHHiB0UyiZVQTYYAKTqfoj8M2gCvqo=
217-
github.com/projectdiscovery/retryablehttp-go v1.0.95 h1:5CHhWLMovX1MD9W3HzlsMBY3xA+dyeqta2gSWo3j92E=
218-
github.com/projectdiscovery/retryablehttp-go v1.0.95/go.mod h1:/7CHaD7vqnqBD++AI0JsJdcYyq1Wbf4vMhddjy7sZjI=
219-
github.com/projectdiscovery/utils v0.4.6 h1:lwbS5d/f70wyDwuwF6lAVkn390hEI/0LOtqyqJEI+qE=
220-
github.com/projectdiscovery/utils v0.4.6/go.mod h1:eevtW7+x7ydrBdmOenmHdqqJKRv3VqY2QUR7vs4qRfU=
211+
github.com/projectdiscovery/networkpolicy v0.1.1 h1:iv9gECukD5KAZp98KVh+T3TEPTkY6dr3sKsdbh9XyZU=
212+
github.com/projectdiscovery/networkpolicy v0.1.1/go.mod h1:/Hg2ieLewSe/BagFF+UYXAQo3NwmVMq16MSAl492XkU=
213+
github.com/projectdiscovery/ratelimit v0.0.70 h1:SxFQcIKO3hppmEn9MOaDiqX2NXceji0vd8ER+eCHQjc=
214+
github.com/projectdiscovery/ratelimit v0.0.70/go.mod h1:jg253i7eeKBIV5QpTpQv6+lZXr53XmKGBLS3dwlmRWM=
215+
github.com/projectdiscovery/retryabledns v1.0.94 h1:MvxtRcmvxhxikxT7p/E40hcYRWRiL5fg/JQ8bpBaz+0=
216+
github.com/projectdiscovery/retryabledns v1.0.94/go.mod h1:croGTyMM4yNlrSWA/X7xNe3c0c7mDmCdbm8goLd8Bak=
217+
github.com/projectdiscovery/retryablehttp-go v1.0.99 h1:S+lQqo1ZnO5aoWsBV8HapGslJSaYVUII954SnH1RSjw=
218+
github.com/projectdiscovery/retryablehttp-go v1.0.99/go.mod h1:8Mv9L9vjmam16garE6/dqLFkT0ZcfLNSo9O1zFBiPlE=
219+
github.com/projectdiscovery/utils v0.4.11 h1:MWqCFxYINQPa4KWMRNah7W0N1COGRhqOpGVhiR/VaO0=
220+
github.com/projectdiscovery/utils v0.4.11/go.mod h1:47tvqErksJELcxDBH8An2i9qvUe5E1qR7B72xxqiyqU=
221221
github.com/refraction-networking/utls v1.6.7 h1:zVJ7sP1dJx/WtVuITug3qYUq034cDq9B2MR1K67ULZM=
222222
github.com/refraction-networking/utls v1.6.7/go.mod h1:BC3O4vQzye5hqpmDTWUqi4P5DDhzJfkV1tdqtawQIH0=
223223
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
224224
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
225225
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
226226
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
227-
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
228227
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
228+
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
229+
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
229230
github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc=
230231
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
231232
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d h1:hrujxIzL1woJ7AwssoOcM/tq5JjjG2yYOc8odClEiXA=

v2/pkg/passive/sources.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import (
3434
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/intelx"
3535
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/leakix"
3636
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/netlas"
37-
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/passivetotal"
3837
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/quake"
3938
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/rapiddns"
4039
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/redhuntlabs"
@@ -43,10 +42,12 @@ import (
4342
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/shodan"
4443
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/sitedossier"
4544
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/threatbook"
45+
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/threatcrowd"
4646
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/virustotal"
4747
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/waybackarchive"
4848
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/whoisxmlapi"
4949
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/zoomeyeapi"
50+
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/digitalyama"
5051
mapsutil "github.com/projectdiscovery/utils/maps"
5152
)
5253

@@ -75,7 +76,6 @@ var AllSources = [...]subscraping.Source{
7576
&intelx.Source{},
7677
&netlas.Source{},
7778
&leakix.Source{},
78-
&passivetotal.Source{},
7979
&quake.Source{},
8080
&rapiddns.Source{},
8181
&redhuntlabs.Source{},
@@ -85,6 +85,7 @@ var AllSources = [...]subscraping.Source{
8585
&shodan.Source{},
8686
&sitedossier.Source{},
8787
&threatbook.Source{},
88+
&threatcrowd.Source{},
8889
&virustotal.Source{},
8990
&waybackarchive.Source{},
9091
&whoisxmlapi.Source{},
@@ -94,12 +95,11 @@ var AllSources = [...]subscraping.Source{
9495
// &reconcloud.Source{}, // failing due to cloudflare bot protection
9596
&builtwith.Source{},
9697
&hudsonrock.Source{},
98+
&digitalyama.Source{},
9799
}
98100

99101
var sourceWarnings = mapsutil.NewSyncLockMap[string, string](
100-
mapsutil.WithMap(mapsutil.Map[string, string]{
101-
"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.",
102-
}))
102+
mapsutil.WithMap(mapsutil.Map[string, string]{}))
103103

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

v2/pkg/passive/sources_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ var (
3333
"hackertarget",
3434
"intelx",
3535
"netlas",
36-
"passivetotal",
3736
"quake",
3837
"rapiddns",
3938
"redhuntlabs",
@@ -43,6 +42,7 @@ var (
4342
"shodan",
4443
"sitedossier",
4544
"threatbook",
45+
"threatcrowd",
4646
"virustotal",
4747
"waybackarchive",
4848
"whoisxmlapi",
@@ -54,6 +54,7 @@ var (
5454
// "reconcloud",
5555
"builtwith",
5656
"hudsonrock",
57+
"digitalyama",
5758
}
5859

5960
expectedDefaultSources = []string{
@@ -74,7 +75,6 @@ var (
7475
"fullhunt",
7576
"hackertarget",
7677
"intelx",
77-
"passivetotal",
7878
"quake",
7979
"redhuntlabs",
8080
"robtex",
@@ -89,6 +89,7 @@ var (
8989
// "threatminer",
9090
// "reconcloud",
9191
"builtwith",
92+
"digitalyama",
9293
}
9394

9495
expectedDefaultRecursiveSources = []string{
@@ -100,7 +101,6 @@ var (
100101
"dnsdb",
101102
"digitorus",
102103
"hackertarget",
103-
"passivetotal",
104104
"securitytrails",
105105
"virustotal",
106106
"leakix",

v2/pkg/runner/banners.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const banner = `
1717
const ToolName = `subfinder`
1818

1919
// Version is the current version of subfinder
20-
const version = `v2.6.8`
20+
const version = `v2.7.0`
2121

2222
// showBanner is used to show the banner to the user
2323
func showBanner() {

v2/pkg/runner/enumerate.go

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
const maxNumCount = 2
2020

2121
var replacer = strings.NewReplacer(
22+
"/", "",
2223
"•.", "",
2324
"•", "",
2425
"*.", "",

v2/pkg/runner/runner.go

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ func (r *Runner) EnumerateMultipleDomainsWithCtx(ctx context.Context, reader io.
119119
ip, _ := regexp.Compile(`^([0-9\.]+$)`)
120120
for scanner.Scan() {
121121
domain := preprocessDomain(scanner.Text())
122+
domain = replacer.Replace(domain)
122123

123124
if domain == "" || (r.options.ExcludeIps && ip.MatchString(domain)) {
124125
continue

v2/pkg/subscraping/sources/anubis/anubis.go

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package anubis
44
import (
55
"context"
66
"fmt"
7+
"net/http"
78
"time"
89

910
jsoniter "github.com/json-iterator/go"
@@ -38,6 +39,11 @@ func (s *Source) Run(ctx context.Context, domain string, session *subscraping.Se
3839
return
3940
}
4041

42+
if resp.StatusCode != http.StatusOK {
43+
resp.Body.Close()
44+
return
45+
}
46+
4147
var subdomains []string
4248
err = jsoniter.NewDecoder(resp.Body).Decode(&subdomains)
4349
if err != nil {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
package digitalyama
2+
3+
import (
4+
"context"
5+
"fmt"
6+
"time"
7+
8+
jsoniter "github.com/json-iterator/go"
9+
10+
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping"
11+
)
12+
13+
// Source is the passive scraping agent
14+
type Source struct {
15+
apiKeys []string
16+
timeTaken time.Duration
17+
errors int
18+
results int
19+
skipped bool
20+
}
21+
22+
type digitalYamaResponse struct {
23+
Query string `json:"query"`
24+
Count int `json:"count"`
25+
Subdomains []string `json:"subdomains"`
26+
UsageSummary struct {
27+
QueryCost float64 `json:"query_cost"`
28+
CreditsRemaining float64 `json:"credits_remaining"`
29+
} `json:"usage_summary"`
30+
}
31+
32+
// Run function returns all subdomains found with the service
33+
func (s *Source) Run(ctx context.Context, domain string, session *subscraping.Session) <-chan subscraping.Result {
34+
results := make(chan subscraping.Result)
35+
s.errors = 0
36+
s.results = 0
37+
38+
go func() {
39+
defer func(startTime time.Time) {
40+
s.timeTaken = time.Since(startTime)
41+
close(results)
42+
}(time.Now())
43+
44+
randomApiKey := subscraping.PickRandom(s.apiKeys, s.Name())
45+
if randomApiKey == "" {
46+
s.skipped = true
47+
return
48+
}
49+
50+
searchURL := fmt.Sprintf("https://api.digitalyama.com/subdomain_finder?domain=%s", domain)
51+
resp, err := session.Get(ctx, searchURL, "", map[string]string{"x-api-key": randomApiKey})
52+
if err != nil {
53+
results <- subscraping.Result{Source: s.Name(), Type: subscraping.Error, Error: err}
54+
s.errors++
55+
return
56+
}
57+
defer resp.Body.Close()
58+
59+
if resp.StatusCode != 200 {
60+
var errResponse struct {
61+
Detail []struct {
62+
Loc []string `json:"loc"`
63+
Msg string `json:"msg"`
64+
Type string `json:"type"`
65+
} `json:"detail"`
66+
}
67+
err = jsoniter.NewDecoder(resp.Body).Decode(&errResponse)
68+
if err != nil {
69+
results <- subscraping.Result{Source: s.Name(), Type: subscraping.Error, Error: fmt.Errorf("unexpected status code %d", resp.StatusCode)}
70+
s.errors++
71+
return
72+
}
73+
if len(errResponse.Detail) > 0 {
74+
errMsg := errResponse.Detail[0].Msg
75+
results <- subscraping.Result{Source: s.Name(), Type: subscraping.Error, Error: fmt.Errorf("%s (code %d)", errMsg, resp.StatusCode)}
76+
} else {
77+
results <- subscraping.Result{Source: s.Name(), Type: subscraping.Error, Error: fmt.Errorf("unexpected status code %d", resp.StatusCode)}
78+
}
79+
s.errors++
80+
return
81+
}
82+
83+
var response digitalYamaResponse
84+
err = jsoniter.NewDecoder(resp.Body).Decode(&response)
85+
if err != nil {
86+
results <- subscraping.Result{Source: s.Name(), Type: subscraping.Error, Error: err}
87+
s.errors++
88+
return
89+
}
90+
91+
for _, subdomain := range response.Subdomains {
92+
results <- subscraping.Result{Source: s.Name(), Type: subscraping.Subdomain, Value: subdomain}
93+
s.results++
94+
}
95+
}()
96+
97+
return results
98+
}
99+
100+
// Name returns the name of the source
101+
func (s *Source) Name() string {
102+
return "digitalyama"
103+
}
104+
105+
func (s *Source) IsDefault() bool {
106+
return true
107+
}
108+
109+
func (s *Source) HasRecursiveSupport() bool {
110+
return false
111+
}
112+
113+
func (s *Source) NeedsKey() bool {
114+
return true
115+
}
116+
117+
func (s *Source) AddApiKeys(keys []string) {
118+
s.apiKeys = keys
119+
}
120+
121+
func (s *Source) Statistics() subscraping.Statistics {
122+
return subscraping.Statistics{
123+
Errors: s.errors,
124+
Results: s.results,
125+
TimeTaken: s.timeTaken,
126+
Skipped: s.skipped,
127+
}
128+
}

0 commit comments

Comments
 (0)