Page cover

Instant

Synopsis

Instant is a medium linux machine created by tahaafarooqarrow-up-right. The instant.htb domain contains the apk file. The reversing of apk file reveals the subdomains and JWT token which is used to read the logs. Abusing the read logs functionality to read the id_rsa of the shirohige user. The /opt directory contains the Solar-PuTTY password protected encrypted .dat file which contains the session and credentials. Decryption the file reveals the root password.

OS
Difficulty
Points
Release Date
Retired Date

Linux

Medium

30

12-10-2024

01-03-2025


Enumeration

Nmap

Starting the nmap scan and found the ssh and http services running.

nmap -p- -Pn -sC -sV --min-rate=1000 10.10.11.37 
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-02-14 09:30 EST
Warning: 10.10.11.37 giving up on port because retransmission cap hit (10).
Nmap scan report for 10.10.11.37
Host is up (0.44s latency).
Not shown: 63941 closed tcp ports (conn-refused), 1592 filtered tcp ports (no-response)
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 9.6p1 Ubuntu 3ubuntu13.5 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   256 31:83:eb:9f:15:f8:40:a5:04:9c:cb:3f:f6:ec:49:76 (ECDSA)
|_  256 6f:66:03:47:0e:8a:e0:03:97:67:5b:41:cf:e2:c7:c7 (ED25519)
80/tcp open  http    Apache httpd 2.4.58
Service Info: Host: instant.htb; OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 216.45 seconds

Add instant.htb in /etc/hosts file.

Web - instant.htb

Instant is a crypto wallet. The website shows instant wallet features and we can download the instant.apk.

File - instant.apk

Downloaded the instant.apk and reversed it using the jadx-gui. It contains the JWT token and mywalletv1.instant.htb subdomain in AdminActivities class.

Text searching the .htb I got another subdomain swagger-ui.instant.htb.

Add both the mywalletv1 and swagger subdomain in /etc/hosts file.

circle-info

To text search go to Navigation > Text Search

Web - swagger-ui.instant.htb

Swagger (software) is a suite of tools for API developers, the project is open-source and licensed under the Apache License 2.0.

swagger-ui subdomain

Clicking the Authorize button gives us form to input the Authorization token, adding the previously gained JWT gives us the authorization.


Foothold

Shell - shirohige [ read logs ]

The Logs section cantains the API to read and view the logs. It also shows the path to the log which is present in /home/shirohige/logs

Clicking the Try it out button and adding the default path to id_rsa file gives us the id_rsa.

Copy the id_rsa into the file and clear up the extra spaces and words.

circle-info

The user.txt file contains the user flag 👏


Privilege Escalation

Pillaging - shirohige

Checking sudo privilege requires command, the instant.db is found which has some of the hashes but it is uncrackable using hashcat and rockyou.txt wordlist. The /opt/backups directory contains the SolarPutty directory.

Solar-PuTTY is a free SSH client developed by SolarWinds that allows you to connect to any server or device on your network

The Solar-PuTTY directory contains the sessions-backup.dat file. The .dat file in Solar-PuTTY is used to store sessions and credentials which is encrypted.

Shell - root [ .dat file decrypt ]

The VoidSec has created the github repositoryarrow-up-right to decrypt the Solar-PuTTY .dat files using wordlists and saving it into the file.

The repository contains the .exe file which will execute in Windows machine properly but I am using Linux machine and wine32 is giving some error. The ItsWatchMakerr has created the github repositoryarrow-up-right which contains the python script to decrypt the Solar-PuTTY .dat files and I will be using this script.

1

Transfering sessions-backup.dat file to local machine

Open the python http server in remote machine and download it using the wget in local machine.

2

Git clone the above repository

3

Create python virtual environment

To execute the script create the python virtual environment and activate it.

4

Install the required module and execute the script

Changing directory to SolarPuttyCracker and installing the required module.

Executing the script with required arguments.

The session_restore.txt contains the root ssh password.

We will be using su command to change the user to root through shirohige because the SSH doesn't work using the above credentials.

circle-info

The root.txt file contains the root flag 🎉


Proof of Concept

The below video provides the PoC of Instant machine.

Last updated