7.4 KiB
HackTheBox-Atom
Rustscan
PORT STATE SERVICE REASON VERSION
80/tcp open http syn-ack ttl 127 Apache httpd 2.4.46 ((Win64) OpenSSL/1.1.1j PHP/7.3.27)
| http-methods:
| Supported Methods: GET POST OPTIONS HEAD TRACE
|_ Potentially risky methods: TRACE
|_http-server-header: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/7.3.27
|_http-title: Heed Solutions
135/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC
443/tcp open ssl/http syn-ack ttl 127 Apache httpd 2.4.46 ((Win64) OpenSSL/1.1.1j PHP/7.3.27)
| http-methods:
| Supported Methods: GET POST OPTIONS HEAD TRACE
|_ Potentially risky methods: TRACE
|_http-server-header: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/7.3.27
|_http-title: Heed Solutions
| ssl-cert: Subject: commonName=localhost
| Issuer: commonName=localhost
| Public Key type: rsa
| Public Key bits: 1024
| Signature Algorithm: sha1WithRSAEncryption
| Not valid before: 2009-11-10T23:48:47
| Not valid after: 2019-11-08T23:48:47
| MD5: a0a4 4cc9 9e84 b26f 9e63 9f9e d229 dee0
| SHA-1: b023 8c54 7a90 5bfa 119c 4e8b acca eacf 3649 1ff6
445/tcp open microsoft-ds syn-ack ttl 127 Windows 10 Pro 19042 microsoft-ds (workgroup: WORKGROUP)
5985/tcp open http syn-ack ttl 127 Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
6379/tcp open redis syn-ack ttl 127 Redis key-value store
7680/tcp open pando-pub? syn-ack ttl 127
PORT 135/445 (SMB)
We can see which shares are there
![](https://imgur.com/uD8EngL.png)
Now to see which we can read as anonymous
![](https://imgur.com/bngVqSx.png)
It seems we can read and write Software_Updates
share
![](https://imgur.com/h3lc2bM.png)
There's a document available too so let's download it
![](https://imgur.com/AxiJUHM.png)
So the document tells about a note taking application named Heed
and it's a client based application there's no interaction with the server but it does get's an update though client's folder and we have seen three client's folder i.e client1,client2,client3, so let's just visit port 80
![](https://imgur.com/NfKZMLg.png)
![](https://imgur.com/oxSqoZB.png)
PORT 80 (HTTP)
![](https://imgur.com/SUgIsXr.png)
Scrolling a bit down we can see a download option and an email MrR3boot@atom.htb
![](https://imgur.com/YoOCKt5.png)
So first let's add the domain atom.htb
to /etc/hosts
file and fuzz for subdomains and also to fuzz for files and directories using gobuster
![](https://imgur.com/RJ1edoR.png)
Running gobuster to fuzz for files
![](https://imgur.com/XKu2Hvm.png)
Fuzzing for subdomains
![](https://imgur.com/mwcwrls.png)
Didn't find one so we would just have to download the heed note taking application
![](https://imgur.com/mwcwrls.png)
![](https://imgur.com/nZm0guT.png)
![](https://imgur.com/N4wXWBY.png)
So I had to switch to my windows machine as this was a windows application
![](https://i.imgur.com/UOFwOB1.png)
![](https://i.imgur.com/xbIBPjn.png)
This tells us that this is an electron application
![](https://i.imgur.com/xbIBPjn.png)
![](https://i.imgur.com/zvjBUWL.png)
So knowing that it's an electron app I searched on goolge for getting a RCE through it
![](https://imgur.com/x167NBE.png)
![](https://imgur.com/DAszhh0.png)
It says here that it will update from latest.yml
![](https://imgur.com/CzgMinR.png)
![](https://imgur.com/0m0z1NF.png)
Exploit
So first we generate our payload with name having a single quote
![](https://imgur.com/dwDF7M2.png)
Now we need to generate a sha512 sum hash and encode it to hex and then further encode it to base64
![](https://imgur.com/13mxXzP.png)
093RMZA6MwaxL21rB2eTb14NNIH8+bfGjldpX5bFLvlALJJpKvi8Gm+TGXmqW/ROJsy+TEcGyDQk
djSS7Avnow==
Host this payload on your local machine using python3
![](https://imgur.com/NgsksYv.png)
Create a latest.yml
file
![](https://imgur.com/3PIKSTm.png)
Upload the yml file in smb share
![](https://imgur.com/vVm6rdo.png)
Run the meterpeter listener
![](https://imgur.com/5jWyyWX.png)
![](https://imgur.com/XAydhPm.png)
So for escalating privileges I first ran getprivs
to show privileges for the current user
![](https://imgur.com/QtKKaxR.png)
Going into Program Files
![](https://imgur.com/mbLqD4B.png)
Further going into Redis
folder
![](https://imgur.com/2n52hBM.png)
We see redis.windows-service.conf
and there's a password for redis cli
![](https://i.imgur.com/5XghlFZ.png)
![](https://imgur.com/tjdBlpp.png)
Run info
command
![](https://imgur.com/kgLEeNM.png)
![](https://imgur.com/64uCZrL.png)
![](https://imgur.com/LFafaYJ.png)
Redis stores data in database and we can there is only on database , we can access it by the command SELECT 0
![](https://imgur.com/yfVbwEj.png)
![](https://imgur.com/42W7KDP.png)
Now to access the KEY we need to first know it's data type, in redis there are 5 data types
- String
- Hash
- List
- Sets
- Sorted Sets
![](https://imgur.com/c5r8BUx.png)
![](https://imgur.com/eRIHg0u.png)
![](https://imgur.com/laWYI3Z.png)
Going to jason's Download
direcotry we can find PortableKanban
which is a tak managment tool for windows
![](https://imgur.com/U7fFncB.png)
Reading the User Guide.pdf
portable kanban we can only user available is Administartor
but we can't get the passoword as the guide says if the data is lost there is not way in retreiving it
![](https://imgur.com/LR7OxV0.png)
We can see that we are on the last version of portable kanban
![](https://i.imgur.com/3wZosbE.png)
So this is the encrypted password which we can't retrieve
![](https://i.imgur.com/iXDmZeQ.png)
But there's an exploit for it
![](https://imgur.com/KuTxxzD.png)
Now we extracted the encrypted portable kanban passowrd from redis key and we need to save the contents in a file PortableKanban.pk3
but on running the exploit it showed errors so we may need to edit the exploit
![](https://imgur.com/mUDE8eY.png)
After editing it will decrypt the password
![](https://i.imgur.com/0PICIdt.png)
![](https://imgur.com/AbhqXWl.png)
Now since port 5985 was open which is for winrm we will use evilwinrm
to login
![](https://imgur.com/w41mfJS.png)
Evilwinrm was acting wierd so I downloaded the windows payload I used earlier to get foothold and ran the payload with cmd while listening at meterpreter for connections
![](https://imgur.com/Drzdt25.png)
![](https://imgur.com/Q8jJ29o.png)