From eac56c853d4036ecb2b9c93196e64824af166d7d Mon Sep 17 00:00:00 2001 From: Caleb Stewart Date: Tue, 20 Jul 2021 16:30:00 -0400 Subject: [PATCH] Correct password processing in connection string --- CHANGELOG.md | 1 + pwncat/__main__.py | 3 +++ pwncat/commands/connect.py | 3 +++ 3 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index faec69e..0d5cf0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ improved stability with better exception handling. - Pinned container base image to alpine 3.13.5 and installed to virtualenv ([#134](https://github.com/calebstewart/pwncat/issues/134)) - Fixed syntax for f-strings in escalation command - Re-added `readline` import for windows platform after being accidentally removed +- Corrected processing of password in connection string ### Changed - Changed session tracking so session IDs aren't reused - Changed zsh prompt to match CWD of other shell prompts diff --git a/pwncat/__main__.py b/pwncat/__main__.py index 9b612f1..3a589e1 100644 --- a/pwncat/__main__.py +++ b/pwncat/__main__.py @@ -163,6 +163,9 @@ def main(): host = m.group("host") port = m.group("port") + if password is not None: + password = password.removeprefix(":") + if protocol is not None: protocol = protocol.removesuffix("://") diff --git a/pwncat/commands/connect.py b/pwncat/commands/connect.py index 05bc80a..2a8f9c4 100644 --- a/pwncat/commands/connect.py +++ b/pwncat/commands/connect.py @@ -137,6 +137,9 @@ class Command(CommandDefinition): host = m.group("host") port = m.group("port") + if password is not None: + password = password.removeprefix(":") + if protocol is not None: protocol = protocol.removesuffix("://")