Open
Conversation
Collaborator
Author
🔗 Additional ContextOriginal Blog Post: https://0xdf.gitlab.io/2026/02/12/htb-slonik.html Content Categories: Based on the analysis, this content was categorized under "Network Services Pentesting -> 2049 - Pentesting NFS (export escape/no_subtree_check + UID spoofing) and 22 - Pentesting SSH/SFTP (port-forwarding to UNIX sockets); plus 5432 - Pentesting PostgreSQL (COPY FROM/TO PROGRAM for OS command execution) and Linux Privilege Escalation (backup/cron privileged copy -> SUID planting)". Repository Maintenance:
Review Notes:
Bot Version: HackTricks News Bot v1.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Automated Content Update
This PR was automatically generated by the HackTricks News Bot based on a technical blog post.
📝 Source Information
🎯 Content Summary
Title/Context: HackTheBox “Slonik” (Linux, Medium; Release Date: 14 Oct 2025). The chain combines: (1) insecure NFS exports that allow “root filesystem escape” reads, (2) credential recovery by reading
/etc/shadowand user history files via NFS + UID spoofing, (3) SSH port-forwarding to a remote PostgreSQL UNIX domain socket even when the account has/bin/false, (4) PostgreSQL OS command execution viaCOPY ... FROM PROGRAM, and (5) root escala...🔧 Technical Details
NFS “root filesystem escape” via export options: If NFS exports use
no_subtree_check, some clients/tools can traverse outside the exported subtree boundary and access arbitrary filesystem paths (read-only if the export isro). Tools like NetExec can automate this with--ls /and--get-fileto enumerate and download sensitive paths such as/etc/passwdand/etc/shadow.root_squashprevents acting as UID 0, but doesn’t prevent broad non-root file exfiltration.NFS UID spoofing for file access: NFS access control relies on numeric UID/GID values from the client. If remote files are owned by UID 1337, executing local commands as UID 1337 (e.g.,
sudo -u '#1337' cat /mnt/service/.bash_history) can bypass local username-based expectations and read otherwise inaccessible home-directory files, enabling theft of histories, credentials, and socket paths.SSH local...
🤖 Agent Actions
Updated
linux-hardening/privilege-escalation/README.mdwith a new cron-privesc subsection covering pg_basebackup/root backup workflows that preserve attacker-set SUID/SGID bits, including discovery steps (pspy), exploitation commands, and rationale, and added the HTB Slonik blog to References.This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.