recon

package
v2.7.8 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: MIT Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureCommand

func ConfigureCommand(cmd *cobra.Command) error

func GenerateURLs

func GenerateURLs(scope *NGScope, h *Hosts, subs []string) ([]string, error)

GenerateURLs creates a slice of http and https urls from recon-ng results scope.

func GetJARMHashes added in v2.6.3

func GetJARMHashes(csvFilePath string) (map[string][]string, error)

GetJARMHashes ...

func HasCloudMX added in v2.5.8

func HasCloudMX(domain string) bool

func HasCloudSPF added in v2.5.8

func HasCloudSPF(domain string) bool

func HasDMARC added in v2.5.8

func HasDMARC(domain string) bool

func HasDesktopSSO added in v2.5.8

func HasDesktopSSO(client *localio.Client, domain, userAgent string) (bool, error)

func WriteHttpxURLsToFile

func WriteHttpxURLsToFile(csvFilePath, outputDir string, miscHosts []string) (string, error)

WriteHttpxURLsToFile writes the httpx responsive urls to a file.

Types

type ASNData

type ASNData struct {
	AsnHandle  int      `json:"asnHandle,omitempty"`
	AsnName    string   `json:"asnName,omitempty"`
	OrgID      string   `json:"orgID,omitempty"`
	OrgName    string   `json:"orgName,omitempty"`
	OrgCountry string   `json:"orgCountry,omitempty"`
	Ipv4Prefix []string `json:"ipv4_prefix,omitempty"`
	Ipv6Prefix []string `json:"ipv6_prefix,omitempty"`
}

type ASNMapDomainQueryCSV

type ASNMapDomainQueryCSV struct {
	Timestamp string `csv:"timestamp,omitempty"`
	Input     string `csv:"input,omitempty"`
	AsNumber  string `csv:"as_number,omitempty"`
	AsName    string `csv:"as_name,omitempty"`
	AsCountry string `csv:"as_country,omitempty"`
	AsRange   string `csv:"as_range,omitempty"`
}

type ASNMapScope

type ASNMapScope struct {
	DomainASN []ASNMapDomainQueryCSV
}

type Addresses

type Addresses struct {
	IP   string `json:"ip,omitempty"`
	Cidr string `json:"cidr,omitempty"`
	Asn  int    `json:"asn,omitempty"`
	Desc string `json:"desc,omitempty"`
}

type AmassConfigOptions

type AmassConfigOptions struct {
	OutputDirectory      string
	ScopeIP              string
	ScopeCIDR            string
	ScopeASN             string
	DomainScope          string
	OutOfScopeSubdomains string
	SubWordlist          string
	DataSources          string
}

type AmassData

type AmassData struct {
	Name      string      `json:"name,omitempty"`
	Domain    string      `json:"domain,omitempty"`
	Addresses []Addresses `json:"addresses,omitempty"`
	Tag       string      `json:"tag,omitempty"`
	Sources   []string    `json:"sources,omitempty"`
}

type AmassResults

type AmassResults struct {
	Data []AmassData
}

type Body added in v2.5.8

type Body struct {
	GetFederationInformationResponseMessage GetFederationInformationResponseMessage `xml:"http://schemas.microsoft.com/exchange/2010/Autodiscover GetFederationInformationResponseMessage"`
}

type CloudEnumInfo added in v2.5.8

type CloudEnumInfo struct {
	RepoPath       string
	VirtualENVPath string
	OutputDir      string
}

type CredentialTypeResponse added in v2.5.8

