nmap

package
v0.0.0-...-e2bd792 Latest Latest
Warning

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

Go to latest
Published: May 6, 2019 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTooler

func NewTooler() common.Tooler

func Setup

func Setup(path string) error

Types

type Address

type Address struct {
	Addr     string `xml:"addr,attr"`
	Addrtype string `xml:"addrtype,attr"`
}

type Host

type Host struct {
	Status    HostStatus `xml:"status"`
	Addresses []Address  `xml:"address"`
	Hostnames []Hostname `xml:"hostnames"`
	Ports     []Port     `xml:"ports>port"`
}

type HostStatus

type HostStatus struct {
	State  string `xml:"state,attr"`
	Reason string `xml:"reason,attr"`
}

type Hostname

type Hostname struct {
	Name string `xml:"name,attr"`
	Type string `xml:"type,attr"`
}

type NmapRun

type NmapRun struct {
	Info  ScanInfo `xml:"scaninfo"`
	Hosts []Host   `xml:"host"`
}

Parsing the XML requires a set of structs to match the data we'd like to have. There are going tobe numerous structs involved in this procexss as they represent all of the ways the data could come back from an NMap XML file.

type Port

type Port struct {
	Protocol    string  `xml:"protocol,attr"`
	PortID      string  `xml:"portid,attr"`
	StateInfo   State   `xml:"state"`
	ServiceInfo Service `xml:"service"`
}

type ScanInfo

type ScanInfo struct {
	Type        string `xml:"type,attr"`
	Protocol    string `xml:"protocol,attr"`
	NumServices string `xml:"numservices,attr"`
	Services    string `xml:"services,attr"`
}

type Service

type Service struct {
	Name   string `xml:"name,attr"`
	Method string `xml:"method,attr"`
	Conf   string `xml:"conf,attr"`
}

type State

type State struct {
	State      string `xml:"state,attr"`
	Reason     string `xml:"reason,attr"`
	Reason_TTL string `xml:"reason_ttl,attr"`
}

Jump to

Keyboard shortcuts

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