bsw

package
v3.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2016 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const VERSION = "3.0.1"

VERSION is the version of blacksheepwall.

Variables

View Source
var DomainRegex = `^\.?[a-z\d]+(?:(?:[a-z\d]*)|(?:[a-z\d\-]*[a-z\d]))(?:\.[a-z\d]+(?:(?:[a-z\d]*)|(?:[a-z\d\-]*[a-z\d])))*$`

DomainRegex is used to validate a hostname to ensure it is legitimate.

Functions

func FindBingSearchPath

func FindBingSearchPath(key string) (string, error)

FindBingSearchPath attempts an authenticated search request to two different Bing API paths. If and when a search is successfull, that path will be returned. If no path is valid this function returns an error.

func GetWildCard

func GetWildCard(domain, serverAddr string) string

GetWildCard searches for a possible wild card host by attempting to get an A record for wildcardsub + domain.

func GetWildCard6

func GetWildCard6(domain, serverAddr string) string

GetWildCard6 searches for a possible wild card host by attempting to get an AAAA record wildcardsub + domain.

func LookupCname

func LookupCname(fqdn, serverAddr string) (string, error)

LookupCname returns a fqdn address from CNAME record or error.

func LookupIP

func LookupIP(ip, serverAddr string) ([]string, error)

LookupIP returns hostname from PTR record or error.

func LookupMX

func LookupMX(domain, serverAddr string) ([]string, error)

LookupMX returns all the mx servers for a domain.

func LookupNS

func LookupNS(domain, serverAddr string) ([]string, error)

LookupNS returns the names servers for a domain.

func LookupName

func LookupName(fqdn, serverAddr string) (string, error)

LookupName returns IPv4 address from A record or error.

func LookupName6

func LookupName6(fqdn, serverAddr string) (string, error)

LookupName6 returns a IPv6 address from AAAA record or error.

func LookupSRV

func LookupSRV(fqdn, dnsServer string) (string, error)

LookupSRV returns a hostname from SRV record or error.

Types

type C

type C struct {
	Timeout        int64  `yaml:"timeout"`
	Concurrency    int    `yaml:"concurrency"`
	Validate       bool   `yaml:"validate"`
	IPv6           bool   `yaml:"ipv6"`
	Server         string `yaml:"server"`
	Reverse        bool   `yaml:"reverse"`
	Headers        bool   `yaml:"headers"`
	TLS            bool   `yaml:"tls"`
	AXFR           bool   `yaml:"axfr"`
	MX             bool   `yaml:"mx"`
	NS             bool   `yaml:"ns"`
	ViewDNSInfo    bool   `yaml:"viewdns_html"`
	ViewDNSInfoAPI string `yaml:"viewdns"`
	Robtex         bool   `yaml:"robtex"`
	LogonTube      bool   `yaml:"logontube"`
	SRV            bool   `yaml:"srv"`
	Bing           string `yaml:"bing"`
	BingHTML       bool   `yaml:"bing_html"`
	Shodan         string `yaml:"shodan"`
	Censys         string `yaml:"censys"`
	Yandex         string `yaml:"yandex"`
	Exfil          bool   `yaml:"exfiltrated"`
	DictFile       string `yaml:"dictionary"`
	FCRDNS         bool   `yaml:"fcrdns"`
}

C is used to parse a YAML config file.

func ReadConfig

func ReadConfig(location string) (*C, error)

ReadConfig parses a yaml file and returns a pointer to a new config.

type Result

type Result struct {
	Source   string `json:"src"`
	IP       string `json:"ip"`
	Hostname string `json:"hostname"`
}

Result is used to store a single IP and Hostname record.

type Results

type Results []Result

Results is a slice of Result.

func (Results) Len

func (r Results) Len() int

func (Results) Less

func (r Results) Less(i, j int) bool

Sorts by IPv4 address, IPv6 addresses will be show first and will be unsorted.

func (Results) Swap

func (r Results) Swap(i, j int)

type Tsk

type Tsk struct {
	// contains filtered or unexported fields
}

Tsk is used to return the results of a task to the caller.

func AXFR

func AXFR(domain, serverAddr string) *Tsk

AXFR attempts a zone transfer for the domain.

func BingAPIDomain

func BingAPIDomain(domain, key, path, server string) *Tsk

BingAPIDomain uses the bing search API and 'domain' search operator to find hostnames for a single domain.

