Skip to content
Pedro Mora
Go back

HTB Crocodile — The Credential Chain

Part of the OSAI Prep series → — HTB writeups mapped to OWASP LLM Top 10.

Machine Summary

FieldValue
PlatformHackTheBox
DifficultyVery Easy
OSLinux
VulnerabilityAnonymous FTP + credential reuse
OWASP MappingA07 — Identification and Authentication Failures

Reconnaissance

We run a default nmap scan against the target.

nmap -sC -sV -oN nmap.txt 10.129.43.115

nmap output showing port 21 FTP with anonymous login allowed and port 80 open

Two open ports come back:

Anonymous FTP plus an exposed webpage on the same host is a classic combination — anything FTP leaks is going to be useful against the web service.

Initial Foothold

We log into the FTP server anonymously and list the directory.

FTP directory listing showing two credential files

Two files are sitting in the share. Both look like credential material — exactly the kind of file that should never be reachable through anonymous FTP.

We download them with get:

Downloading the first credential file via FTP get Downloading the second credential file via FTP get

This is good information for us to have. Now we go enumerate port 80.

Crocodile brand webpage on port 80 with no obvious login link

The webpage is a brand site with no obvious login link. We use gobuster to find directories or files of interest, including .php extensions:

gobuster dir -u http://10.129.43.115 -w /usr/share/wordlists/dirb/common.txt -x .php

gobuster output revealing login.php

Gobuster surfaces a login.php page that wasn’t linked from public navigation.

login.php admin panel form

We log in using the credentials from the FTP files.

Successful login showing authenticated dashboard and flag

Authenticated access. Flag retrieved.

Privilege Escalation

Not required. The objective was authenticated access to the web admin panel, achieved entirely via reused credentials harvested from FTP. No shell, no kernel work, no lateral movement.

Root Cause

This box is a chain of two misconfigurations that compound:

  1. anonymous_enable=YES on the FTP service exposed credential files to anyone on the network.
  2. Hidden does not mean protected — the admin panel was unlinked from public navigation, but credentials harvested elsewhere unlocked it instantly.

Anonymous FTP shouldn’t be on a server holding sensitive files. Beyond that, an admin panel that depends solely on a single set of credentials to gate access — with no second factor, no IP allowlist, no out-of-band check — accepts any caller who can present those credentials, regardless of how they got them.

The AI Equivalent

Here we see two things — first the anonymous login, which we’ve seen on other machines, ties to LLM06 Sensitive Information Disclosure: open models in dev that don’t require authentication, where an attacker can extract relevant info or poison the models.

The second is using that information to legitimately log in on an admin page — in the agentic world, that’s an exposed /v1/chat/completions endpoint with a default API token (or no token at all) that lets any caller send arbitrary instructions to the model, modify its system prompt, or extract its configuration. The attacker, with the initial information obtained, can cause real problems.


OWASP LLM Top 10 Mapping: LLM06 (Sensitive Information Disclosure) chained into LLM08 (Excessive Agency)

The Crocodile chain is two distinct failures stitched together — and the second is the more dangerous one in production AI deployments. Stage one, anonymous FTP, is the classic LLM06 pattern: a development debug endpoint, an unauthenticated telemetry pipe, or an open RAG corpus accidentally leaking API keys, system prompts, or vector store credentials embedded in indexed documents.

Stage two — and this is where it gets ugly — is that those leaked credentials legitimately authenticate into the production agent’s tool-use endpoints. From the control plane’s perspective, every privileged call from there looks like a real operator: the API key is valid, the request is well-formed, the actions are within scope. There’s no out-of-band verification of who is holding the key.

This is structurally the same failure as Crocodile’s login.php — valid credentials equal full trust, regardless of provenance. The defense, for both web admin panels and agentic systems, is the same: treat credentials as one factor, not the whole authentication story.

Lessons Learned


Share this post on:

Previous Post
HTB Responder — LFI to NTLM Hash Capture
Next Post
HTB Sequel — Blank Root on MariaDB