root@sparrow:~/writeups$ cat smbclient.md
// Active Directory
smbclient
22 Jul 2026
ยท 1 min read
smbclient is an FTP-style SMB (port 445) client: it connects to Windows/Samba shared resources, lists shared folders, and uploads/downloads files, all from the terminal.
| Type | CLI |
| Platform | Kali / Linux |

Connecting to a share
smbclient //<IP>/<share> -N # anonymous
smbclient //<IP>/<share> -U <username>
Listing the server's shares
smbclient -L //<IP> -N
smbclient -L //<IP> -U <username> # with a password if needed
Commands inside smbclient (works like FTP)
| Command | What it does |
|---|---|
ls | List files |
get <file> | Download a file |
put <file> | Upload a file |
cd <folder> | Change directory (remote) |
lcd <local_path> | Change local directory |
!<command> | Run a command on your local machine, e.g. !pwd |
exit | Quit |
Responsible use
These commands are for systems you own or have explicit written authorisation to test (labs, CTFs, contracted engagements). Using them against third-party infrastructure without permission is illegal in most countries.