smb

package
v3.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT, Apache-2.0 Imports: 14 Imported by: 2

Documentation

Overview

Warning - This is generated code

Warning - This is generated code

Warning - This is generated code

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SMBClient

type SMBClient struct{}

SMBClient is a client for SMB servers. Internally client uses github.com/zmap/zgrab2/lib/smb/smb driver. github.com/projectdiscovery/go-smb2 driver @example ```javascript const smb = require('nuclei/smb'); const client = new smb.SMBClient(); ```

func (*SMBClient) ConnectSMBInfoMode

func (c *SMBClient) ConnectSMBInfoMode(host string, port int) (*smb.SMBLog, error)

ConnectSMBInfoMode tries to connect to provided host and port and discovery SMB information Returns handshake log and error. If error is not nil, state will be false @example ```javascript const smb = require('nuclei/smb'); const client = new smb.SMBClient(); const info = client.ConnectSMBInfoMode('acme.com', 445); log(to_json(info)); ```

func (*SMBClient) DetectSMBGhost

func (c *SMBClient) DetectSMBGhost(host string, port int) (bool, error)

DetectSMBGhost tries to detect SMBGhost vulnerability by using SMBv3 compression feature. If the host is vulnerable, it returns true. @example ```javascript const smb = require('nuclei/smb'); const isSMBGhost = smb.DetectSMBGhost('acme.com', 445); ```

func (*SMBClient) ListSMBv2Metadata

func (c *SMBClient) ListSMBv2Metadata(host string, port int) (*plugins.ServiceSMB, error)

ListSMBv2Metadata tries to connect to provided host and port and list SMBv2 metadata. Returns metadata and error. If error is not nil, state will be false @example ```javascript const smb = require('nuclei/smb'); const client = new smb.SMBClient(); const metadata = client.ListSMBv2Metadata('acme.com', 445); log(to_json(metadata)); ```

func (*SMBClient) ListShares

func (c *SMBClient) ListShares(host string, port int, user, password string) ([]string, error)

ListShares tries to connect to provided host and port and list shares by using given credentials. Credentials cannot be blank. guest or anonymous credentials can be used by providing empty password. @example ```javascript const smb = require('nuclei/smb'); const client = new smb.SMBClient(); const shares = client.ListShares('acme.com', 445, 'username', 'password');

for (const share of shares) {
	  log(share);
}

```

Jump to

Keyboard shortcuts

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