mirror of
https://github.com/cubixle/assetfinder.git
synced 2026-04-30 11:38:52 +01:00
initial
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package assetfinder
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type BufferOverrun struct{}
|
||||
|
||||
func (BufferOverrun) FetchSubDomains(domain string) ([]string, error) {
|
||||
out := make([]string, 0)
|
||||
|
||||
fetchURL := fmt.Sprintf("https://dns.bufferover.run/dns?q=.%s", domain)
|
||||
|
||||
wrapper := struct {
|
||||
Records []string `json:"FDNS_A"`
|
||||
}{}
|
||||
err := fetchJSON(fetchURL, &wrapper)
|
||||
if err != nil {
|
||||
return out, err
|
||||
}
|
||||
|
||||
for _, r := range wrapper.Records {
|
||||
parts := strings.SplitN(r, ",", 2)
|
||||
if len(parts) != 2 {
|
||||
continue
|
||||
}
|
||||
out = append(out, parts[1])
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
Reference in New Issue
Block a user