modules

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: MIT Imports: 30 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ASNBgpDotNet

func ASNBgpDotNet(options core.Options) []string

ASNBgpDotNet get ASN infor from bgp.net

func ASNFromIP

func ASNFromIP(options core.Options) []string

ASNFromIP get ip or domain from ultratools.com

func ASNLookup

func ASNLookup(options core.Options) []string

ASNLookup get Org CIDR from asnlookup

func ASNSpyse

func ASNSpyse(options core.Options) []string

ASNSpyse get ASN infor from spyse.com

func BuiltwithUA

func BuiltwithUA(UAID string, options core.Options) (result []core.RelatedDomain)

func CrtSH

func CrtSH(raw string, options core.Options) (result []core.RelatedDomain)

CrtSH get IPInfo from https://crt.sh

func CrtSHOrg

func CrtSHOrg(org string, options core.Options) []string

CrtSHOrg get IPInfo from https://crt.sh

func CurrentUser

func CurrentUser() string

CurrentUser get current user

func ExtractGoogleTagManger

func ExtractGoogleTagManger(content string) (results []string)

func ExtractUAID

func ExtractUAID(content string) (results []string)

func GetIPInfo

func GetIPInfo(options core.Options) []string

GetIPInfo get CIDR from ASN

func GoogleAnalytic

func GoogleAnalytic(targetURL string, options core.Options) (result []core.RelatedDomain)

func IPv4Info

func IPv4Info(options core.Options) []string

IPv4Info get CIDR from ASN via ipv4info.com

func InternetDB

func InternetDB(IP string) string

func IsIPv4

func IsIPv4(ip net.IP) bool

IsIPv4 returns true when the provided net.IP address is an IPv4 address.

func IsIPv6

func IsIPv6(ip net.IP) bool

IsIPv6 returns true when the provided net.IP address is an IPv6 address.

func OrgBgbView

func OrgBgbView(options core.Options) []string

OrgBgbView get Org infor from bgpview.io

func OrgBgpDotNet

func OrgBgpDotNet(options core.Options) []string

OrgBgpDotNet get Org infor from bgp.net

func ParseNmap

func ParseNmap(raw string, options core.Options) []string

ParseNmap parse nmap XML output

func ParseZmap

func ParseZmap(zmapOutput string) []string

ParseZmap parsse zmap data

func ParsingMasscan

func ParsingMasscan(raw string) map[string][]string

ParsingMasscan parse result from masscan XML format

func ParsingNmapWithGoquery

func ParsingNmapWithGoquery(raw string, options core.Options) map[string][]string

ParsingNmapWithGoquery parse result from nmap XML format using goquery

func Range2CIDR

func Range2CIDR(first, last net.IP) *net.IPNet

Range2CIDR turns an IP range into a CIDR.

func ResolveData

func ResolveData(format string, data map[string]string) string

ResolveData resolve template from signature file

func ReverseWhois

func ReverseWhois(raw string, options core.Options) (result []core.RelatedDomain)

func RunMasscan

func RunMasscan(input string, options core.Options) []string

RunMasscan run masscan command and return list of port open

func RunNmap

func RunNmap(input string, ports string, options core.Options) []string

RunNmap run nmap command and return list of port open

func RunZmap

func RunZmap(inputFile string, port string, options core.Options) []string

RunZmap run masscan command and return list of port open

Types

type ASInfo

type ASInfo struct {
	Amount      int
	Number      int
	CountryCode string
	Description string
	CIDR        string
}

type AsnMap

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

func GenAsnData

func GenAsnData(r io.Reader) (*AsnMap, error)

func GetAsnMap

func GetAsnMap() (AsnMap, error)

func (*AsnMap) ASCountry

func (m *AsnMap) ASCountry(as int) string

func (*AsnMap) ASDesc

func (m *AsnMap) ASDesc(name string) (AsnNum []int)

func (*AsnMap) ASInfo

func (m *AsnMap) ASInfo(asnNum int) []ASInfo

ASInfo returns 0 on unknown.

func (*AsnMap) ASName

func (m *AsnMap) ASName(as int) string

