# Timelapse

**Date**: 30/05/2022

**Difficulty**: EASY

**CTF**: <https://app.hackthebox.com/machines/Timelapse>

***

First of all, let’s test the connectivity with the target machine:

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-db8266a473c4552e94e8b2bdcc230690326ee095%2Ftimelapse0.png?alt=media" alt=""><figcaption></figcaption></figure>

ttl = 127 may indicate that the target machine is a Windows machine.

Let’s launch an nmap scan to detect the open TCP ports on the machine:

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-bdb902ac54844fa0516e2a1e63dfa17ce23f97c6%2Ftimelapse1.png?alt=media" alt=""><figcaption></figcaption></figure>

Wow, the nmap scan reported a lot of open TCP ports… let’s launch a detailed scan in all this ports:

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-919ded3e53227bfc6db803e772d5e85a5e3b8355%2Ftimelapse2.png?alt=media" alt=""><figcaption></figcaption></figure>

Interesting, we have Kerberos in port 88, ldap, http… and other services.

It catches my eye the details of the http service. The ssl certificate contains `dc01.timelapse.htb`. timelapse.htb sounds like a domain and dc01 as the DomainController01 (Computer Name maybe?). Also, the ldap services detail show the domain timelapse.htb0.

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-9e9a56a526e7eb9f3042712918b7a86f40578af3%2Ftimelapse3.png?alt=media" alt=""><figcaption></figcaption></figure>

Let’s add the timelapse.htb domain to /etc/hosts and take a look to the webpage:

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-c4bdfd99b1cf169ec56bc5f28808b3b8c02e8de3%2Ftimelapse4.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-953f3e0b9f4b11d75b23bb774149cc754ef72076%2Ftimelapse5.png?alt=media" alt=""><figcaption></figcaption></figure>

Nothing useful there…

Let’s take a look to ports 135 and 445 (smb):

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-03eb6a8a9c990f5e82c3d17c8eac572dc1cbd0e3%2Ftimelapse6.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-df38133eb5fc55abb638c749158ed629786f1613%2Ftimelapse7.png?alt=media" alt=""><figcaption></figcaption></figure>

Mmm… we have READ permissions on IPC and Shares. Let’s take a look inside:

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-aa832b0bb89c8bce0a0288cf8a03da555c49f348%2Ftimelapse8.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-0f046ddbf5fd2fa66a80159483a03a608c0b6f00%2Ftimelapse9.png?alt=media" alt=""><figcaption></figcaption></figure>

Let’s download that zip file to see the content later:

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-476a4d3b756f33d879e3085114c9783d38917d4a%2Ftimelapse10.png?alt=media" alt=""><figcaption></figcaption></figure>

Let’s see the content of the other folder also:

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-425d3d68d4168f318709310313bf15636a314ab5%2Ftimelapse11.png?alt=media" alt=""><figcaption></figcaption></figure>

Mmmm… let’s download everything:

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-fc18985d5dbde365127a71658ddba225d59c0818%2Ftimelapse12.png?alt=media" alt=""><figcaption></figcaption></figure>

Let’s enumerate IPC$ just in case:

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-3426c477bbfda5fe195c8e3b160dac918a4ae025%2Ftimelapse13.png?alt=media" alt=""><figcaption></figcaption></figure>

I’m not sure if any of this file would be useful, but I’ll keep the list.

Let’s see what was inside the compressed file:

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-04b4f85bf2cae48c83b525d44b9c6eaec2798866%2Ftimelapse14.png?alt=media" alt=""><figcaption></figcaption></figure>

Mmm… the zip is password protected. Maybe we can crack it with John, but before doing that, let’s take a look to the other files:

The .docx files describe the use of a tool called Local Administrator Password Solution that can manage the domain passwords. There is also an .msi installer. Maybe is an application that is installed in the target machine.

Let’s see if we can crack the password of the zip file:

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-c919f583090a6ea9b700949d709ac39d28d7a927%2Ftimelapse15.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-9a698abff31627c381f6fcf0ee24f22122e8ef2e%2Ftimelapse16.png?alt=media" alt=""><figcaption></figcaption></figure>

It was very fast! John cracked successfully the zip password. Let’s unzip it:

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-c5ea5ca0fd0209f1b68b06c2b976b97fe3460c1a%2Ftimelapse17.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-26409a843f1f9a769c56857bff1180fd836df347%2Ftimelapse18.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-fb6e53638cde547117f39ae6808fd7587a9f947e%2Ftimelapse19.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-cf7407a86ce2e711085f1aed5e7100ceb5a25f56%2Ftimelapse20.png?alt=media" alt=""><figcaption></figcaption></figure>

