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

Added support for domain users for ssh connections

This commit is contained in:
Caleb Stewart 2021-02-06 14:20:30 -05:00
parent 82207c9405
commit c5e5be8e97
2 changed files with 14 additions and 10 deletions

View File

@ -84,7 +84,7 @@ class Command(CommandDefinition):
} }
LOCAL = True LOCAL = True
CONNECTION_PATTERN = re.compile( CONNECTION_PATTERN = re.compile(
r"""^(?P<protocol>[-a-zA-Z0-9_]*://)?((?P<user>[^:@]*)?(?P<password>:(\\@|[^@])*)?@)?(?P<host>[^:]*)?(?P<port>:[0-9]*)?$""" r"""^(?P<protocol>[-a-zA-Z0-9_]*://)?((?P<user>[^:]*)?(?P<password>:(\\@|[^@])*)?@)?(?P<host>[^:]*)?(?P<port>:[0-9]*)?$"""
) )
def run(self, args): def run(self, args):

View File

@ -2017,11 +2017,15 @@ class Victim:
for _ in range(5): for _ in range(5):
try: try:
id_output = self.run("id").decode("utf-8") id_output = self.run("id").decode("utf-8")
pieces = id_output.split(" ") pieces = id_output.split(") ")
props = {} props = {}
for p in pieces: for p in pieces:
segments = p.split("=") segments = p.split("=")
props[segments[0]] = segments[1] try:
props[segments[0]] = segments[1] + ")"
except IndexError:
console.log(segments)
continue
id_properties = {} id_properties = {}
for key, value in props.items(): for key, value in props.items():