mongodb

package
v0.0.0-...-64a4400 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: Apache-2.0, ISC Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OP_REPLY        = 1
	OP_UPDATE       = 2001
	OP_INSERT       = 2002
	RESERVED        = 2003
	OP_QUERY        = 2004
	OP_GET_MORE     = 2005
	OP_DELETE       = 2006
	OP_KILL_CURSORS = 2007
	OP_COMMAND      = 2010
	OP_COMMANDREPLY = 2011
	OP_MSG          = 2013

	QUERY_RESERVED    = 1
	QUERY_TAILABLEC   = 2
	QUERY_SLAVEOK     = 4
	QUERY_OPLOGREPLAY = 8
	QUERY_NOCTIMEOUT  = 16
	QUERY_AWAITDATA   = 32
	QUERY_EXHAUST     = 64
	QUERY_PARTIAL     = 128

	QUERY_RESP_CUR_NOTFOUND = 1
	QUERY_RESP_FAILED       = 2
	QUERY_RESP_SHARD_STALE  = 4
	QUERY_RESP_AWAIT_CAP    = 8

	MSGHEADER_LEN = 16
)

Variables

This section is empty.

Functions

func RegisterModule

func RegisterModule()

RegisterModule registers the zgrab2 module.

Types

type BuildEnvironment_t

type BuildEnvironment_t struct {
	Distmod    string `bson:"distmod,omitempty" json:"dist_mod,omitempty"`
	Distarch   string `bson:"distarch,omitempty" json:"dist_arch,omitempty"`
	Cc         string `bson:"cc,omitempty" json:"cc,omitempty"`
	CcFlags    string `bson:"ccflags,omitempty" json:"cc_flags,omitempty"`
	Cxx        string `bson:"cxx,omitempty" json:"cxx,omitempty"`
	CxxFlags   string `bson:"cxxflags,omitempty" json:"cxx_flags,omitempty"`
	LinkFlags  string `bson:"linkflags,omitempty" json:"link_flags,omitempty"`
	TargetArch string `bson:"target_arch,omitempty" json:"target_arch,omitempty"`
	TargetOS   string `bson:"target_os,omitempty" json:"target_os,omitempty"`
}

BuildEnvironment_t holds build environment information returned by scan.

type BuildInfo_t

type BuildInfo_t struct {
	Version          string             `bson:"version,omitempty" json:"version,omitempty"`
	GitVersion       string             `bson:"gitVersion,omitempty" json:"git_version,omitempty"`
	BuildEnvironment BuildEnvironment_t `bson:"buildEnvironment,omitempty" json:"build_environment,omitempty"`
}

BuildInfo_t holds the data returned by the the buildInfo query

type Connection

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

Connection holds the state for a single connection within a scan.

func (*Connection) ReadMsg

func (conn *Connection) ReadMsg() ([]byte, error)

ReadMsg reads a full MongoDB message from the connection.

func (*Connection) Write

func (conn *Connection) Write(data []byte) error

Write writes a full message to the connection.

type Flags

type Flags struct {
	zgrab2.BaseFlags
}

Flags contains mongodb-specific command-line flags.

func (*Flags) Help

func (flags *Flags) Help() string

Help returns the module's help string

func (*Flags) Validate

func (flags *Flags) Validate(args []string) error

Validate checks that the flags are valid

type IsMaster_t

type IsMaster_t struct {
	IsMaster                     bool  `bson:"ismaster" json:"is_master"`
	MaxWireVersion               int32 `bson:"maxWireVersion,omitempty" json:"max_wire_version,omitempty"`
	MinWireVersion               int32 `bson:"minWireVersion,omitempty" json:"min_wire_version,omitempty"`
	MaxBsonObjectSize            int32 `bson:"maxBsonObjectSize,omitempty" json:"max_bson_object_size,omitempty"`
	MaxWriteBatchSize            int32 `bson:"maxWriteBatchSize,omitempty" json:"max_write_batch_size,omitempty"`
	LogicalSessionTimeoutMinutes int32 `bson:"logicalSessionTimeoutMinutes,omitempty" json:"logical_session_timeout_minutes,omitempty"`
	MaxMessageSizeBytes          int32 `bson:"maxMessageSizeBytes,omitempty" json:"max_message_size_bytes,omitempty"`
	ReadOnly                     bool  `bson:"readOnly" json:"read_only"`
}

IsMaster_t holds the data returned by an isMaster query

type Module

type Module struct {
}

Module implements the zgrab2.Module interface

func (*Module) Description

func (module *Module) Description() string

Description returns an overview of this module.

func (*Module) NewFlags

func (module *Module) NewFlags() interface{}

NewFlags provides an empty instance of the flags that will be filled in by the framework

func (*Module) NewScanner

func (module *Module) NewScanner() zgrab2.Scanner

NewScanner provides a new scanner instance

type Result

type Result struct {
	IsMaster  *IsMaster_t  `json:"is_master,omitempty"`
	BuildInfo *BuildInfo_t `json:"build_info,omitempty"`
}

Result holds the data returned by a scan

type Scanner

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

Scanner implements the zgrab2.Scanner interface

func (*Scanner) GetName

func (scanner *Scanner) GetName() string

GetName returns the name of the scanner

func (*Scanner) GetTrigger

func (scanner *Scanner) GetTrigger() string

GetTrigger returns the Trigger defined in the Flags.

func (*Scanner) Init

func (scanner *Scanner) Init(flags zgrab2.ScanFlags) error

Init initializes the scanner

func (*Scanner) InitPerSender

func (scanner *Scanner) InitPerSender(senderID int) error

InitPerSender initializes the scanner for a given sender

func (*Scanner) Protocol

func (s *Scanner) Protocol() string

Protocol returns the protocol identifer for the scanner.

func (*Scanner) Scan

func (scanner *Scanner) Scan(target zgrab2.ScanTarget) (zgrab2.ScanStatus, interface{}, error)

Scan connects to a host and performs a scan.

func (*Scanner) StartScan

func (scanner *Scanner) StartScan(target *zgrab2.ScanTarget) (*scan, error)

StartScan opens a connection to the target and sets up a scan instance for it.

Jump to

Keyboard shortcuts

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