Okay, so I don’t really know what to do with this file and its password… let’s do a bit of research. In [this page](https://www.ibm.com/docs/en/arl/9.7?topic=certification-extracting-certificate-keys-from-pfx-file) and [this one](https://stackoverflow.com/questions/40399690/enter-pem-pass-phrase-when-converting-pkcs12-certificate-into-pem) it’s explained how to extract the keys and certificates from the PFX file.

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-6f4237c11412d73d4993cb567e871f7f0eb551d3%2Ftimelapse21.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-a6b2898a26debbc1641022443b48ca2025e0ddb6%2Ftimelapse22.png?alt=media" alt=""><figcaption></figcaption></figure>

Now, let’s see what can we do with this certificate and key… First of all we have to clean the certificate and key files:

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-cc9fabd38e33e5ffc2f89589a0f6597cd3cd0116%2Ftimelapse23.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-b0072cd6c947f2563d599cb2fd69a774d09b26ad%2Ftimelapse24.png?alt=media" alt=""><figcaption></figcaption></figure>

Apparently we can use the certificate and key to connect to the target machine via SSL using evil-winrm:

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-51eceb882e18cb9f8bb9ae18f099b841effac1c9%2Ftimelapse25.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-17951897fa71c13afa6832a416f8c2581c7405ec%2Ftimelapse26.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-8a2b19757a9100961f138f123dd01d2f37f7e21a%2Ftimelapse27.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-48accdc7d89d1d2cd306c88ccafb78eeb201c5a5%2Ftimelapse28.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-c4e54dca4b8b75f9cc6f63e18b1b1591bb600bee%2Ftimelapse29.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-7f35b1101ce24d4f905593a88a0a79af1c6be918%2Ftimelapse30.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-4610e89ade3311be633ce2477c003acc62716222%2Ftimelapse31.png?alt=media" alt=""><figcaption></figcaption></figure>

Let’s try with an obfuscated version of winPEAS:

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-63851985fda903cc409a26759280ee51e66398c8%2Ftimelapse32.png?alt=media" alt=""><figcaption></figcaption></figure>

Being unable to use winPEAS, let’s enumerate the machine manually:

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-0c6f23b7c5cb2a9502aca173a431e50720916c5e%2Ftimelapse33.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-38aaa5810e966879871127fd4664f70cbb86eaf2%2Ftimelapse34.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-fec7ec1117c8b09b843839c53bb464c8690cc8a7%2Ftimelapse35.png?alt=media" alt=""><figcaption></figcaption></figure>

```bash
whoami
ipconfig /all
netstat -ano |select-string LIST
$so = New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck
$p = ConvertTo-SecureString 'E#################V' -AsPlainText -Force
$c = New-Object System.Management.Automation.PSCredential ('svc_deploy', $p)
invoke-command -computername localhost -credential $c -port 5986 -usessl -
SessionOption $so -scriptblock {whoami}
get-aduser -filter * -properties *
exit
```

let’s execute the same commands:

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-3bcf4bc85856ec0955df4f0f8f150a29ca0f2240%2Ftimelapse36.png?alt=media" alt=""><figcaption></figcaption></figure>

Now we can execute commands as svc\_deploy user… Let’s check the privs of svc\_deploy user:

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-88dbbba3c728b117d44be0f83d081d2b66903d5b%2Ftimelapse37.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-eac792039ec7d41209809131ca9f26bf610400b8%2Ftimelapse38.png?alt=media" alt=""><figcaption></figcaption></figure>

This users is member of LAPS\_Readers group…

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-369542c237cde1f7af2b08f2b14da583553499be%2Ftimelapse39.png?alt=media" alt=""><figcaption></figcaption></figure>

We can see that the admin password of DC01!

With this credentials, let’s try to log as Administrator using evil-winrm:

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-49a527018def9855fa87b191af28f20c4f283f4e%2Ftimelapse40.png?alt=media" alt=""><figcaption></figcaption></figure>

And after some navigation we found the root flag:

<figure><img src="https://3648139271-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDU2KcTfFp1xEzUDMyoAe%2Fuploads%2Fgit-blob-25d7cb5b4442ed3382a1ee7805a345c839db9eae%2Ftimelapse41.png?alt=media" alt=""><figcaption></figcaption></figure>


---

# 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://angellm.gitbook.io/hacknotes/htb/2022/timelapse.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.
