Service commands
Oct 22, 2026 · Reference
Goal
How to connect to and look around the services I find in a scan. One section per service, and I add to it as I meet new ones.
Related: Ports · Nmap Flags
FTP (File Transfer Protocol), port 21
| Command | What it does |
|---|---|
ftp <ip> | Connect. For anonymous access, user is anonymous with a blank password |
ls | List files |
get <file> | Download a file to my machine |
put <file> | Upload a file |
quit | Leave the ftp prompt |
SMB (Server Message Block), ports 139 and 445
| Command | What it does |
|---|---|
smbclient -L <ip> | List the shares on the host |
smbclient //<ip>/<share> | Connect to one share (a blank password can work) |
ls | List files in the current folder |
cd <dir> | Move into a folder (a D in the listing means it is a directory) |
get <file> | Download a file |
quit | Leave |
ADMIN$, C$ and IPC$ are built-in shares that need real credentials, so the custom-named share is usually the target.
enum4linux <ip> is the go-to for SMB enumeration: it pulls the workgroup, shares, users, groups and password policy, and flags null sessions (login with a blank username and password). It confirms the host is a Samba server but, on newer Kali, usually will not print the exact version for very old SMB1 servers. The same is true of nmap's smb-os-discovery script and Metasploit's smb_version module.
To read the exact version (like Samba 2.2.1a), capture the SMB handshake and look at the Native LAN Manager field of the Session Setup response. Open Wireshark, set the capture interface to the one the target is on (eth1 for me), then run smbclient in a terminal:
smbclient -L //<ip>The SMB packets show up in Wireshark as the connection happens; read the Native LAN Manager field there.
Redis, port 6379
Redis is an in-memory key-value database. Its port, 6379, is not in nmap's top 1000 ports, so a normal scan can miss it.
| Command | What it does |
|---|---|
redis-cli -h <ip> -p 6379 | Connect (without -h it just tries my own machine) |
INFO | Server details; the # Keyspace section shows which databases hold data |
SELECT <n> | Switch to database number n (default is 0) |
KEYS * | List every key in the current database |
TYPE <key> | See a key's data type |
GET <key> | Read a key's value (for a string type) |
