This commit is contained in:
2020-07-24 22:37:25 +01:00
commit f6be925acf
9 changed files with 373 additions and 0 deletions

25
certspotter.go Normal file
View File

@@ -0,0 +1,25 @@
package assetfinder
import "fmt"
type CertSpotter struct{}
func (CertSpotter) FetchSubDomains(domain string) ([]string, error) {
out := make([]string, 0)
fetchURL := fmt.Sprintf("https://certspotter.com/api/v0/certs?domain=%s", domain)
wrapper := []struct {
DNSNames []string `json:"dns_names"`
}{}
err := fetchJSON(fetchURL, &wrapper)
if err != nil {
return out, err
}
for _, w := range wrapper {
out = append(out, w.DNSNames...)
}
return out, nil
}