Skip to content
Path traversal Write-up Intermediate

Breaking into ‘Instant’: A Step-by-Step Guide to Capturing Us

The Android APK contained an admin JWT secret, allowing authentication to an API endpoint that read arbitrary files via path traversal. This let the attacker read the user flag and an SSH private key, then escalate to root by decrypting a backup file.

Vignesh P Follow

Published on medium.com

Start by running a Nmap scan to discover open ports and services on the target machine. Nmap will give us a layout of the services running on the machine, which can help guide our next steps.

Vignesh P, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the APK contained a hardcoded admin JWT secret, and the API's file-reading endpoint did not properly restrict file paths.

Impact

An attacker could read arbitrary files on the server, obtain user and root flags, and gain root access.

What the attacker needed

Network access to the target; ability to download the APK

How it was found

  1. Scan the target with Nmap to find open ports and services.
  2. Add the target IP to /etc/hosts for the domain instant.htb.
  3. Download the APK from the website and analyse it to find an admin JWT secret.
  4. Add swagger-ui.instant.htb to /etc/hosts and access the Swagger UI.
  5. Use the JWT to call the API endpoint with a path traversal to read user.txt.
  6. Use the same endpoint to read the SSH private key, then SSH into the machine as a low-level user.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

The app's installation file (APK) had a secret key hidden inside it. That key let the attacker log in as an administrator and use a file-reading feature to grab sensitive files, including a password that gave full control of the server.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

More by Vignesh P

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.