Skip to content

rpcclient

100 commands

Samba’s MS-RPC client. Queries domain users, groups, password policies and SIDs over SMB, often with a null or low-privilege session.

  • MS-RPC
  • SMB
  • Active Directory

Install rpcclient

sudo apt install smbclient

Basic Connection5

rpcclient -U "" 192.168.1.10

Connects to the target RPC service using a null session without authentication.

rpcclient -U "" -N 192.168.1.10

Connects using a null session and explicitly suppresses the password prompt.

rpcclient -U "%" 192.168.1.10

Attempts to connect with a blank username and blank password shorthand.

rpcclient -U "user" 192.168.1.10

Connects specifying a username and prompts interactively for the password.

Link
rpcclient -U "user%password" 192.168.1.10

Connects using a username and password provided inline for automation.

Link

Authentication3

rpcclient -W WORKGROUP -U "user%pass" 192.168.1.10

Authenticates to a specific workgroup or domain controller.

Link
rpcclient -k 192.168.1.10

Uses Kerberos authentication instead of NTLM (requires valid ticket).

Link
rpcclient --pw-nt-hash "hash" -U "user" 192.168.1.10

Performs a Pass-the-Hash attack by authenticating with an NT hash.

Link

Transport Configuration3

rpcclient -I 192.168.1.10 target_netbios_name

Forces the destination IP address while resolving a specific NetBIOS name.

Link
rpcclient -p 445 192.168.1.10

Connects explicitly over SMB port 445 (TCP).

Link
rpcclient -p 139 192.168.1.10

Connects explicitly over NetBIOS Session port 139 (TCP).

Link

Security Options2

rpcclient -S on 192.168.1.10

Enforces SMB signing state to 'on' for the connection.

Link
rpcclient -P 192.168.1.10

Requests SMB sealing (encryption) for the connection.

Link

Batch Mode2

rpcclient -c "command" 192.168.1.10

Executes a single RPC command non-interactively and exits.

Link
rpcclient -c "cmd1; cmd2" 192.168.1.10

Executes multiple RPC commands in sequence separated by semicolons.

Link

Server Information1

rpcclient -c "srvinfo" 192.168.1.10

Retrieves basic server information including OS version and server type.

Link

OS and Server Information1

rpcclient -c "srvinfo 101" 192.168.1.10

Retrieves Level 101 server information for detailed versioning.

Link

Shares and Resources3

rpcclient -c "netshareenum" 192.168.1.10

Enumerates available network shares on the target using Level 1 info.

Link
rpcclient -c "netshareenumall" 192.168.1.10

Enumerates all shares including administrative hidden shares (C$, IPC$, etc).

Link
rpcclient -c "netsharegetinfo ShareName" 192.168.1.10

Retrieves detailed information about a specific share.

Link

Session Enumeration1

rpcclient -c "netsessenum" 192.168.1.10

Lists active sessions established by users on the target machine.

Link

File Enumeration1

rpcclient -c "netfileenum" 192.168.1.10

Lists files currently opened by remote users.

Link

Disk Enumeration1

rpcclient -c "netdiskenum" 192.168.1.10

Enumerates physical disk drives associated with shares.

Link

Domain Information1

rpcclient -c "dsroledominfo" 192.168.1.10

Displays the role of the server within the domain (e.g., PDC, Backup, Member).

Link

LSA Enumeration1

rpcclient -c "lsaquery" 192.168.1.10

Queries the LSA policy handle to retrieve the Domain SID and Name.

Link

SID Lookup2

rpcclient -c "lookupnames username" 192.168.1.10

Resolves a username to its corresponding SID (Security Identifier).

Link
rpcclient -c "lookupsids SID" 192.168.1.10

Resolves a specific SID back to its username or group name.

Link

Privilege Enumeration1

rpcclient -c "enumprivs" 192.168.1.10

Enumerates all privileges supported by the system's LSA.

Link

Trust Enumeration1

rpcclient -c "enumtrusts" 192.168.1.10

Lists trusted domains and their SIDs.

Link

Account Rights1

rpcclient -c "enumacctrights" 192.168.1.10

Enumerates privileges assigned to accounts.

Link

Context Information1

rpcclient -c "getusername" 192.168.1.10

Returns the username of the current authenticated session context.

Link

User Enumeration4

rpcclient -c "enumdomusers" 192.168.1.10

Lists all domain users with their RIDs.

Link
rpcclient -c "querydispinfo" 192.168.1.10

Lists users with full names and descriptions (often works when enumdomusers fails).

Link
rpcclient -c "querydispinfo2" 192.168.1.10

