utils

package
v0.0.0-...-30939ed Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendToFile

func AppendToFile(file *os.File, line string) (err error)

AppendToFile : append a line to target file

func CloseFileStream

func CloseFileStream(file *os.File) (err error)

CloseFileStream : Close file when we are done with it

func ExecCmd

func ExecCmd(prog string, args string) (int, error)

ExecCmd : exec shell command and put combined output to stdout (line by line)

func FileToLines

func FileToLines(filepath string) ([]string, error)

FileToLines : Read lines from a text file

func GetFileLength

func GetFileLength(file string) (int, error)

GetFileLength : How many lines does a text file contain

func IsJoomla

func IsJoomla(host string, port int) bool

IsJoomla : Does this server run Joomla?

func IsWordPress

func IsWordPress(host string, port int) bool

IsWordPress : Does this server run WordPress?

func LogError

func LogError(format string, a ...interface{})

LogError : print log in red

func LogSuccess

func LogSuccess(format string, a ...interface{})

LogSuccess : print log in red

func OpenFileStream

func OpenFileStream(filepath string) (file *os.File, err error)

OpenFileStream : open file for writing

func PrintCyan

func PrintCyan(format string, a ...interface{})

PrintCyan : print main msg

func PrintError

func PrintError(format string, a ...interface{})

PrintError : print text in red

func PrintRed

func PrintRed(format string, a ...interface{})

PrintRed : print main msg

func PrintSuccess

func PrintSuccess(format string, a ...interface{})

PrintSuccess : print text in red

func SetCyan

func SetCyan()

SetCyan : make text following go cyan

func UnsetCyan

func UnsetCyan()

UnsetCyan : make text following go back to normal color

func XML2List

func XML2List(xmlfile string, outfile string, filter string)

XML2List : Parse masscan result, pick useful items and save them to a list file

Types

type Address

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

Address : host>address

type Host

type Host struct {
	XMLName xml.Name `xml:"host"`
	Endtime string   `xml:"endtime,attr"`

	Address Address `xml:"address"`
	Ports   Ports   `xml:"ports>port"`
}

Host : host field in XML

type Ports

type Ports []struct {
	Protocol string `xml:"protocol,attr"`
	Portid   string `xml:"portid,attr"`

	State   State   `xml:"state"`
	Service Service `xml:"service"`
}

Ports : host>ports

type Service

type Service struct {
	Name   string `xml:"name,attr"`
	Banner string `xml:"banner,attr"`
}

Service : host>ports>port>service

type State

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

State : host>ports>port>state

Jump to

Keyboard shortcuts

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