# RPC

<https://infinitelogins.com/2020/06/17/enumerating-smb-for-pentesting/>

Testing for Null or Authenticated Sessions:

To test for null sessions, you can use the following command. If it connects, then you'll be able to issue rpc client commands for further enumeration.

```
rpcclient -U "" -N [ip]
```

Have valid credentials? Use them to connect:

```
rpcclient -U <user> 10.10.10.193
```

Once connected, there are various queries you can run.

To enumerate printers:

```
enumprinters
```

To enumerate users and groups:

```
enumdomusers
enumdomgroups
```

The above command will output user/group RIDs. You can pass those into further queries like:

```
querygroup <RID>
querygroupmem <RID>
queryuser <RID>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cel1s0.gitbook.io/offsec-notes/readme/enumeration/rpc.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
