smb

(smb).SMBClient

SMBClient is a client for SMB servers.

Kind: inner class of smb

smbClient.ConnectSMBInfoMode(host, port) ⇒ SMBLog

ConnectSMBInfoMode tries to connect to provided host and port and discover SMB information

Kind: instance method of SMBClient
Returns: SMBLog - - The log of the SMB handshake.
Throws:

  • error - The error encountered during the connection.
ParamTypeDescription
hoststringThe host to connect to.
portstringThe port to connect to.

Example

let m = require('nuclei/smb');
let c = m.SMBClient();
let log = c.ConnectSMBInfoMode('localhost', '445');

smbClient.DetectSMBGhost(host, port) ⇒ boolean

DetectSMBGhost tries to detect SMBGhost vulnerability by using SMBv3 compression feature.

Kind: instance method of SMBClient
Returns: boolean - - The result of the SMBGhost vulnerability detection.
Throws:

  • error - The error encountered during the detection.
ParamTypeDescription
hoststringThe host to connect to.
portstringThe port to connect to.

Example

let m = require('nuclei/smb');
let c = m.SMBClient();
let isVulnerable = c.DetectSMBGhost('localhost', '445');

smbClient.ListSMBv2Metadata(host, port) ⇒ ServiceSMB

ListSMBv2Metadata tries to connect to provided host and port and list SMBv2 metadata.

Kind: instance method of SMBClient
Returns: ServiceSMB - - The metadata of the SMBv2 service.
Throws:

  • error - The error encountered during the listing.
ParamTypeDescription
hoststringThe host to connect to.
portstringThe port to connect to.

Example

let m = require('nuclei/smb');
let c = m.SMBClient();
let metadata = c.ListSMBv2Metadata('localhost', '445');

smbClient.ListShares(host, port, user, password) ⇒ Array.<string>

ListShares tries to connect to provided host and port and list shares by using given credentials.

Kind: instance method of SMBClient
Returns: Array.<string> - - The list of shares.
Throws:

  • error - The error encountered during the listing.
ParamTypeDescription
hoststringThe host to connect to.
portstringThe port to connect to.
userstringThe username for authentication.
passwordstringThe password for authentication.

Example

let m = require('nuclei/smb');
let c = m.SMBClient();
let shares = c.ListShares('localhost', '445', 'user', 'password');

(smb).SMBLog : object

SMBLog is an object containing the log of the SMB handshake.

Kind: inner typedef of smb

(smb).ServiceSMB : object

ServiceSMB is an object containing the metadata of the SMBv2 service.

Kind: inner typedef of smb