1
0
mirror of https://github.com/calebstewart/pwncat.git synced 2024-11-27 19:04:15 +01:00

Minor refactor in sudo

This commit is contained in:
Caleb Stewart 2020-06-02 21:25:39 -04:00
parent e3583607ba
commit 67e3744d5e

View File

@ -53,10 +53,7 @@ class Method(BaseMethod):
techniques = []
for rule in rules:
for method in pwncat.victim.gtfo.iter_sudo(rule.command, caps=capability):
if rule.runas_user == "ALL":
user = "root"
else:
user = rule.runas_user
user = "root" if rule.runas_user == "ALL" else rule.runas_user
techniques.append(Technique(user, self, (method, rule), method.cap))
return techniques