# Subnet Enumeration

CrackMapExec enables us to extract subnet information from Active Directory assuming that we have the following:

* Valid credentials for the domain
* Can query LDAP

We can then use CrackMapExec's `subnets` module against the domain controller to return a list of subnets:

```bash
crackmapexec ldap $ip -d $domain -u $username -p $password -M subnets
```

### References

{% embed url="<https://podalirius.net/en/articles/active-directory-sites-and-subnets-enumeration/>" %}


---

# 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://ttp.parzival.sh/pentesting/infrastructure/networks/subnet-enumeration.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.
