Unmounted Filesystem Privilege Escalation
Unmounted filesystems — backup partitions, disk images, LVM volumes — frequently contain credential files, SSH keys, old /etc/shadow copies, and scripts executed by root. If you can mount them, you access their contents directly as if they were part of the live filesystem. No kernel exploit or SUID binary needed.
Prerequisites Check
Establish what is currently mounted versus what exists on disk:
Compare /proc/mounts against /etc/fstab to find defined but unmounted entries:
# Example vulnerable entry: /dev/sdb1 /mnt/backup ext4 defaults 0 0 /dev/mapper/vg-backup /backup ext4 defaults 0 0 /home.img /mnt/home ext4 loop,rw 0 0
Any line in /etc/fstab with a valid device but no corresponding entry in /proc/mounts is a candidate. Look especially for:
/dev/sdXpartitionsLVM paths like
/dev/mapper/vg-backupLoop devices pointing to image files
NFS mounts (different attack surface — see https://hackindex.io/services/nfs/privilege-escalation/no-root-squash-abuse)
Mount Without Root — User-Mountable Entries
Check /etc/fstab for the user or users mount option — these allow unprivileged mounting:
Example vulnerable entry:
Mount directly:
Mount With sudo
Check if mount is permitted via sudo:
If allowed:
Or mount a specific fstab entry by path:
Mount Without sudo or user Flag
If you have no sudo and no user-mountable entries, check whether you can write to the device file directly — rare but occurs on misconfigured systems:
If a device is readable, use debugfs to access ext2/3/4 filesystems without mounting:
debugfs /dev/sdb1
debugfs: ls /
debugfs: cat /etc/shadow
debugfs: cat /root/.ssh/id_rsa
This requires no mount privileges and no root. Works on ext2/3/4 only.
Loop-Mounted Disk Images
Disk images defined in fstab or found on the filesystem:
Mount a raw image:
If the image has multiple partitions, find the offset first:
LVM Volumes
LVM logical volumes are common in enterprise environments and often contain backup or old system data:
Mount an LVM volume:
What to Look For After Mounting
Work through these in priority order:
Authentication files:
If shadow is readable, crack the root hash — see https://hackindex.io/platforms/linux/privilege-escalation/passwd-shadow-manipulation.
SSH keys:
A root SSH key from the backup may still be valid on the live system.
Credentials in config files:
See https://hackindex.io/platforms/linux/privilege-escalation/credential-hunting for a full credential search workflow.
Scripts executed by root:
If a script from the mounted filesystem is also present on the live system and executed by root, check if it is writable — see https://hackindex.io/platforms/linux/privilege-escalation/cron-job-privilege-escalation.
Cleanup
Unmount after extraction to avoid interfering with system operations:
References
-
Mount options and user permissions
-
Loop and LVM usage
-
debugfs(8) manualman7.org/linux/man-pages/man8/debugfs.8.html (opens in new tab)
Direct ext2/3/4 filesystem access without mounting.
Was this helpful?
Your feedback helps improve this page.