func (*AsnMap) ASofIP

func (m *AsnMap) ASofIP(ip netaddr.IP) IPInfo

ASofIP returns 0 on unknown.

type CertData

type CertData struct {
	Domain   string
	CertInfo string
	Org      string
	WildCard bool
}

func ParseCertSH

func ParseCertSH(content string, options core.Options) []CertData

type Host

type Host struct {
	IPAddress string
	Hostname  string
	Ports     []Port
}

func GetHost

func GetHost(raw string) Host

GetHost parse nmap XML and return host object

func GetHosts

func GetHosts(raw string) []Host

GetHosts parse nmap XML and return mutilehost object

type IPInfo

type IPInfo struct {
	AS   int
	CIDR string
}

type NmapRun

type NmapRun struct {
	XMLName          xml.Name `xml:"nmaprun"`
	Text             string   `xml:",chardata"`
	Scanner          string   `xml:"scanner,attr"`
	Args             string   `xml:"args,attr"`
	Start            string   `xml:"start,attr"`
	Startstr         string   `xml:"startstr,attr"`
	Version          string   `xml:"version,attr"`
	Xmloutputversion string   `xml:"xmloutputversion,attr"`
	Scaninfo         struct {
		Text        string `xml:",chardata"`
		Type        string `xml:"type,attr"`
		Protocol    string `xml:"protocol,attr"`
		Numservices string `xml:"numservices,attr"`
		Services    string `xml:"services,attr"`
	} `xml:"scaninfo"`
	Verbose struct {
		Text  string `xml:",chardata"`
		Level string `xml:"level,attr"`
	} `xml:"verbose"`
	Debugging struct {
		Text  string `xml:",chardata"`
		Level string `xml:"level,attr"`
	} `xml:"debugging"`
	Taskbegin []struct {
		Text string `xml:",chardata"`
		Task string `xml:"task,attr"`
		Time string `xml:"time,attr"`
	} `xml:"taskbegin"`
	Taskend []struct {
		Text      string `xml:",chardata"`
		Task      string `xml:"task,attr"`
		Time      string `xml:"time,attr"`
		Extrainfo string `xml:"extrainfo,attr"`
	} `xml:"taskend"`
	Taskprogress []struct {
		Text      string `xml:",chardata"`
		Task      string `xml:"task,attr"`
		Time      string `xml:"time,attr"`
		Percent   string `xml:"percent,attr"`
		Remaining string `xml:"remaining,attr"`
		Etc       string `xml:"etc,attr"`
	} `xml:"taskprogress"`

	Host struct {
		Text      string `xml:",chardata"`
		Starttime string `xml:"starttime,attr"`
		Endtime   string `xml:"endtime,attr"`
		Status    struct {
			Text      string `xml:",chardata"`
			State     string `xml:"state,attr"`
			Reason    string `xml:"reason,attr"`
			ReasonTtl string `xml:"reason_ttl,attr"`
		} `xml:"status"`
		Address struct {
			Text     string `xml:",chardata"`
			Addr     string `xml:"addr,attr"`
			Addrtype string `xml:"addrtype,attr"`
		} `xml:"address"`
		Hostnames struct {
			Text     string `xml:",chardata"`
			Hostname struct {
				Text string `xml:",chardata"`
				Name string `xml:"name,attr"`
				Type string `xml:"type,attr"`
			} `xml:"hostname"`
		} `xml:"hostnames"`
		Ports struct {
			Text       string `xml:",chardata"`
			Extraports struct {
				Text         string `xml:",chardata"`
				State        string `xml:"state,attr"`
				Count        string `xml:"count,attr"`
				Extrareasons []struct {
					Text   string `xml:",chardata"`
					Reason string `xml:"reason,attr"`
					Count  string `xml:"count,attr"`
				} `xml:"extrareasons"`
			} `xml:"extraports"`
			Port []struct {
				Text     string `xml:",chardata"`
				Protocol string `xml:"protocol,attr"`
				Portid   string `xml:"portid,attr"`
				State    struct {
					Text      string `xml:",chardata"`
					State     string `xml:"state,attr"`
					Reason    string `xml:"reason,attr"`
					ReasonTtl string `xml:"reason_ttl,attr"`
				} `xml:"state"`
				Service struct {
					Text       string   `xml:",chardata"`
					Name       string   `xml:"name,attr"`
					Product    string   `xml:"product,attr"`
					Devicetype string   `xml:"devicetype,attr"`
					Method     string   `xml:"method,attr"`
					Conf       string   `xml:"conf,attr"`
					Version    string   `xml:"version,attr"`
					Extrainfo  string   `xml:"extrainfo,attr"`
					Ostype     string   `xml:"ostype,attr"`
					Servicefp  string   `xml:"servicefp,attr"`
					Cpe        []string `xml:"cpe"`
				} `xml:"service"`
				Script struct {
					Text   string `xml:",chardata"`
					ID     string `xml:"id,attr"`
					Output string `xml:"output,attr"`
					Elem   []struct {
						Text string `xml:",chardata"`
						Key  string `xml:"key,attr"`
					} `xml:"elem"`
				} `xml:"script"`
			} `xml:"port"`
		} `xml:"ports"`
		Times struct {
			Text   string `xml:",chardata"`
			Srtt   string `xml:"srtt,attr"`
			Rttvar string `xml:"rttvar,attr"`
			To     string `xml:"to,attr"`
		} `xml:"times"`
	} `xml:"host"`
	Runstats struct {
		Text     string `xml:",chardata"`
		Finished struct {
			Text    string `xml:",chardata"`
			Time    string `xml:"time,attr"`
			Timestr string `xml:"timestr,attr"`
			Elapsed string `xml:"elapsed,attr"`
			Summary string `xml:"summary,attr"`
			Exit    string `xml:"exit,attr"`
		} `xml:"finished"`
		Hosts struct {
			Text  string `xml:",chardata"`
			Up    string `xml:"up,attr"`
			Down  string `xml:"down,attr"`
			Total string `xml:"total,attr"`
		} `xml:"hosts"`
	} `xml:"runstats"`
}