Alternative query info level 2 for user enumeration.

Link
rpcclient -c "querydispinfo3" 192.168.1.10

Alternative query info level 3 for user enumeration.

Link

Group Enumeration2

rpcclient -c "enumdomgroups" 192.168.1.10

Lists all global domain groups and their RIDs.

Link
rpcclient -c "enumalsgroups domain" 192.168.1.10

Enumerates alias (local) groups, often used with 'builtin' to find Administrators.

Link

User Details3

rpcclient -c "queryuser RID" 192.168.1.10

Retrieves detailed account information (logon time, expiration, path) for a user RID.

Link
rpcclient -c "queryusergroups RID" 192.168.1.10

Lists the groups that a specific user RID belongs to.

Link
rpcclient -c "queryuseraliases BuiltinRID DomainSID" 192.168.1.10

Queries which aliases a specific user SID belongs to.

Link

Group Details1

rpcclient -c "querygroup RID" 192.168.1.10

Retrieves detailed information about a specific global group.

Link

Group Membership2

rpcclient -c "querygroupmem RID" 192.168.1.10

Lists the members (RIDs) of a specific global domain group.

Link
rpcclient -c "queryaliasmem RID" 192.168.1.10

Lists the members of a local alias group (e.g., RID 544 for Administrators).

Link

Alias Details1

rpcclient -c "queryaliasinfo RID" 192.168.1.10

Retrieves information about a specific alias group.

Link

Password Policy2

rpcclient -c "getdompwinfo" 192.168.1.10

Retrieves the domain password policy (complexity, min length, history).

Link
rpcclient -c "getusrdompwinfo RID" 192.168.1.10

Retrieves password policy information specific to a user RID.

Link

Printer Enumeration5

rpcclient -c "enumprinters" 192.168.1.10

Enumerates printers installed on the remote system.

Link
rpcclient -c "enumports" 192.168.1.10

Enumerates printer ports.

Link
rpcclient -c "enumdrivers" 192.168.1.10

Enumerates installed printer drivers.

Link
rpcclient -c "enumjobs" 192.168.1.10

Enumerates current print jobs in the queue.

Link
rpcclient -c "getprinter PrinterName" 192.168.1.10

Retrieves specific configuration details for a named printer.

Link

DFS Enumeration1

rpcclient -c "dfsquery" 192.168.1.10

Queries Distributed File System (DFS) information.

Link

Service Enumeration1

rpcclient -c "enumservices" 192.168.1.10

Enumerates services running on the remote host (requires specific access).

Link

Logon Information2

rpcclient -c "netlogon" 192.168.1.10

Attempts to trigger a netlogon event.

Link
rpcclient -c "logonctrl2" 192.168.1.10

Retrieves logon control information using version 2 protocol.

Link

Domain Info2

rpcclient -c "querydominfo" 192.168.1.10

Queries general domain information.

Link
rpcclient -c "dsenumdomtrusts" 192.168.1.10

Enumerates domain trusts using Directory Service RPC calls.

Link

Red Team / Account Creation2

rpcclient -c "createdomuser username" 192.168.1.10

Creates a new domain user (requires administrative privileges).

Link
rpcclient -c "deletedomuser username" 192.168.1.10

Deletes a domain user (requires administrative privileges).

Link

Red Team / Groups2

rpcclient -c "adddomgroupmem GroupRID UserRID" 192.168.1.10

Adds a user RID to a domain group RID (requires privileges).

Link
rpcclient -c "deldomgroupmem GroupRID UserRID" 192.168.1.10

Removes a user RID from a domain group RID (requires privileges).

Link

Red Team / Passwords1

rpcclient -c "setuserinfo2 RID 24 'password'" 192.168.1.10

Resets a user's password directly via RPC (Info level 24).

Link

RID Cycling1

rpcclient -c "lookupsids S-1-5-21-X-X-500; lookupsids S-1-5-21-X-X-501" 192.168.1.10

Manual RID cycling example checking common RIDs 500 and 501.

Link

Security Testing1

rpcclient -c "samlogon username" 192.168.1.10

Attempts a SAM logon to test account validity.

Link

Time Information1

rpcclient -c "nettime" 192.168.1.10

Queries the remote server's system time.

Link

Registry (Simulated)1

rpcclient -c "shutdown" 192.168.1.10

Attempts to shut down the remote server via RPC (rarely works, dangerous).

Link

Debug Mode2

rpcclient -d 3 -U "" -N 192.168.1.10

Runs rpcclient with debug level 3 for troubleshooting connection issues.

Link
rpcclient -d 10 -U "" 192.168.1.10

Runs with maximum debug verbosity (Level 10) for deep packet inspection.

Link

Scripting1

rpcclient -c "querydispinfo" 192.168.1.10 | grep "Name:"

Example of piping rpcclient output for clean user list extraction.

Link

LSA Secrets1

rpcclient -c "getprimarydomain" 192.168.1.10

Retrieves the primary domain name of the target.

Link

Configuration1

rpcclient -s /etc/samba/smb.conf 192.168.1.10

Uses a custom Samba configuration file for the client connection.

Link

Timeout Configuration1

rpcclient -t 10 -U "" 192.168.1.10

Sets the connection timeout to 10 seconds.

Link

Advanced1

rpcclient -c "getremotetod" 192.168.1.10

Gets the Time of Day (TOD) from the remote server.

Link

LSA Info1

rpcclient -c "lsaquerysecobj" 192.168.1.10

Queries LSA security objects.

Link

Group Creation1

rpcclient -c "createdomgroup GroupName" 192.168.1.10

Creates a new domain group (requires privileges).

Link

Group Deletion1

rpcclient -c "deletedomgroup GroupName" 192.168.1.10

Deletes a domain group (requires privileges).

Link

Alias Creation1

rpcclient -c "createalias AliasName" 192.168.1.10

Creates a new alias (local group) on the target.

Link

Alias Deletion1

rpcclient -c "deletealias AliasName" 192.168.1.10

Deletes an alias (local group) from the target.

Link

Red Team / Alias Member2

rpcclient -c "addaliasmem AliasRID UserSID" 192.168.1.10

Adds a user to a local alias group (e.g. adding a user to Administrators).

Link
rpcclient -c "delaliasmem AliasRID UserSID" 192.168.1.10

Removes a user from a local alias group.

Link

RPC Endpoint Mapper1

rpcclient -c "epmapper" 192.168.1.10

Enumerates endpoints from the Endpoint Mapper (EPM).

Link

Monitor1

rpcclient -c "enummonitor" 192.168.1.10

Enumerates print monitors.

Link

Forms1

rpcclient -c "enumforms" 192.168.1.10

Enumerates printer forms.

Link

Service Info1

rpcclient -c "queryservice ServiceName" 192.168.1.10

Queries the status and config of a specific service.

Link

Service Control2

rpcclient -c "stopservice ServiceName" 192.168.1.10

Stops a remote service (requires Admin).

Link
rpcclient -c "startservice ServiceName" 192.168.1.10

Starts a remote service (requires Admin).

Link

DFS1

rpcclient -c "dfsgetinfo Share" 192.168.1.10

Gets info about a DFS share.

Link

User Rights2

rpcclient -c "lsaaddacctrights SID Right" 192.168.1.10

Grants a specific privilege/right to a SID.

Link
rpcclient -c "lsaremoveacctrights SID Right" 192.168.1.10

Revokes a specific privilege/right from a SID.

Link

LSA Enum1

rpcclient -c "lsalookupprivvalue Privilege" 192.168.1.10

Looks up the LUID value for a named privilege.

Link

Registry (WinReg)1

rpcclient -c "enumkey KeyHandle" 192.168.1.10

Enumerates registry keys from an open handle (advanced, requires openkey).

Link

Network Interface1

rpcclient -c "netr_ServerGetInfo" 192.168.1.10

Raw RPC call to get server info (similar to srvinfo but via netr).

Link

Blue Team Validation2

rpcclient -c "getdompwinfo" 192.168.1.10

Validation: Checks if the password policy is too weak (e.g., no complexity).

Link
rpcclient -c "enumdomusers" 192.168.1.10

Validation: Checks if Null Session allows dumping the entire user list.

Link

Combined Enumeration1

rpcclient -c "querydominfo; enumdomusers; enumdomgroups" 192.168.1.10

Runs a rapid triage sequence to get domain info, users, and groups in one go.

Link

Interactive Shell1

rpcclient -U "user" 192.168.1.10

Drops into the interactive rpcclient shell for manual exploration.

Link

Printer Driver1

rpcclient -c "getdriver DriverName" 192.168.1.10

Gets info about a specific printer driver.

Link

DFS Enum1

rpcclient -c "dfsnumber" 192.168.1.10

Returns the number of DFS shares available.

Link

FSRVP (Shadow Copy)1

rpcclient -c "fss_is_path_supported SharePath" 192.168.1.10

Checks if a share supports Shadow Copy (FSRVP).

Link

Incident Response1

rpcclient -c "netsessenum; netfileenum" 192.168.1.10

Snapshots active sessions and open files to identify suspicious activity.

Link