
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
smb-enumerate-share
Advanced tools
Enumeration of SMB shares for Node.js
smb-enumerate-share provides a single function that takes a number of parameters and will return a promise with the available shares on the provided server
$ npm install smb-enumerate-share
smbEnumerateShare(options)Retrieves the shares available on the host given in the options. The options parameter can have the following properties:
host (required) - The host to list the shares of. Can be a name or an ip address.port (optional) - The port to connect to. Defaults to 445.username (optional) - The username of an account on the server. Defaults to guestpassword (optional) - The password of the account. Defaults to emptydomain (optional) - The SMB NT domain. Defaults to WORKGROUPtimeout (optional) - The length of time in milliseconds the connection will wait for a response from the server. Defaults to 5000Options may also be an SMB connection url string of the following format:
smb://[[<domain>;]<username>[:<password>]@]<host>[:<port>][/<path>]
This returns a promise resolving in an array of share objects. Each object has the following properties:
name - The name of the sharehidden - Whether this share is tagged as hidden. These shares normally end in a dollar signtemporary - Whether this share is marked as temporarycomments - Comments on this share set by the servertype - The share type which is one of the following: "DISK_TREE", "PRINT_QUEUE", "COMM_DEVICE" or "IPC"const smbEnumerateShare = require('smb-enumerate-share')
// enumerate shares on host 'myserver'
smbEnumerateShare({host: 'myserver'})
.then(shares => {
for(let share of shares) {
console.log(share.name)
}
})
.catch(err => {
// handle an error
})
// or use the smb url syntax
smbEnumerateShares('smb://admin:test2@myserver/')
.then(shares => console.log(shares))
This package is designed to be small and efficient, which means it does not have proper network package parsing. Problems may occur in non-typical situations. Please report issues in the issue tracker to improve this project.
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.