1
0
mirror of https://github.com/calebstewart/pwncat.git synced 2024-11-24 01:25:37 +01:00

Fixed some typos and missing imports

This commit is contained in:
Caleb Stewart 2021-05-19 19:12:02 -04:00
parent 0cab19835e
commit f8f7b61f0d
3 changed files with 8 additions and 3 deletions

View File

@ -38,7 +38,7 @@ class Tamper(Fact):
if self.reverted: if self.reverted:
return f"{title} ([green]reverted[/green])" return f"{title} ([green]reverted[/green])"
if self.data is not None: if self.revertable:
target_user = session.find_user(uid=self.uid) target_user = session.find_user(uid=self.uid)
return f"{title} ([yellow]revertable[/yellow] as [blue]{target_user.name}[/blue])" return f"{title} ([yellow]revertable[/yellow] as [blue]{target_user.name}[/blue])"
@ -115,6 +115,8 @@ class CreatedFile(Tamper):
try: try:
session.platform.Path(self.path).unlink() session.platform.Path(self.path).unlink()
except FileNotFoundError:
pass
except PermissionError: except PermissionError:
raise ModuleFailed("permission error") raise ModuleFailed("permission error")

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
from pwncat.modules import Status, Argument, BaseModule from pwncat.modules import Status, Argument, BaseModule, ModuleFailed
class Module(BaseModule): class Module(BaseModule):
@ -23,7 +23,7 @@ class Module(BaseModule):
continue continue
if current_user.id != tamper.uid: if current_user.id != tamper.uid:
session.log( 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 continue

View File

@ -55,6 +55,9 @@ class PamImplant(Implant):
# Track the log file separately now # Track the log file separately now
session.register_fact(CreatedFile(self.source, 0, self.log)) 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): class Module(ImplantModule):
""" """