type CredentialTypeResponse struct {
	Username       string `json:"Username,omitempty"`
	Display        string `json:"Display,omitempty"`
	IfExistsResult int    `json:"IfExistsResult,omitempty"`
	IsUnmanaged    bool   `json:"IsUnmanaged,omitempty"`
	ThrottleStatus int    `json:"ThrottleStatus,omitempty"`
	Credentials    struct {
		PrefCredential  int         `json:"PrefCredential,omitempty"`
		HasPassword     bool        `json:"HasPassword,omitempty"`
		RemoteNgcParams interface{} `json:"RemoteNgcParams,omitempty"`
		FidoParams      interface{} `json:"FidoParams,omitempty"`
		SasParams       interface{} `json:"SasParams,omitempty"`
		CertAuthParams  interface{} `json:"CertAuthParams,omitempty"`
		GoogleParams    interface{} `json:"GoogleParams,omitempty"`
		FacebookParams  interface{} `json:"FacebookParams,omitempty"`
	} `json:"Credentials,omitempty"`
	EstsProperties struct {
		DesktopSsoEnabled  bool          `json:"DesktopSsoEnabled,omitempty"`
		UserTenantBranding []interface{} `json:"UserTenantBranding"`
		DomainType         int           `json:"DomainType,omitempty"`
	} `json:"EstsProperties,omitempty"`
	FlowToken          string `json:"FlowToken,omitempty"`
	IsSignupDisallowed bool   `json:"IsSignupDisallowed,omitempty"`
	APICanary          string `json:"apiCanary,omitempty"`
}

func GetCredentialType added in v2.5.8

func GetCredentialType(client *localio.Client, username, userAgent string) (*CredentialTypeResponse, error)

type CsvReportFiles

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

type DNSReconCSVData

type DNSReconCSVData struct {
	Type    string `csv:"Type,omitempty"`
	Name    string `csv:"Name,omitempty"`
	Address string `csv:"Address,omitempty"`
	Target  string `csv:"Target,omitempty"`
	Port    string `csv:"Port,omitempty"`
	String  string `csv:"String,omitempty"`
}

type DNSReconResults

type DNSReconResults struct {
	DNSReconData []DNSReconCSVData
}

type DNSTwistCSVData

type DNSTwistCSVData struct {
	Fuzzer         string `csv:"fuzzer,omitempty"`
	Domain         string `csv:"domain,omitempty"`
	DNSA           string `csv:"dns_a,omitempty"`
	DNSAaaa        string `csv:"dns_aaaa,omitempty"`
	DNSMx          string `csv:"dns_mx,omitempty"`
	DNSNs          string `csv:"dns_ns,omitempty"`
	Geoip          string `csv:"geoip,omitempty"`
	WhoisRegistrar string `csv:"whois_registrar,omitempty"`
	WhoisCreated   string `csv:"whois_created,omitempty"`
	Ssdeep         string `csv:"ssdeep,omitempty"`
	Field11        string `csv:"FIELD11,omitempty"`
}

type DesktopSSO added in v2.5.8

type DesktopSSO struct {
	State                   int    `json:"State"`
	UserState               int    `json:"UserState"`
	Login                   string `json:"Login"`
	NameSpaceType           string `json:"NameSpaceType"`
	DomainName              string `json:"DomainName"`
	FederationGlobalVersion int    `json:"FederationGlobalVersion,omitempty"`
	AuthURL                 string `json:"AuthURL,omitempty"`
	FederationBrandName     string `json:"FederationBrandName"`
	CloudInstanceName       string `json:"CloudInstanceName"`
	DesktopSSOEnabled       bool   `json:"DesktopSSOEnabled"`
}

type DomainSquatterData

type DomainSquatterData struct {
	DNSTwistData []DNSTwistCSVData
}

type Domains added in v2.5.8

type Domains struct {
	Domains []string `xml:"Domain"`
}

type Email added in v2.5.8

type Email struct {
	Name  string
	DNS   bool
	MX    bool
	SPF   bool
	DMARC bool
	Type  string
	STS   string
}

type GetFederationInformationResponseMessage added in v2.6.1

type GetFederationInformationResponseMessage struct {
	Response Response `xml:"http://schemas.microsoft.com/exchange/2010/Autodiscover Response"`
}
type Header struct {
	Action            string            `xml:"http://www.w3.org/2005/08/addressing Action"`
	ServerVersionInfo ServerVersionInfo `xml:"http://schemas.microsoft.com/exchange/2010/Autodiscover ServerVersionInfo"`
}

type Hosts

type Hosts struct {
	Domains              []string
	SubDomains           []string
	CIDRs                []string
	IPv4s                []string
	IPv6s                []string
	OutOfScope           []string
	OutOfScopeSubdomains []string
	ASNs                 []string
}

func NewScope

func NewScope(opts *Options) (*Hosts, error)

func (*Hosts) RunAllRecon

