tcp/135 udp/135 — and as (Microsoft) Remote Procedure Call on tcp/593 as web service.
Enumeration
Obtain general information
# rpcinfo -p $target # rpcinfo -s $target
Connect. Hint: auto completion works; enum<tab> returns all enum commands.
rpcclient -U "" $target
Enumerate through all API endpoints with one of the following options.
python /usr/local/bin/rpcdump.py $target | tee rpcdump.txt msf > use auxiliary/scanner/dcerpc/endpoint_mapper nmap -n -sV -p 135 --script=msrpc-enum $target getArch.py -target $target
Check if RPC ports allowing anonymous access
msf > use auxiliary/scanner/dcerpc/hidden
msf > use auxiliary/scanner/dcerpc/management
msf > use auxiliary/scanner/dcerpc/tcp_dcerpc_auditor
See here for a list what the UUIDs mean.
Connect directly to an endpoint via
rpcclient ncacn_ip_tcp:$target[49672]
But in general, you can use rpcclient (see below) to access all endpoints in a shell.
Enumerate with rpc
All users with their password
for up in $(cat users_and_passwords.txt); do username=$(echo $up | cut -d ':' -f 1) password=$(echo $up | cut -d ':' -f 2) echo "$username / $password" rpcclient -U svcorp\\$username%$password $target done;
All users with all passwords
for user in $(cat users.txt); do
for p in $(cat test_passwords.txt); do
echo "$user / $p"
rpcclient -U svcorp\\$user%$p $target;
done;
done;
Enumeration with Impacket tools
Accessing RCP endpoints with rpcclient
- RID Role Identifier
- SID Security Identifier
First, enter
help
to see a description of available endpoints on this system.
Endpoint SAM Remote Protocol
Try Impacket’s samrdump.py.
Enumerate local users: Doesn’t seem to be available. But you can use RID_ENUM.
python3 /opt/ridenum/ridenum.py $target 500 50000 /usr/share/wordlists/seclists/Passwords/Common-Credentials/best110.txt /usr/share/wordlists/seclists/Usernames/top-usernames-shortlist.txt
Enumerate domain users:
enumdomusers
Enumerate domain groups:
enumdomgroups
Details about an user.
queryuser <rid>
Details about a group
querygroup <rid>
Members of a group
querygroupmem <rid>
Other endpoints
enumprivs
System info
srvinfo
Domain name and domain sid (security identifier)
lsaquery
dsenumdomtrusts
Detect network shares
netshareenum
Leave a Reply
You must be logged in to post a comment.