Methods
ConnectSMBInfoMode(host, port) → {SMBLog}
ConnectSMBInfoMode tries to connect to provided host and port and discover SMB information
Parameters:
Name | Type | Description |
---|---|---|
host | string | The host to connect to. |
port | string | The port to connect to. |
- Source
Throws:
- - The error encountered during the connection.
- Type
- error
Returns:
- The log of the SMB handshake.
- Type:
- SMBLog
Example
let m = require('nuclei/smb');
let c = m.SMBClient();
let log = c.ConnectSMBInfoMode('localhost', '445');
DetectSMBGhost(host, port) → {boolean}
DetectSMBGhost tries to detect SMBGhost vulnerability by using SMBv3 compression feature.
Parameters:
Name | Type | Description |
---|---|---|
host | string | The host to connect to. |
port | string | The port to connect to. |
- Source
Throws:
- - The error encountered during the detection.
- Type
- error
Returns:
- The result of the SMBGhost vulnerability detection.
- Type:
- boolean
Example
let m = require('nuclei/smb');
let c = m.SMBClient();
let isVulnerable = c.DetectSMBGhost('localhost', '445');
ListSMBv2Metadata(host, port) → {ServiceSMB}
ListSMBv2Metadata tries to connect to provided host and port and list SMBv2 metadata.
Parameters:
Name | Type | Description |
---|---|---|
host | string | The host to connect to. |
port | string | The port to connect to. |
- Source
Throws:
- - The error encountered during the listing.
- Type
- error
Returns:
- The metadata of the SMBv2 service.
- Type:
- ServiceSMB
Example
let m = require('nuclei/smb');
let c = m.SMBClient();
let metadata = c.ListSMBv2Metadata('localhost', '445');
ListShares(host, port, user, password) → {Array.<string>}
ListShares tries to connect to provided host and port and list shares by using given credentials.
Parameters:
Name | Type | Description |
---|---|---|
host | string | The host to connect to. |
port | string | The port to connect to. |
user | string | The username for authentication. |
password | string | The password for authentication. |
- Source
Throws:
- - The error encountered during the listing.
- Type
- error
Returns:
- The list of shares.
- Type:
- Array.<string>
Example
let m = require('nuclei/smb');
let c = m.SMBClient();
let shares = c.ListShares('localhost', '445', 'user', 'password');