mirror of
https://github.com/calebstewart/pwncat.git
synced 2024-11-23 17:15:38 +01:00
chore: Pre-merge tasks completed
Oops, I missed the import for PlatformError :p
This commit is contained in:
parent
1f6c82026e
commit
0632beb992
@ -12,7 +12,8 @@
|
||||
#
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, os.path.abspath('../..'))
|
||||
|
||||
sys.path.insert(0, os.path.abspath("../.."))
|
||||
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
@ -14,6 +14,7 @@ from rich.progress import (
|
||||
import pwncat
|
||||
from pwncat.util import console, copyfileobj, human_readable_size, human_readable_delta
|
||||
from pwncat.commands import Complete, Parameter, CommandDefinition
|
||||
from pwncat.platform import PlatformError
|
||||
|
||||
|
||||
class Command(CommandDefinition):
|
||||
@ -77,5 +78,10 @@ class Command(CommandDefinition):
|
||||
f"uploaded [cyan]{human_readable_size(length)}[/cyan] "
|
||||
f"in [green]{human_readable_delta(elapsed)}[/green]"
|
||||
)
|
||||
except (FileNotFoundError, PermissionError, IsADirectoryError, PlatformError) as exc:
|
||||
except (
|
||||
FileNotFoundError,
|
||||
PermissionError,
|
||||
IsADirectoryError,
|
||||
PlatformError,
|
||||
) as exc:
|
||||
self.parser.error(str(exc))
|
||||
|
@ -93,7 +93,9 @@ class Module(ImplantModule):
|
||||
yield Status("verifying user permissions")
|
||||
current_user = session.current_user()
|
||||
if user != "__pwncat_current__" and current_user.id != 0:
|
||||
raise ModuleFailed("only [blue]root[/blue] can install implants for other users")
|
||||
raise ModuleFailed(
|
||||
"only [blue]root[/blue] can install implants for other users"
|
||||
)
|
||||
|
||||
if not os.path.isfile(key):
|
||||
raise ModuleFailed(f"private key [bleu]{key}[/blue] does not exist")
|
||||
|
@ -8,9 +8,10 @@ import dataclasses
|
||||
from io import StringIO
|
||||
|
||||
import pytest
|
||||
from pwncat.channel import ChannelError
|
||||
from Crypto.PublicKey import RSA
|
||||
|
||||
from pwncat.channel import ChannelError
|
||||
|
||||
PLATFORM_MAP = {"ubuntu": "linux", "centos": "linux", "windows": "windows"}
|
||||
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import pytest
|
||||
|
||||
from pwncat.modules import IncorrectPlatformError
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user