Versions in this module Expand all Collapse all v3 v3.0.3 Feb 21, 2024 v3.0.2 May 30, 2023 Changes in this version type Host + TimedOut bool type Option + func WithNonInteractive() Option v3.0.1 Apr 14, 2023 v3.0.0 Apr 13, 2023 Changes in this version + var ErrMallocFailed = errors.New("malloc failed, probably out of space") + var ErrNmapNotInstalled = errors.New("nmap binary was not found") + var ErrParseOutput = errors.New("unable to parse nmap output, see warnings for details") + var ErrResolveName = errors.New("nmap could not resolve a name") + var ErrScanTimeout = errors.New("nmap scan timed out") + func Parse(content []byte, result *Run) error + type Address struct + Addr string + AddrType string + Vendor string + func (a Address) String() string + type CPE string + type Debugging struct + Level int + type Distance struct + Value int + type Element struct + Key string + Value string + type ExtraPort struct + Count int + Reasons []Reason + State string + type Finished struct + Elapsed float32 + ErrorMsg string + Exit string + Summary string + Time Timestamp + TimeStr string + type Hop struct + Host string + IPAddr string + RTT string + TTL float32 + type Host struct + Addresses []Address + Comment string + Distance Distance + EndTime Timestamp + ExtraPorts []ExtraPort + HostScripts []Script + Hostnames []Hostname + IPIDSequence IPIDSequence + OS OS + Ports []Port + Smurfs []Smurf + StartTime Timestamp + Status Status + TCPSequence TCPSequence + TCPTSSequence TCPTSSequence + Times Times + Trace Trace + Uptime Uptime + type HostStats struct + Down int + Total int + Up int + type Hostname struct + Name string + Type string + func (h Hostname) String() string + type IPIDSequence Sequence + type Interface struct + Device string + IP net.IP + IPMask net.IP + MTU int + Mac net.HardwareAddr + Short string + Type string + Up bool + type InterfaceList struct + Interfaces []*Interface + Routes []*Route + type OS struct + Fingerprints []OSFingerprint + Matches []OSMatch + PortsUsed []PortUsed + type OSClass struct + Accuracy int + CPEs []CPE + Family string + OSGeneration string + Type string + Vendor string + func (o OSClass) OSFamily() family.OSFamily + type OSFingerprint struct + Fingerprint string + type OSMatch struct + Accuracy int + Classes []OSClass + Line int + Name string + type Option func(*Scanner) + func WithACKDiscovery(ports ...string) Option + func WithACKScan() Option + func WithASCIIData(data string) Option + func WithAggressiveScan() Option + func WithAppendOutput() Option + func WithBadSum() Option + func WithBinaryPath(binaryPath string) Option + func WithConnectScan() Option + func WithConsecutivePortScanning() Option + func WithCustomArguments(args ...string) Option + func WithCustomDNSServers(dnsServers ...string) Option + func WithCustomSysProcAttr(f func(*syscall.SysProcAttr)) Option + func WithDataDir(directoryPath string) Option + func WithDataLength(length int) Option + func WithDebugging(level int) Option + func WithDecoys(decoys ...string) Option + func WithDefaultScript() Option + func WithDisabledDNSResolution() Option + func WithFTPBounceScan(FTPRelayHost string) Option + func WithFastMode() Option + func WithFilterHost(hostFilter func(Host) bool) Option + func WithFilterPort(portFilter func(Port) bool) Option + func WithForcedDNSResolution() Option + func WithFragmentPackets() Option + func WithGrepOutput(outputFileName string) Option + func WithHexData(data string) Option + func WithHostTimeout(timeout time.Duration) Option + func WithICMPEchoDiscovery() Option + func WithICMPNetMaskDiscovery() Option + func WithICMPTimestampDiscovery() Option + func WithIPOptions(options string) Option + func WithIPProtocolPingDiscovery(protocols ...string) Option + func WithIPProtocolScan() Option + func WithIPTimeToLive(ttl int16) Option + func WithIPv6Scanning() Option + func WithIdleScan(zombieHost string, probePort int) Option + func WithInitialRTTTimeout(roundTripTime time.Duration) Option + func WithInterface(iface string) Option + func WithListScan() Option + func WithMTU(offset int) Option + func WithMaimonScan() Option + func WithMaxHostgroup(size int) Option + func WithMaxParallelism(probes int) Option + func WithMaxRTTTimeout(roundTripTime time.Duration) Option + func WithMaxRate(packetsPerSecond int) Option + func WithMaxRetries(tries int) Option + func WithMaxScanDelay(timeout time.Duration) Option + func WithMinHostgroup(size int) Option + func WithMinParallelism(probes int) Option + func WithMinRTTTimeout(roundTripTime time.Duration) Option + func WithMinRate(packetsPerSecond int) Option + func WithMostCommonPorts(number int) Option + func WithNmapOutput(outputFileName string) Option + func WithNoStylesheet() Option + func WithOSDetection() Option + func WithOSScanGuess() Option + func WithOSScanLimit() Option + func WithOpenOnly() Option + func WithPacketTrace() Option + func WithPingScan() Option + func WithPortExclusions(ports ...string) Option + func WithPortRatio(ratio float32) Option + func WithPorts(ports ...string) Option + func WithPrivileged() Option + func WithProxies(proxies ...string) Option + func WithRandomTargets(randomTargets int) Option + func WithReason() Option + func WithResumePreviousScan(filePath string) Option + func WithSCTPCookieEchoScan() Option + func WithSCTPDiscovery(ports ...string) Option + func WithSCTPInitScan() Option + func WithSYNDiscovery(ports ...string) Option + func WithSYNScan() Option + func WithScanDelay(timeout time.Duration) Option + func WithScriptArguments(arguments map[string]string) Option + func WithScriptArgumentsFile(inputFilePath string) Option + func WithScriptTimeout(timeout time.Duration) Option + func WithScriptTrace() Option + func WithScriptUpdateDB() Option + func WithScripts(scripts ...string) Option + func WithSendEthernet() Option + func WithSendIP() Option + func WithServiceInfo() Option + func WithSkipHostDiscovery() Option + func WithSourcePort(port uint16) Option + func WithSpoofIPAddress(ip string) Option + func WithSpoofMAC(argument string) Option + func WithStatsEvery(interval string) Option + func WithStylesheet(stylesheetPath string) Option + func WithSystemDNS() Option + func WithTCPFINScan() Option + func WithTCPNullScan() Option + func WithTCPScanFlags(flags ...TCPFlag) Option + func WithTCPXmasScan() Option + func WithTargetExclusion(target string) Option + func WithTargetExclusionInput(inputFileName string) Option + func WithTargetInput(inputFileName string) Option + func WithTargets(targets ...string) Option + func WithTimingTemplate(timing Timing) Option + func WithTraceRoute() Option + func WithUDPDiscovery(ports ...string) Option + func WithUDPScan() Option + func WithUnique() Option + func WithUnprivileged() Option + func WithVerbosity(level int) Option + func WithVersionAll() Option + func WithVersionIntensity(intensity int16) Option + func WithVersionLight() Option + func WithVersionTrace() Option + func WithWebXML() Option + func WithWindowScan() Option + type Owner struct + Name string + func (o Owner) String() string + type Port struct + ID uint16 + Owner Owner + Protocol string + Scripts []Script + Service Service + State State + func (p Port) Status() PortStatus + type PortStatus string + const Closed + const Filtered + const Open + const Unfiltered + type PortUsed struct + ID int + Proto string + State string + type Reason struct + Count int + Reason string + type Route struct + DestinationIP net.IP + DestinationIPMask net.IP + Device string + Gateway net.IP + Metric int + type Run struct + Args string + Debugging Debugging + Hosts []Host + NmapErrors []string + PostScripts []Script + PreScripts []Script + ProfileName string + ScanInfo ScanInfo + Scanner string + Start Timestamp + StartStr string + Stats Stats + Targets []Target + TaskBegin []Task + TaskEnd []Task + TaskProgress []TaskProgress + Verbose Verbose + Version string + XMLName xml.Name + XMLOutputVersion string + func (r *Run) FromFile(filename string) error + func (r Run) ToFile(filePath string) error + func (r Run) ToReader() io.Reader + type ScanInfo struct + NumServices int + Protocol string + ScanFlags string + Services string + Type string + type ScanRunner interface + Run func() (result *Run, warnings []string, err error) + type Scanner struct + func NewScanner(ctx context.Context, options ...Option) (*Scanner, error) + func (s *Scanner) AddOptions(options ...Option) *Scanner + func (s *Scanner) Args() []string + func (s *Scanner) Async(doneAsync chan error) *Scanner + func (s *Scanner) GetInterfaceList() (result *InterfaceList, err error) + func (s *Scanner) Progress(liveProgress chan float32) *Scanner + func (s *Scanner) Run() (result *Run, warnings *[]string, err error) + func (s *Scanner) Streamer(stream io.Writer) *Scanner + func (s *Scanner) ToFile(file string) *Scanner + type Script struct + Elements []Element + ID string + Output string + Tables []Table + type Sequence struct + Class string + Values string + type Service struct + CPEs []CPE + Confidence int + DeviceType string + ExtraInfo string + HighVersion string + Hostname string + LowVersion string + Method string + Name string + OSType string + Product string + Proto string + RPCNum string + ServiceFP string + Tunnel string + Version string + func (s Service) String() string + type Smurf struct + Responses string + type State struct + Reason string + ReasonIP string + ReasonTTL float32 + State string + func (s State) String() string + type Stats struct + Finished Finished + Hosts HostStats + type Status struct + Reason string + ReasonTTL float32 + State string + func (s Status) String() string + type TCPFlag int + const FlagACK + const FlagCWR + const FlagECE + const FlagFIN + const FlagNS + const FlagNULL + const FlagPSH + const FlagRST + const FlagSYN + const FlagURG + type TCPSequence struct + Difficulty string + Index int + Values string + type TCPTSSequence Sequence + type Table struct + Elements []Element + Key string + Tables []Table + type Target struct + Reason string + Specification string + Status string + type Task struct + ExtraInfo string + Task string + Time Timestamp + type TaskProgress struct + Etc Timestamp + Percent float32 + Remaining int + Task string + Time Timestamp + type Times struct + RTT string + SRTT string + To string + type Timestamp time.Time + func (t *Timestamp) ParseTime(s string) error + func (t *Timestamp) UnmarshalJSON(b []byte) error + func (t *Timestamp) UnmarshalXMLAttr(attr xml.Attr) (err error) + func (t Timestamp) FormatTime() string + func (t Timestamp) MarshalJSON() ([]byte, error) + func (t Timestamp) MarshalXMLAttr(name xml.Name) (xml.Attr, error) + type Timing int16 + const TimingAggressive + const TimingFastest + const TimingNormal + const TimingPolite + const TimingSlowest + const TimingSneaky + type Trace struct + Hops []Hop + Port int + Proto string + type Uptime struct + Lastboot string + Seconds int + type Verbose struct + Level int Other modules containing this package github.com/Ullaakut/nmap github.com/Ullaakut/nmap/v2