Merge pull request #326 from vzamanillo/robtex-pro

Move from Robtex free API to PRO API
master
bauthard 2020-09-22 00:41:07 +05:30 committed by GitHub
commit c5eb7fcea4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 3 deletions

View File

@ -138,6 +138,7 @@ Subfinder will work after using the installation instructions however to configu
- [Github](https://github.com) - [Github](https://github.com)
- [Intelx](https://intelx.io) - [Intelx](https://intelx.io)
- [Recon](https://recon.dev) - [Recon](https://recon.dev)
- [Robtex](https://www.robtex.com/api/)
Theses values are stored in the `$HOME/.config/subfinder/config.yaml` file which will be created when you run the tool for the first time. The configuration file uses the YAML format. Multiple API keys can be specified for each of these services from which one of them will be used for enumeration. Theses values are stored in the `$HOME/.config/subfinder/config.yaml` file which will be created when you run the tool for the first time. The configuration file uses the YAML format. Multiple API keys can be specified for each of these services from which one of them will be used for enumeration.

View File

@ -38,6 +38,7 @@ type ConfigFile struct {
IntelX []string `yaml:"intelx"` IntelX []string `yaml:"intelx"`
PassiveTotal []string `yaml:"passivetotal"` PassiveTotal []string `yaml:"passivetotal"`
Recon []string `yaml:"recon"` Recon []string `yaml:"recon"`
Robtex []string `yaml:"robtex"`
SecurityTrails []string `yaml:"securitytrails"` SecurityTrails []string `yaml:"securitytrails"`
Shodan []string `yaml:"shodan"` Shodan []string `yaml:"shodan"`
Spyse []string `yaml:"spyse"` Spyse []string `yaml:"spyse"`
@ -163,6 +164,10 @@ func (c *ConfigFile) GetKeys() subscraping.Keys {
keys.Recon = c.Recon[rand.Intn(len(c.Recon))] keys.Recon = c.Recon[rand.Intn(len(c.Recon))]
} }
if len(c.Robtex) > 0 {
keys.Robtex = c.Robtex[rand.Intn(len(c.Robtex))]
}
if len(c.SecurityTrails) > 0 { if len(c.SecurityTrails) > 0 {
keys.Securitytrails = c.SecurityTrails[rand.Intn(len(c.SecurityTrails))] keys.Securitytrails = c.SecurityTrails[rand.Intn(len(c.SecurityTrails))]
} }

View File

@ -13,7 +13,7 @@ import (
const ( const (
addrRecord = "A" addrRecord = "A"
iPv6AddrRecord = "AAAA" iPv6AddrRecord = "AAAA"
baseURL = "https://freeapi.robtex.com/pdns" baseURL = "https://proapi.robtex.com/pdns"
) )
// Source is the passive scraping agent // Source is the passive scraping agent
@ -32,9 +32,13 @@ func (s *Source) Run(ctx context.Context, domain string, session *subscraping.Se
go func() { go func() {
defer close(results) defer close(results)
if session.Keys.Robtex == "" {
return
}
headers := map[string]string{"Content-Type": "application/x-ndjson"} headers := map[string]string{"Content-Type": "application/x-ndjson"}
ips, err := enumerate(ctx, session, fmt.Sprintf("%s/forward/%s", baseURL, domain), headers) ips, err := enumerate(ctx, session, fmt.Sprintf("%s/forward/%s?key=%s", baseURL, domain, session.Keys.Robtex), headers)
if err != nil { if err != nil {
results <- subscraping.Result{Source: s.Name(), Type: subscraping.Error, Error: err} results <- subscraping.Result{Source: s.Name(), Type: subscraping.Error, Error: err}
return return
@ -42,7 +46,7 @@ func (s *Source) Run(ctx context.Context, domain string, session *subscraping.Se
for _, result := range ips { for _, result := range ips {
if result.Rrtype == addrRecord || result.Rrtype == iPv6AddrRecord { if result.Rrtype == addrRecord || result.Rrtype == iPv6AddrRecord {
domains, err := enumerate(ctx, session, fmt.Sprintf("%s/reverse/%s", baseURL, result.Rrdata), headers) domains, err := enumerate(ctx, session, fmt.Sprintf("%s/reverse/%s?key=%s", baseURL, result.Rrdata, session.Keys.Robtex), headers)
if err != nil { if err != nil {
results <- subscraping.Result{Source: s.Name(), Type: subscraping.Error, Error: err} results <- subscraping.Result{Source: s.Name(), Type: subscraping.Error, Error: err}
return return

View File

@ -47,6 +47,7 @@ type Keys struct {
PassiveTotalUsername string `json:"passivetotal_username"` PassiveTotalUsername string `json:"passivetotal_username"`
PassiveTotalPassword string `json:"passivetotal_password"` PassiveTotalPassword string `json:"passivetotal_password"`
Recon string `json:"recon"` Recon string `json:"recon"`
Robtex string `json:"robtex"`
Securitytrails string `json:"securitytrails"` Securitytrails string `json:"securitytrails"`
Shodan string `json:"shodan"` Shodan string `json:"shodan"`
Spyse string `json:"spyse"` Spyse string `json:"spyse"`