Skip to content

Commit

Permalink
added AlienVault source
Browse files Browse the repository at this point in the history
  • Loading branch information
cybercdh committed Dec 29, 2022
1 parent 5ff57cd commit cb0794c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions alienvault.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package main

import (
"fmt"
)

type PassiveDNS struct {
PassiveDNS []struct {
Hostname string `json:"hostname"`
} `json:"passive_dns"`
}

func fetchAlienVault(domain string) ([]string, error) {
out := make([]string, 0)

fetchURL := fmt.Sprintf("https://otx.alienvault.com/api/v1/indicators/domain/%s/passive_dns", domain)

var pdns PassiveDNS

err := fetchJSON(fetchURL, &pdns)
if err != nil {
return out, err
}
for _, dns := range pdns.PassiveDNS {
out = append(out, dns.Hostname)
}

return out, nil
}
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func main() {
fetchRiskIq,
fetchRiddler,
fetchDnsSpy,
fetchAlienVault,
}

// optional add in wayback
Expand Down

0 comments on commit cb0794c

Please sign in to comment.