func BingAPIIP

func BingAPIIP(ip, key, path string) *Tsk

BingAPIIP uses the bing search API and 'ip' search operator to find alternate hostnames for a single IP.

func BingDomain

func BingDomain(domain, server string) *Tsk

BingDomain uses bing's 'domain:' search operator and scrapes the HTML to find ips and hostnames for a domain.

func BingIP

func BingIP(ip string) *Tsk

BingIP uses bing's 'ip:' search operator and scrapes the HTML to find hostnames for an ip.

func CensysDomain

func CensysDomain(domain, auth string) *Tsk

CensysDomain search censys.io for a particular domain. After a list of IP addresses are found to be matching the domain, each ip in the list is looked up using the 'view' search. This TLS certificates for each IP, hostnames are gathers from these TLS certificates.

func CensysIP

func CensysIP(ip, auth string) *Tsk

CensysIP search an ip using censys.io's ipv4 view. Hostnames are extracted from previously gathered TLS certificates.

func Dictionary

func Dictionary(domain, subname, blacklist, serverAddr string) *Tsk

Dictionary attempts to get an A and CNAME record for a sub domain of domain.

func Dictionary6

func Dictionary6(domain, subname, blacklist, serverAddr string) *Tsk

Dictionary6 attempts to get an AAAA record for a sub domain of a domain.

func ExfiltratedHostname

func ExfiltratedHostname(domain, server string) *Tsk

ExfiltratedHostname uses exfiltrated.com's hostname search to identify possible hostnames for a domain. Each returned hostname is then resolved to the current IP.

func Headers

func Headers(ip string, timeout int64) *Tsk

Headers uses attempts to connect to IP over http(s). If connection is successfull return any hostnames from the possible 'Location' headers.

func LogonTubeAPI

func LogonTubeAPI(search string) *Tsk

LogonTubeAPI sends either a domain or IP to logontube.com's API.

func MX

func MX(domain, serverAddr string) *Tsk

MX returns the A record for any MX records for a domain.

func NS

func NS(domain, serverAddr string) *Tsk

NS returns the A record for any NS records for a domain.

func Reverse

func Reverse(ip, serverAddr string) *Tsk

Reverse uses LookupIP to get PTR record for an IP.

func SRV

func SRV(domain, dnsServer string) *Tsk

SRV iterates over a list of common SRV records, returning hostname and IP results for each.

func ShodanAPIHostSearch

func ShodanAPIHostSearch(domain string, key string) *Tsk

ShodanAPIHostSearch uses Shodan's '/shodan/host/search' REST API endpoint to find hostnames and ip addresses for a domain.

func ShodanAPIReverse

func ShodanAPIReverse(ips []string, key string) *Tsk

ShodanAPIReverse uses Shodan's '/dns/reverse' REST API to get hostnames for a list of ips.

func TLS

func TLS(ip string, timeout int64) *Tsk

TLS attempts connection to an IP using TLS on port 443, and if successfull, will parse the server certificate for CommonName and SubjectAlt names.

func ViewDNSInfo

func ViewDNSInfo(ip string) *Tsk

ViewDNSInfo uses viewdns.info's reverseip functionality, parsing the HTML table for hostnames.

func ViewDNSInfoAPI

func ViewDNSInfoAPI(ip, key string) *Tsk

ViewDNSInfoAPI uses viewdns.iinfo's API and reverseip function to find hostnames for an ip.

func YandexAPI

func YandexAPI(domain, apiURL, serverAddr string) *Tsk

YandexAPI uses Yandex XML API and the 'rhost' search operator to find subdomains of a given domain.

func (*Tsk) AddResult

func (t *Tsk) AddResult(ip, hostname string)

AddResult adds a result to results.

func (*Tsk) Err

func (t *Tsk) Err() error

Err returns the value of err.

func (*Tsk) HasResults

func (t *Tsk) HasResults() bool

HasResults return true if len of results is greater than 0.

func (*Tsk) Results

func (t *Tsk) Results() []Result

Results returns the results.

func (*Tsk) SetErr

func (t *Tsk) SetErr(err error)

SetErr sets the value of err

func (*Tsk) SetTask

func (t *Tsk) SetTask(task string)

SetTask will set the task.

func (*Tsk) Task

func (t *Tsk) Task() string

Task returns the descriptive name of a task.

Jump to

Keyboard shortcuts

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