NmapRun nmap single scan XML to struct

func ParseNmapXML

func ParseNmapXML(raw string) NmapRun

ParseNmapXML parse nmap XML result

type NmapRuns

type NmapRuns struct {
	XMLName          xml.Name `xml:"nmaprun"`
	Text             string   `xml:",chardata"`
	Scanner          string   `xml:"scanner,attr"`
	Args             string   `xml:"args,attr"`
	Start            string   `xml:"start,attr"`
	Startstr         string   `xml:"startstr,attr"`
	Version          string   `xml:"version,attr"`
	Xmloutputversion string   `xml:"xmloutputversion,attr"`
	Scaninfo         struct {
		Text        string `xml:",chardata"`
		Type        string `xml:"type,attr"`
		Protocol    string `xml:"protocol,attr"`
		Numservices string `xml:"numservices,attr"`
		Services    string `xml:"services,attr"`
	} `xml:"scaninfo"`
	Verbose struct {
		Text  string `xml:",chardata"`
		Level string `xml:"level,attr"`
	} `xml:"verbose"`
	Debugging struct {
		Text  string `xml:",chardata"`
		Level string `xml:"level,attr"`
	} `xml:"debugging"`
	Taskbegin []struct {
		Text string `xml:",chardata"`
		Task string `xml:"task,attr"`
		Time string `xml:"time,attr"`
	} `xml:"taskbegin"`
	Taskend []struct {
		Text      string `xml:",chardata"`
		Task      string `xml:"task,attr"`
		Time      string `xml:"time,attr"`
		Extrainfo string `xml:"extrainfo,attr"`
	} `xml:"taskend"`
	Host []struct {
		Text      string `xml:",chardata"`
		Starttime string `xml:"starttime,attr"`
		Endtime   string `xml:"endtime,attr"`
		Status    struct {
			Text      string `xml:",chardata"`
			State     string `xml:"state,attr"`
			Reason    string `xml:"reason,attr"`
			ReasonTtl string `xml:"reason_ttl,attr"`
		} `xml:"status"`
		Address struct {
			Text     string `xml:",chardata"`
			Addr     string `xml:"addr,attr"`
			Addrtype string `xml:"addrtype,attr"`
		} `xml:"address"`
		Hostnames struct {
			Text     string `xml:",chardata"`
			Hostname struct {
				Text string `xml:",chardata"`
				Name string `xml:"name,attr"`
				Type string `xml:"type,attr"`
			} `xml:"hostname"`
		} `xml:"hostnames"`
		Ports struct {
			Text       string `xml:",chardata"`
			Extraports struct {
				Text         string `xml:",chardata"`
				State        string `xml:"state,attr"`
				Count        string `xml:"count,attr"`
				Extrareasons []struct {
					Text   string `xml:",chardata"`
					Reason string `xml:"reason,attr"`
					Count  string `xml:"count,attr"`
				} `xml:"extrareasons"`
			} `xml:"extraports"`
			Port []struct {
				Text     string `xml:",chardata"`
				Protocol string `xml:"protocol,attr"`
				Portid   string `xml:"portid,attr"`
				State    struct {
					Text      string `xml:",chardata"`
					State     string `xml:"state,attr"`
					Reason    string `xml:"reason,attr"`
					ReasonTtl string `xml:"reason_ttl,attr"`
				} `xml:"state"`
				Service struct {
					Text       string `xml:",chardata"`
					Name       string `xml:"name,attr"`
					Tunnel     string `xml:"tunnel,attr"`
					Method     string `xml:"method,attr"`
					Conf       string `xml:"conf,attr"`
					Product    string `xml:"product,attr"`
					Devicetype string `xml:"devicetype,attr"`
					Servicefp  string `xml:"servicefp,attr"`
					Cpe        string `xml:"cpe"`
				} `xml:"service"`
				Script struct {
					Text   string `xml:",chardata"`
					ID     string `xml:"id,attr"`
					Output string `xml:"output,attr"`
					Elem   []struct {
						Text string `xml:",chardata"`
						Key  string `xml:"key,attr"`
					} `xml:"elem"`
				} `xml:"script"`
			} `xml:"port"`
		} `xml:"ports"`
		Times struct {
			Text   string `xml:",chardata"`
			Srtt   string `xml:"srtt,attr"`
			Rttvar string `xml:"rttvar,attr"`
			To     string `xml:"to,attr"`
		} `xml:"times"`
	} `xml:"host"`
	Taskprogress []struct {
		Text      string `xml:",chardata"`
		Task      string `xml:"task,attr"`
		Time      string `xml:"time,attr"`
		Percent   string `xml:"percent,attr"`
		Remaining string `xml:"remaining,attr"`
		Etc       string `xml:"etc,attr"`
	} `xml:"taskprogress"`
	Runstats struct {
		Text     string `xml:",chardata"`
		Finished struct {
			Text    string `xml:",chardata"`
			Time    string `xml:"time,attr"`
			Timestr string `xml:"timestr,attr"`
			Elapsed string `xml:"elapsed,attr"`
			Summary string `xml:"summary,attr"`
			Exit    string `xml:"exit,attr"`
		} `xml:"finished"`
		Hosts struct {
			Text  string `xml:",chardata"`
			Up    string `xml:"up,attr"`
			Down  string `xml:"down,attr"`
			Total string `xml:"total,attr"`
		} `xml:"hosts"`
	} `xml:"runstats"`
}

NmapRuns nmap multiple scan XML to struct

func ParseMultipleNmapXML

func ParseMultipleNmapXML(raw string) NmapRuns

ParseMultipleNmapXML parse nmap XML result

type Port

type Port struct {
	Protocol string
	PortID   string
	State    string
	Service  struct {
		Name    string
		Product string
		Cpe     string
	}
	Script struct {
		ID     string
		Output string
	}
}

type RangeInfo

type RangeInfo struct {
	Cidr    string `json:"cidr"`
	Desc    string `json:"desc"`
	Asn     string `json:"asn"`
	Country string `json:"country"`
}

RangeInfo infor about range IP

Jump to

Keyboard shortcuts

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