> For the complete documentation index, see [llms.txt](https://dmcxblue.gitbook.io/red-team-notes-2-0/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dmcxblue.gitbook.io/red-team-notes-2-0/red-team-techniques/privilege-escalation/untitled/time-providers.md).

# Time Providers

Adversaries may abuse time providers to execute DLLs when the system boots. The Windows Time service (W32Time) enables time synchronization across and within domains. W32Time time provides are responsible for retrieving time stamps from hardware/network resources and outputting these values to other network clients.

Time providers are implemented as dynamic-link libraries (DLLs) that are registered in the subkeys of HKEY\_LOCAL\_MACHINE\System\CurrentControlSet\Services\W32Time\TimeProviders\\. The time provider manager, directed by the service control manager, loads and starts time providers listed and enabled under this key at system startup and/or whenever parameters are changed.

The Windows Time Service (32Time) synchronizes the date and time for all computers running in Active Directory Domain Services (AD DS). Time synchronization is critical for the proper operation of many Windows services and line-of-business applications. The Windows Time service uses the Network Time Protocol (NTP) to synchronize computer clocks on the network. NTP ensures that an accurate clock value, or timestamp, can be assigned to network validation and resources access requests.

This approach requires Administrator Privileges as this resides in the System32 folder.

Will add a Registry Key that will call our malicious DLL File

Administrator Cmd:

![](https://gblobscdn.gitbook.com/assets%2F-MRh03Vwd4nuiUi3Oje7%2F-MRhHFLvttKgY6bV3sia%2F-MRhILv-8HSh4s5_gn14%2Fimage.png?alt=media\&token=9d491b21-0d5c-425e-9ebd-d9e297109cef)

There is an already Registered Key so I will just accept to overwrite the DLLs values.

We can view the Service with the sc.exe command and query the properties.

![](https://gblobscdn.gitbook.com/assets%2F-MRh03Vwd4nuiUi3Oje7%2F-MRhHFLvttKgY6bV3sia%2F-MRhILAfemRqHWCjO0Ek%2Fimage.png?alt=media\&token=2fdd9a4f-4737-486e-907c-eebfb69dfb77)

We see that it's currently running let us stop it and start the service back up again but this time we will be gaining a reverse shell from this technique.

Our Listener:

![](https://gblobscdn.gitbook.com/assets%2F-MRh03Vwd4nuiUi3Oje7%2F-MRhHFLvttKgY6bV3sia%2F-MRhIMuVRY5J2Un9hRyz%2Fimage.png?alt=media\&token=76ee7b0c-22d2-455f-84ea-590b2b347f37)

Service stopped and started:

![](https://gblobscdn.gitbook.com/assets%2F-MRh03Vwd4nuiUi3Oje7%2F-MRhHFLvttKgY6bV3sia%2F-MRhINfa2LXvwLsIOP1b%2Fimage.png?alt=media\&token=2d6915d2-8762-49ac-a13f-fbc65fe6b7a7)

Shell:

![](https://gblobscdn.gitbook.com/assets%2F-MRh03Vwd4nuiUi3Oje7%2F-MRhHFLvttKgY6bV3sia%2F-MRhIOURprXUYGtH84aq%2Fimage.png?alt=media\&token=52d927b3-d5e1-4d9b-9f19-960a8fe61837)

References:

​<https://pentestlab.blog/2019/10/22/persistence-time-providers/>​

​<https://docs.microsoft.com/en-us/windows-server/networking/windows-time-service/windows-time-service-top>​


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://dmcxblue.gitbook.io/red-team-notes-2-0/red-team-techniques/privilege-escalation/untitled/time-providers.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
