nmap

package
Version: v0.0.0-...-8cab9b7 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2018 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const NMAP_DEFAULT_DISCOVERY_MODE = "nmap_ping"
View Source
const NMAP_DISCOVERY_ENV_VAR = "GOMAPPER_NMAP_DISCOVERY_MODE"

Variables

This section is empty.

Functions

func GetHelperArgs

func GetHelperArgs(method string, opts map[string]string) ([]string, error)

func LoadPlugin

func LoadPlugin() ([]string, gomapperplugins.PluginInterface, error)

func ParseScanToDbNetwork

func ParseScanToDbNetwork(network string, results *NmapRun) (net formats.DbNetwork)

Types

type Address

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

type Debugging

type Debugging struct {
	Level int `xml:level,attr`
}

type Elem

type Elem struct {
	Key   string `xml:"key,attr"`
	Value string `xml:",innerxml"`
}

type ErrorResponse

type ErrorResponse struct {
	Error  string
	Stderr string
}

type ExtraPorts

type ExtraPorts struct {
	State        string        `xml:"state,attr"`
	Count        int           `xml:"count,attr"`
	ExtraReasons []ExtraReason `xml:"extrareasons"`
}

type ExtraReason

type ExtraReason struct {
	Reason string `xml:"reason,attr"`
	Count  int    `xml:"count,attr"`
}

type Finished

type Finished struct {
	Time    int     `xml:"time,attr"`
	TimeStr string  `xml:"timestr,attr"`
	Elapsed float64 `xml:"elapsed,attr"`
	Summary string  `xml:"summary,attr"`
	Exit    string  `xml:"exit,attr"`
}

type FinishedHosts

type FinishedHosts struct {
	Up    int `xml:"up,attr"`
	Down  int `xml:"down,attr"`
	Total int `xml:"total,attr"`
}

type Host

type Host struct {
	StartTime int       `xml:"starttime,attr"`
	EndTime   int       `xml:"endtime,attr"`
	Status    Status    `xml:"status"`
	Addresses []Address `xml:"address"`
	Hostnames Hostnames `xml:"hostnames"`
	Ports     Ports     `xml:"ports"`
	Times     Times     `xml:"times"`
}

type Hostname

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

type Hostnames

type Hostnames struct {
	Hostnames []Hostname `xml:"hostname"`
}

type NmapPlugin

type NmapPlugin struct{}

func (NmapPlugin) DiscoverNetworks

func (p NmapPlugin) DiscoverNetworks(conf map[string]interface{}) (res []string, err error)

func (NmapPlugin) HandleScanRequest

func (p NmapPlugin) HandleScanRequest(conf map[string]interface{}, input *formats.ReqInput) (response interface{}, dbEntry formats.DbNetwork)

func (NmapPlugin) ScanNetwork

func (p NmapPlugin) ScanNetwork(conf map[string]interface{}, network string) (dbEntry formats.DbNetwork, err error)

type NmapRun

type NmapRun struct {
	Scanner   string    `xml:"scanner,attr"`
	Args      string    `xml:"args,attr"`
	Start     int       `xml:"start,attr"`
	StartStr  string    `xml:"startstr,attr"`
	Version   string    `xml:"version,attr"`
	ScanInfo  ScanInfo  `xml:"scaninfo"`
	Verbose   Verbose   `xml:"verbose"`
	Debugging Debugging `xml:"debugging"`
	Hosts     []Host    `xml:"host"`
	RunStats  RunStats  `xml:"runstats"`
}

func ParseRun

func ParseRun(filePath string) *NmapRun

type Port

type Port struct {
	Protocol string  `xml:"protocol,attr"`
	PortId   string  `xml:"portid,attr"`
	State    Status  `xml:"state"`
	Service  Service `xml:"service"`
	Script   Script  `xml:"script"`
}

type Ports

type Ports struct {
	ExtraPorts ExtraPorts `xml:"extraports"`
	Ports      []Port     `xml:"port"`
}

type RunStats

type RunStats struct {
	Finished      Finished      `xml:"finished"`
	FinishedHosts FinishedHosts `xml:"hosts"`
}

type ScanInfo

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

type Scanner

type Scanner struct {
	Executable   string
	ReqInput     *formats.ReqInput
	Target       string
	RawArgs      []string
	ComputedArgs []string
	Xml          string
	Results      *NmapRun
	Error        ErrorResponse
	Failed       bool
	Debug        bool
}

func InitScanner

func InitScanner(target string, debug bool) (Scanner, error)

func RequestScanner

func RequestScanner(input *formats.ReqInput, conf map[string]interface{}) (Scanner, error)

func (*Scanner) HandleReturn

func (s *Scanner) HandleReturn(err error, stdout string, stderr string)

func (*Scanner) ReturnFail

func (s *Scanner) ReturnFail(err error, msg string)

func (*Scanner) RunScan

func (s *Scanner) RunScan()

func (*Scanner) SetAckDiscovery

func (s *Scanner) SetAckDiscovery()

func (*Scanner) SetConnectDiscovery

func (s *Scanner) SetConnectDiscovery()

func (*Scanner) SetDebug

func (s *Scanner) SetDebug(debug bool)

func (*Scanner) SetExec

func (s *Scanner) SetExec(executable string)

func (*Scanner) SetHelperInput

func (s *Scanner) SetHelperInput(method string, opts map[string]string)

func (*Scanner) SetPingDiscovery

func (s *Scanner) SetPingDiscovery()

func (*Scanner) SetRawInput

func (s *Scanner) SetRawInput(args []string)

func (*Scanner) SetSynDiscovery

func (s *Scanner) SetSynDiscovery()

func (*Scanner) SetTarget

func (s *Scanner) SetTarget(target string)

func (*Scanner) SetUdpDiscovery

func (s *Scanner) SetUdpDiscovery()

type Script

type Script struct {
	Id     string  `xml:"id,attr"`
	Ouput  string  `xml:"output,attr"`
	Tables []Table `xml:"table"`
}

type Service

type Service struct {
	Name      string `xml:"name,attr"`
	Product   string `xml:"product,attr"`
	Version   string `xml:"version,attr"`
	ExtraInfo string `xml:"extrainfo,attr"`
	Method    string `xml:"method,attr"`
	Conf      string `xml:"conf,attr"`
	Cpe       string `xml:"cpe"`
}

type Status

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

type Table

type Table struct {
	Elems []Elem `xml:"elem"`
}

type Times

type Times struct {
	Srtt   int `xml:"srtt,attr"`
	Rttvar int `xml:"rttvar,attr"`
	To     int `xml:"to,attr"`
}

type Verbose

type Verbose struct {
	Level int `xml:"level,attr"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL