SMB and RPC

RPCCLIENT

rpcclient -U "" -N [IP]
rpcclient -U "Username" -N 10.10.11.42 
  • When connecting via rpcclient

Query

Description

srvinfo

Server information.

enumdomains

Enumerate all domains that are deployed in the network.

querydominfo

Provides domain, server, and user information of deployed domains.

netshareenumall

Enumerates all available shares.

netsharegetinfo <share>

Provides information about a specific share.

enumdomusers

Enumerates all domain users.

queryuser <RID>

Provides information about a specific user.

enumdomgroups

give groups

lookupnames <name>

give SID

querydispinfo

This will extend the amount of information about the users and their descriptions.

  • To add to the group

net rpc group addmem "Target Group" "Target User"  -U "Domain.local"/"Controlled USER"%'Password' -S "Domain Cintroler IP"
  • FOrceChangePasssword

net rpc password "TargetUser" "newP@ssword2022" -U "DOMAIN"/"ControlledUser"%"Password" -S "DomainController"

SMBMAP

  • To recursively enum directories

  • To upload files

SMBCLIENT

for downloading the whole directory (smbmap or smbclient)

mask "" recurse ON prompt OFF mget *

Netexec/ crackmapexec

Impacket-smbclient

  • If we have TGT

Last updated