diff --git a/pwncat/facts/tamper.py b/pwncat/facts/tamper.py index 5c786f8..63c0e6e 100644 --- a/pwncat/facts/tamper.py +++ b/pwncat/facts/tamper.py @@ -38,7 +38,7 @@ class Tamper(Fact): if self.reverted: return f"{title} ([green]reverted[/green])" - if self.data is not None: + if self.revertable: target_user = session.find_user(uid=self.uid) return f"{title} ([yellow]revertable[/yellow] as [blue]{target_user.name}[/blue])" @@ -115,6 +115,8 @@ class CreatedFile(Tamper): try: session.platform.Path(self.path).unlink() + except FileNotFoundError: + pass except PermissionError: raise ModuleFailed("permission error") diff --git a/pwncat/modules/agnostic/clean.py b/pwncat/modules/agnostic/clean.py index c836a28..4d6a7fb 100644 --- a/pwncat/modules/agnostic/clean.py +++ b/pwncat/modules/agnostic/clean.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -from pwncat.modules import Status, Argument, BaseModule +from pwncat.modules import Status, Argument, BaseModule, ModuleFailed class Module(BaseModule): @@ -23,7 +23,7 @@ class Module(BaseModule): continue if current_user.id != tamper.uid: session.log( - f"[yellow]warning[/yellow]: {tamper.title(session)}: incorrect uid to rever" + f"[yellow]warning[/yellow]: {tamper.title(session)}: incorrect uid to revert" ) continue diff --git a/pwncat/modules/linux/implant/pam.py b/pwncat/modules/linux/implant/pam.py index 2936e86..5690509 100644 --- a/pwncat/modules/linux/implant/pam.py +++ b/pwncat/modules/linux/implant/pam.py @@ -55,6 +55,9 @@ class PamImplant(Implant): # Track the log file separately now session.register_fact(CreatedFile(self.source, 0, self.log)) + def title(self, session: "pwncat.manager.Session"): + return f"""pam backdoor implant (logging to [cyan]{self.log}[/cyan])""" + class Module(ImplantModule): """