SMB/CIFS client for accessing and managing file shares on Windows systems, part of the Samba suite of interoperability tools.
smbclient -L {target} -U {username} ๐ target โ ip ๐ username โ user smbclient -L {target} -U {username} Sandbox: execFile · Timeout: 60s
security.ad.share.list security.ad.share.access security.ad.share.download security.ad.file.transfer | Name | Type | Required | Default | Description | Aliases |
|---|---|---|---|---|---|
list | boolean | No | List available shares on target | -L, --list | |
no-pass | boolean | No | Do not prompt for password (null session) | -N, --no-pass | |
username | string | No | - | Username for SMB authentication | -U, --user, --username |
password | string | No | - | Password for SMB authentication | -P, --password |
workgroup | string | No | WORKGROUP | Workgroup or domain name | -W, --workgroup |
ip | string | No | - | Target IP address | -I, --ip |
port | integer | No | 445 | SMB port number | -p, --port |
directory | string | No | - | Change to initial directory | -D, --directory |
command | string | No | - | Execute SMB command non-interactively | -c, --command |
max-protocol | string | No | - | Maximum SMB protocol version | -m, --max-protocol |
encrypt | boolean | No | Require SMB encryption | -e, --encrypt | |
debug | integer | No | 0 | Debug level (0-10) | -d, --debug |
O | boolean | No | - | Socket options | -O, --options |
auth_file | boolean | No | - | Credentials file | --auth-file |
s | boolean | No | - | Config file path | -s, --config |
t | boolean | No | - | Connection timeout | -t, --timeout |
Inputs
network.target.ip Target IP or hostname
credential.username Username for SMB authentication
credential.password Password for SMB authentication
Outputs
security.ad.share.list List of available SMB shares
file.content Downloaded file contents
network_trafficfilesystem_write Produces
security.ad.share.listfile.contentConsumes
network.target.ipcredential.usernamecredential.password| Resource | Value |
|---|---|
| CPU | low |
| Memory | 16 MB |
| Network | low |
| Disk I/O | low |
List shares with null session
smbclient -L 10.10.10.1 -N List shares with authenticated session
smbclient -L 10.10.10.1 -U jdoe Connect to a share and list contents
smbclient //10.10.10.1/C$ -U jdoe -c ls Download a file from a share
smbclient //10.10.10.1/Shared -U jdoe -c "get confidential.docx" Upload a file to a share
smbclient //10.10.10.1/Shared -U jdoe -c "put backdoor.exe" Non-interactive recursive directory listing
smbclient //10.10.10.1/C$/Users -U jdoe -c "recurse;ls" smbclient is a command-line SMB/CIFS client included in the Samba suite, used to access file shares, printers, and named pipes on Windows systems.
| Operation | Command |
|---|---|
| List shares | smbclient -L target -U user |
| Connect to share | smbclient //target/share -U user |
| Download file | smbclient //target/share -U user -c "get file" |
| Upload file | smbclient //target/share -U user -c "put file" |
| Recurse dirs | smbclient //target/share -U user -c "recurse;ls" |
| Null session | smbclient -L target -N |
Once connected, smbclient provides an FTP-like interface: ls, cd, get, put, rm, mkdir, rmdir, recurse, prompt, mask, tar, blocksize, tarmode, setmode, help.