From f0ab2a024a015374a379c89f11f5cf9f788ae46d Mon Sep 17 00:00:00 2001 From: Caleb Stewart Date: Mon, 7 Jun 2021 16:22:06 -0400 Subject: [PATCH] Fixed case when protocol was None --- pwncat/__main__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pwncat/__main__.py b/pwncat/__main__.py index 38e1827..fb1d753 100644 --- a/pwncat/__main__.py +++ b/pwncat/__main__.py @@ -143,12 +143,15 @@ def main(): if args.connection_string: m = connect.Command.CONNECTION_PATTERN.match(args.connection_string) - protocol = m.group("protocol").removesuffix("://") + protocol = m.group("protocol") user = m.group("user") password = m.group("password") host = m.group("host") port = m.group("port") + if protocol is not None: + protocol = protocol.removesuffix("://") + if host is not None and host == "": host = None