func (h *Hosts) RunAllRecon(opts *Options) error

RunAllRecon ...

func (*Hosts) RunReconNG

func (h *Hosts) RunReconNG(opts *Options) (*CsvReportFiles, error)

RunReconNG runs all specified modules against the target domain

func (*Hosts) ThoroughReconNG

func (h *Hosts) ThoroughReconNG(opts *Options) (*CsvReportFiles, error)

ThoroughReconNG Runs recon-ng a second time inserting any new base domains if found. If no new base domains were found. Skip.

type HttpxOutputCSV

type HttpxOutputCSV struct {
	Asn                string `csv:"asn,omitempty"`
	A                  string `csv:"a,omitempty"`
	Body               string `csv:"body,omitempty"`
	Cdn                bool   `csv:"cdn,omitempty"`
	CdnName            string `csv:"cdn_name,omitempty"`
	ChainStatusCodes   string `csv:"chain_status_codes,omitempty"`
	Chain              string `csv:"chain,omitempty"`
	Cname              string `csv:"cname,omitempty"`
	ContentLength      int    `csv:"content_length,omitempty"`
	ContentType        string `csv:"content_type,omitempty"`
	Csp                string `csv:"csp,omitempty"`
	Error              string `csv:"error,omitempty"`
	ExtractRegex       string `csv:"extract_regex,omitempty"`
	Extracts           string `csv:"extracts,omitempty"`
	Failed             bool   `csv:"failed,omitempty"`
	Favicon            string `csv:"favicon,omitempty"`
	FinalURL           string `csv:"final_url,omitempty"`
	Hash               string `csv:"hash,omitempty"`
	Header             string `csv:"header,omitempty"`
	Host               string `csv:"host,omitempty"`
	HTTP2              bool   `csv:"http2,omitempty"`
	Input              string `csv:"input,omitempty"`
	Jarm               string `csv:"jarm,omitempty"`
	Lines              int    `csv:"lines,omitempty"`
	Location           string `csv:"location,omitempty"`
	Method             string `csv:"method,omitempty"`
	Path               string `csv:"path,omitempty"`
	Pipeline           bool   `csv:"pipeline,omitempty"`
	Port               int    `csv:"port,omitempty"`
	RawHeader          string `csv:"raw_header,omitempty"`
	Request            string `csv:"request,omitempty"`
	Scheme             string `csv:"scheme,omitempty"`
	StatusCode         int    `csv:"status_code,omitempty"`
	StoredResponsePath string `csv:"stored_response_path,omitempty"`
	Tech               string `csv:"tech,omitempty"`
	Timestamp          string `csv:"timestamp,omitempty"`
	Time               string `csv:"time,omitempty"`
	Title              string `csv:"title,omitempty"`
	TLS                string `csv:"tls,omitempty"`
	URL                string `csv:"url,omitempty"`
	Vhost              bool   `csv:"vhost,omitempty"`
	Webserver          string `csv:"webserver,omitempty"`
	Websocket          bool   `csv:"websocket,omitempty"`
	Words              int    `csv:"words,omitempty"`
}

type MSOLOpenIDConfiguration added in v2.5.8

type MSOLOpenIDConfiguration struct {
	TokenEndpoint                     string   `json:"token_endpoint,omitempty"`
	TokenEndpointAuthMethodsSupported []string `json:"token_endpoint_auth_methods_supported,omitempty"`
	JwksURI                           string   `json:"jwks_uri,omitempty"`
	ResponseModesSupported            []string `json:"response_modes_supported,omitempty"`
	SubjectTypesSupported             []string `json:"subject_types_supported,omitempty"`
	IDTokenSigningAlgValuesSupported  []string `json:"id_token_signing_alg_values_supported,omitempty"`
	ResponseTypesSupported            []string `json:"response_types_supported,omitempty"`
	ScopesSupported                   []string `json:"scopes_supported,omitempty"`
	Issuer                            string   `json:"issuer,omitempty"`
	MicrosoftMultiRefreshToken        bool     `json:"microsoft_multi_refresh_token,omitempty"`
	AuthorizationEndpoint             string   `json:"authorization_endpoint,omitempty"`
	DeviceAuthorizationEndpoint       string   `json:"device_authorization_endpoint,omitempty"`
	HTTPLogoutSupported               bool     `json:"http_logout_supported,omitempty"`
	FrontchannelLogoutSupported       bool     `json:"frontchannel_logout_supported,omitempty"`
	EndSessionEndpoint                string   `json:"end_session_endpoint,omitempty"`
	ClaimsSupported                   []string `json:"claims_supported,omitempty"`
	CheckSessionIframe                string   `json:"check_session_iframe,omitempty"`
	UserinfoEndpoint                  string   `json:"userinfo_endpoint,omitempty"`
	KerberosEndpoint                  string   `json:"kerberos_endpoint,omitempty"`
	TenantRegionScope                 string   `json:"tenant_region_scope,omitempty"`
	CloudInstanceName                 string   `json:"cloud_instance_name,omitempty"`
	CloudGraphHostName                string   `json:"cloud_graph_host_name,omitempty"`
	MsgraphHost                       string   `json:"msgraph_host,omitempty"`
	RbacURL                           string   `json:"rbac_url,omitempty"`
}

