parser

package
v0.0.0-...-63dc462 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const VERSION = "0.2.1"

Variables

This section is empty.

Functions

func AppendIfMissing

func AppendIfMissing(slice []string, key string) []string

func ConvertJSONLtoJSON

func ConvertJSONLtoJSON(input string) string

func GetAllRecordsForKey

func GetAllRecordsForKey(document *jsonquery.Node, key string) []*jsonquery.Node

func GetAllValuesForKey

func GetAllValuesForKey(document *jsonquery.Node, key string) []string

func GetHost

func GetHost(str string) string

func GetJSONDocumentFromFile

func GetJSONDocumentFromFile(filename string) *jsonquery.Node

func GetValueForQueryBoolean

func GetValueForQueryBoolean(document *jsonquery.Node, requestedField string, queryKey string, matchCondition bool) []string

func GetValueForQueryKey

func GetValueForQueryKey(document *jsonquery.Node, requestedField string, queryKey string, query []string) []string

func GetXMLDocumentFromFile

func GetXMLDocumentFromFile(filename string) *xmlquery.Node

func NewLogger

func NewLogger() *logger

func WriteHostsToJSONFile

func WriteHostsToJSONFile(filename string, data []Host)

func WriteToFile

func WriteToFile(filename string, data string)

Types

type Config

type Config struct {
	ProjectsPath string `yaml:"projects_path"`
	PortsXMLFile string `yaml:"ports_xml,omitempty"`
	HostMapping  string `yaml:"host_mapping,omitempty"`
}

type Host

type Host struct {
	IP              string    `json:"ip"`
	Name            string    `json:"hostname""`
	Services        []Service `json:"services"`
	AssociatedNames []string  `json:"associatedNames"`
}

func GetAllHostEntries

func GetAllHostEntries(document *xmlquery.Node, key string) []Host

type NmapParser

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

func NewParser

func NewParser(options *Options) (*NmapParser, error)

func (*NmapParser) Parse

func (p *NmapParser) Parse() error

type Options

type Options struct {
	SettingsFile string
	Project      string
	ServiceJSON  bool
	HTTPDomains  bool
	All          bool
	BaseFolder   string
	Silent       bool
	Version      bool
	NoColor      bool
	Verbose      bool
}

func ParseOptions

func ParseOptions() *Options

ParseOptions parses the command line flags provided by a user

type Project

type Project struct {
	Name string `yaml:"name"`
}

type Service

type Service struct {
	Number      int    `json:"port"`
	Protocol    string `json:"protocol"`
	Name        string `json:"name"`
	State       string `json:"state"`
	Product     string `json:"product,omitempty"`
	Description string `json:"description,omitempty"`
	OS          string `json:"ostype,omitempty"`
}

Jump to

Keyboard shortcuts

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