Class: SMBClient
smb.SMBClient SMBClient is a client for SMB servers. Internally client uses github.com/zmap/zgrab2/lib/smb/smb driver. github.com/projectdiscovery/go-smb2 driverExample
Table of contents
Constructors
Methods
Constructors
constructor
• new SMBClient():SMBClient
Returns
SMBClient
Defined in
smb.ts:17Methods
ConnectSMBInfoMode
▸ ConnectSMBInfoMode(host
, port
): SMBLog
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
Parameters
Name | Type |
---|---|
host | string |
port | number |
Returns
SMBLog
Example
Defined in
smb.ts:31DetectSMBGhost
▸ DetectSMBGhost(host
, port
): boolean
DetectSMBGhost tries to detect SMBGhost vulnerability
by using SMBv3 compression feature.
If the host is vulnerable, it returns true.
Parameters
Name | Type |
---|---|
host | string |
port | number |
Returns
boolean
Example
Defined in
smb.ts:84ListSMBv2Metadata
▸ ListSMBv2Metadata(host
, port
): ServiceSMB
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
Parameters
Name | Type |
---|---|
host | string |
port | number |
Returns
ServiceSMB
Example
Defined in
smb.ts:49ListShares
▸ ListShares(host
, port
, user
): string
[]
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.
Parameters
Name | Type |
---|---|
host | string |
port | number |
user | string |
Returns
string
[]
Example