type MalwoverviewConfigOptions

type MalwoverviewConfigOptions struct {
	VirusTotalAPIKEY string
}

type NGContactsCSV

type NGContactsCSV struct {
	FirstName  string `csv:"first_name"`
	MiddleName string `csv:"middle_name"`
	LastName   string `csv:"last_name"`
	Email      string `csv:"email"`
	Title      string `csv:"title"`
	Region     string `csv:"region"`
	Country    string `csv:"country"`
	Phone      string `csv:"phone"`
	Notes      string `csv:"notes"`
	Module     string `csv:"module"`
}

type NGHostsCSV

type NGHostsCSV struct {
	Host    string `csv:"host"`
	IP      string `csv:"ip_address"`
	Region  string `csv:"region"`
	Country string `csv:"country"`
	Lat     string `csv:"latitude"`
	Long    string `csv:"longitude"`
	Notes   string `csv:"notes"`
	Module  string `csv:"module"`
}

type NGPortsCSV

type NGPortsCSV struct {
	IP       string `csv:"ip_address"`
	Host     string `csv:"host"`
	Port     string `csv:"port"`
	Protocol string `csv:"protocol"`
	Banner   string `csv:"banner"`
	Notes    string `csv:"notes"`
	Module   string `csv:"module"`
}

type NGScope

type NGScope struct {
	URLs          []string
	URLsWithPorts []string
	Domains       []string
	Hosts         []NGHostsCSV
	Contacts      []NGContactsCSV
	Ports         []NGPortsCSV
	HttpxData     []HttpxOutputCSV
}

func ParseHttpxCSV

func ParseHttpxCSV(csvFilePath string) (*NGScope, error)

ParseHttpxCSV maps the httpx output csv results to a struct

func ParseReconNGCSV

func ParseReconNGCSV(csvFiles *CsvReportFiles, outOfScope []string) (*NGScope, error)

ParseReconNGCSV ...

type Options

type Options struct {
	Company                  string
	Creator                  string
	Domain                   interface{}
	Modules                  interface{}
	NetBlock                 interface{}
	OutOfScope               interface{}
	Output                   string
	Workspace                string
	UserAgent                string
	RunDNSRecon              bool
	RunAmass                 bool
	RunPyMeta                bool
	RunDomainSquatting       bool
	RunCloudEnum             bool
	RunYalis                 bool
	RunAll                   bool
	PrimaryDomainIsSubdomain bool
	APIKeys                  *config.GoReconConfig
	ReconNGKeys              interface{}
	AmassAPIKeys             interface{}
}

func (*Options) LoadFromCommand

func (opts *Options) LoadFromCommand(cmd *cobra.Command) error

type PyMetaInfo

type PyMetaInfo struct {
	RepoPath       string
	VirtualENVPath string
	OutputDir      string
}

type PythonRepoSetupData

type PythonRepoSetupData struct {
	RepoPath         string
	VirtualENVPath   string
	OutputDir        string
	VirusTotalKeySet bool
}

type Response added in v2.6.1

