> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/m/microsoft-dhcp-server.md).

# Microsoft DHCP Server

Microsoft DHCP Server hands out IP addresses on Windows networks. OctoXLabs runs PowerShell over WinRM to read the scopes and leases and adds the leased hosts to the inventory.

## Use cases

* Find hosts that hold a DHCP lease but are missing from your endpoint security tool.

```
Adapters = dhcp-server AND NOT Adapters = falcon-crowdstrike
```

* List every host seen through DHCP leases.

```
Adapters = dhcp-server
```

## Before you begin

### Network

| Source              | Destination                        | Port                | Protocol                        |
| ------------------- | ---------------------------------- | ------------------- | ------------------------------- |
| OctoXLabs connector | Microsoft DHCP Server host (WinRM) | 5985 (configurable) | HTTP (HTTPS if Is Secure is on) |

### Required permissions

| Scope or role                                                           | Permission | Needed for                                          |
| ----------------------------------------------------------------------- | ---------- | --------------------------------------------------- |
| Account that can run PowerShell remotely, member of DHCP Administrators | Read       | `Get-DhcpServerv4Scope` and `Get-DhcpServerv4Lease` |

The baseline asks for an account that can run PowerShell code and has DHCP Admin permission.

## Create credentials in Microsoft DHCP Server

{% stepper %}
{% step %}

### Enable WinRM

Make sure WinRM is reachable on the DHCP server on the port you set.
{% endstep %}

{% step %}

### Prepare the account

Use an account that can run PowerShell remotely and has DHCP Admin permission.
{% endstep %}

{% step %}

### Choose the auth type

Pick the auth type that matches your environment. For Kerberos, set the realm and, if needed, the KDC.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter                | Required | Type                                                                              | Default | Description                                                                                  |
| ------------------------ | -------- | --------------------------------------------------------------------------------- | ------- | -------------------------------------------------------------------------------------------- |
| IP                       | Yes      | String                                                                            | None    | IP address of the Microsoft DHCP Server host.                                                |
| Port                     | No       | Integer                                                                           | `5985`  | WinRM port.                                                                                  |
| Username                 | Yes      | String                                                                            | None    | Account name.                                                                                |
| Password                 | Yes      | String                                                                            | None    | Password.                                                                                    |
| Auth Type                | No       | String: `Basic`, `Certificate`, `NTLM`, `Kerberos`, `Plaintext`, `SSL`, `Credssp` | `NTLM`  | Authentication method.                                                                       |
| Kerberos Realm           | No       | String                                                                            | None    | Realm for Kerberos, for example `CONTOSO.COM`. When empty, it is taken from a UPN user name. |
| KDC IP                   | No       | String                                                                            | None    | IP or host name of the KDC, for Kerberos.                                                    |
| Fetch IPv6               | No       | Boolean                                                                           | `False` | Also read IPv6 scopes and leases.                                                            |
| Is Secure                | No       | Boolean                                                                           | `False` | Use HTTPS.                                                                                   |
| Certificate Verification | No       | Boolean                                                                           | `True`  | Validate the server certificate when Is Secure is on.                                        |

## Troubleshooting

| Error message             | Cause                                                    | Fix                                                          |
| ------------------------- | -------------------------------------------------------- | ------------------------------------------------------------ |
| `Connection test failed.` | Neither HTTP nor HTTPS WinRM session could run `whoami`. | Check the host, port, auth type, account and WinRM settings. |

## Change history
