Skip to main content

类: SMBClient

smb.SMBClient SMBClient 是一个用于SMB服务器的客户端。 内部客户端使用 github.com/zmap/zgrab2/lib/smb/smb 驱动程序。 github.com/projectdiscovery/go-smb2 驱动程序 示例
const smb = require('nuclei/smb');
const client = new smb.SMBClient();

目录

构造函数

方法

构造函数

constructor

new SMBClient(): SMBClient

返回

SMBClient

定义于

smb.ts:17

方法

ConnectSMBInfoMode

ConnectSMBInfoMode(host, port): SMBLog ConnectSMBInfoMode 尝试连接到提供的主机和端口 并发现SMB信息 返回握手日志和错误。如果错误不为nil, 状态将为false

参数

名称类型
hoststring
portnumber

返回

SMBLog 示例
const smb = require('nuclei/smb');
const client = new smb.SMBClient();
const info = client.ConnectSMBInfoMode('acme.com', 445);
log(to_json(info));

定义于

smb.ts:31

DetectSMBGhost

DetectSMBGhost(host, port): boolean DetectSMBGhost 尝试通过使用SMBv3压缩功能 检测SMBGhost漏洞。 如果主机存在漏洞,则返回true。

参数

名称类型
hoststring
portnumber

返回

boolean 示例
const smb = require('nuclei/smb');
const isSMBGhost = smb.DetectSMBGhost('acme.com', 445);

定义于

smb.ts:84

ListSMBv2Metadata

ListSMBv2Metadata(host, port): ServiceSMB ListSMBv2Metadata 尝试连接到提供的主机和端口 并列出SMBv2元数据。 返回元数据和错误。如果错误不为nil, 状态将为false

参数

名称类型
hoststring
portnumber

返回

ServiceSMB 示例
const smb = require('nuclei/smb');
const client = new smb.SMBClient();
const metadata = client.ListSMBv2Metadata('acme.com', 445);
log(to_json(metadata));

定义于

smb.ts:49

ListShares

ListShares(host, port, user): string[] ListShares 尝试连接到提供的主机和端口 并使用给定的凭据列出共享。 凭据不能为空。访客或匿名凭据 可以通过提供空密码来使用。

参数

名称类型
hoststring
portnumber
userstring

返回

string[] 示例
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);
	}

定义于

smb.ts:69