type Response struct {
	ErrorCode      string       `xml:"ErrorCode"`
	ErrorMessage   string       `xml:"ErrorMessage"`
	ApplicationURI string       `xml:"ApplicationUri"`
	Domains        Domains      `xml:"Domains"`
	TokenIssuers   TokenIssuers `xml:"TokenIssuers"`
}

type ServerVersionInfo added in v2.5.8

type ServerVersionInfo struct {
	MajorVersion     int    `xml:"http://schemas.microsoft.com/exchange/2010/Autodiscover MajorVersion"`
	MinorVersion     int    `xml:"http://schemas.microsoft.com/exchange/2010/Autodiscover MinorVersion"`
	MajorBuildNumber int    `xml:"http://schemas.microsoft.com/exchange/2010/Autodiscover MajorBuildNumber"`
	MinorBuildNumber int    `xml:"http://schemas.microsoft.com/exchange/2010/Autodiscover MinorBuildNumber"`
	Version          string `xml:"http://schemas.microsoft.com/exchange/2010/Autodiscover Version"`
}

type ShodanClient added in v2.6.3

type ShodanClient struct {
	Client *shodan.Client
	// contains filtered or unexported fields
}

func NewShodanClient added in v2.6.3

func NewShodanClient(apikey string) *ShodanClient

NewShodanClient ...

type SubfinderConfigOptions

type SubfinderConfigOptions struct {
	BeVigil        string
	Bufferover     string
	Binaryedge     string
	C99            string
	Censys         string
	Certspotter    string
	Chaos          string
	Chinaz         string
	Dnsdb          string
	DNSRepo        string
	Fofa           string
	Fullhunt       string
	Github         string
	Hunter         string
	Intelx         string
	Passivetotal   string
	Quake          string
	Robtex         string
	Securitytrails string
	Shodan         string
	Threatbook     string
	Urlscan        string
	Virustotal     string
	Whoisxmlapi    string
	Zoomeye        string
}

type Tenant added in v2.5.8

type Tenant struct {
	Brand             string
	Name              string
	ID                string
	Region            string
	DesktopSSOEnabled bool
}

type TenantData added in v2.5.8

type TenantData struct {
	Tenant Tenant
	Email  []Email
}

func InvokeReconAsOutsider added in v2.5.8

func InvokeReconAsOutsider(domains []string, outputDir, userAgent string) ([]TenantData, error)

InvokeReconAsOutsider implements AADInternals Invoke-AADIntReconAsOutsider -Domain company.com | Format-Table in Go. it returns *TenantData and an error

type TenantDomains added in v2.5.8

type TenantDomains struct {
	XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Envelope"`
	Header  Header   `xml:"http://schemas.xmlsoap.org/soap/envelope/ Header"`
	Body    Body     `xml:"http://schemas.xmlsoap.org/soap/envelope/ Body"`
}

type TenantDomainsSoapRequest added in v2.6.0

type TenantDomainsSoapRequest struct {
	Domain string
}

type TokenIssuer added in v2.6.1

type TokenIssuer struct {
	Endpoint string `xml:"Endpoint"`
	URI      string `xml:"Uri"`
}

type TokenIssuers added in v2.5.8

type TokenIssuers struct {
	TokenIssuer []TokenIssuer `xml:"TokenIssuer"`
}

type UserRealmV2 added in v2.5.8

type UserRealmV2 struct {
	State                   int    `json:"State"`
	UserState               int    `json:"UserState"`
	Login                   string `json:"Login"`
	NameSpaceType           string `json:"NameSpaceType"`
	DomainName              string `json:"DomainName"`
	FederationGlobalVersion int    `json:"FederationGlobalVersion"`
	AuthURL                 string `json:"AuthURL"`
	FederationBrandName     string `json:"FederationBrandName"`
	CloudInstanceName       string `json:"CloudInstanceName"`
}

func GetUserRealmV2 added in v2.5.8

func GetUserRealmV2(c *localio.Client, userName, domain, userAgent string) (UserRealmV2, error)

type YalisConfig added in v2.6.3

type YalisConfig struct {
	LinkedinUsername string
	LinkedinPassword string
	CompanyName      string
}

type YalisOpts added in v2.6.3

type YalisOpts struct {
	AbsBinaryPath  string
	ConfigFilePath string
}

Jump to

Keyboard shortcuts

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