fdns

package module
v2.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

README

fdns

pkg.go.dev reference

Package fdns parses Rapid7 Forward DNS dataset in a concurrent way. The parser reports found entries (subdomains, IP addresses, records, etc) for the given record and domain.

Behaviour has changed since the project was created. Now A record reports DNS names instead of IP addresses.

This project is deprecated and will be used to experiment with non-reflection APIs. Please, do not rely on it being backwards compatible. Docker images might be deleted at any time.

Build from source

go install github.com/mailru/easyjson/...@v0.7.7
git clone --depth 1 https://github.com/jimen0/fdns.git
cd fdns
go generate
go install cmd/fdns/fdns.go

Run with Docker

docker container run --rm -it ghcr.io/jimen0/fdns/fdns:v2.0.2

Usage

➜  fdns
Usage of fdns:
      --domains strings      domains of which subdomains are discovered
      --file string          path of the dataset (can't be used with url)
      --goroutines int       number of goroutines (default 4)
      --records strings      records that will be parsed a|aaaa|cname|ns|ptr
      --substrings strings   substrings to match (ignores record types)
      --url string           URL of the dataset (can't be used with file)
      --verbose              enable verbose error messages

docker container run \
  --rm \
  -it \
  fdns \
    --domains .yahoo.com,.github.com \
    --records a,aaaa,cname \
    --goroutines 4 \
    --url https://opendata.rapid7.com/sonar.fdns_v2/2020-07-24-1595549209-fdns_any.json.gz \
    --verbose

Warnings

Please, remember that for old datasets, Rapid7 requires you to login before downloading them. This tool only aims to be used with the most recent release of them, therefore it doesn't support that logic. Feel free to submit a PR or fork the project if you need it.

Test

Just run go test -race -v ./... inside of the project's root folder.

Improvements

Submit a PR or open an issue. Just make sure that your PR passes gofmt, golint and go vet.

Documentation

Overview

Package fdns parses Rapid7 Forward DNS dataset in a concurrent way. The parser reports found entries (subdomains, IP addresses, records, etc) for the given record and domain.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	Domains []string
	// Records stores reported records.
	Records []string
	// Substrings stores the reported substrings.
	Substrings []string
	// Workers is the numer of simultaneous goroutines the parser will use.
	Workers int
}

Parser object allows parsing datasets looking for records related with a domain.

func (*Parser) IsInterestingDomain

func (p *Parser) IsInterestingDomain(e entry) bool

IsInterestingDomain reports if the domain is a subdomain of the provided domains.

func (*Parser) IsInterestingRecord

func (p *Parser) IsInterestingRecord(e entry) bool

IsInterestingRecord reports if the entry contains an interesting record.

func (*Parser) Parse

func (p *Parser) Parse(ctx context.Context, r io.Reader, out chan<- string, errs chan<- error)

Parse reads from the given io.Reader and reports results and errors.

func (*Parser) Substring added in v2.0.2

func (p *Parser) Substring(e entry) bool

Substring reports if the domain contains an interesting substring.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL