Skip to content

Commit

Permalink
Merge pull request calebstewart#232 from calebstewart/fix/231/ssl-par…
Browse files Browse the repository at this point in the history
…sing

Fixed ssl parsing in entrypoint/connect command
  • Loading branch information
calebstewart committed Jan 9, 2022
2 parents a53fe8f + 7376c87 commit 3a48308
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and simply didn't have the time to go back and retroactively create one.

## [Unreleased]

### Changed
- Fixed parsing of `--ssl` argument ([#231](https://github.com/calebstewart/pwncat/issues/231)).

## [0.5.2] - 2021-12-31
Bug fixes for argument parsing and improved SSH key support thanks to
`paramiko-ng`. Moved to a prettier theme for ReadTheDocs documentation.
Expand Down
16 changes: 10 additions & 6 deletions pwncat/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,16 +233,20 @@ def main():
if query_args["certfile"] is not None or query_args["keyfile"] is not None:
query_args["ssl"] = True

if query_args["protocol"] not in [
None,
"bind",
"connect",
] and query_args.get("ssl"):
if (
query_args["protocol"]
not in [
None,
"bind",
"connect",
]
and query_args.get("ssl")
):
console.log(
f"[red]error[/red]: --ssl is incompatible with an [yellow]{query_args['protocol']}[/yellow] protocol"
)
return
elif query_args["protocol"] is not None:
elif query_args["protocol"] is not None and query_args.get("ssl"):
query_args["protocol"] = "ssl-" + query_args["protocol"]

if (
Expand Down
2 changes: 1 addition & 1 deletion pwncat/commands/connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def run(self, manager: "pwncat.manager.Manager", args):
f"[red]error[/red]: --ssl is incompatible with an [yellow]{query_args['protocol']}[/yellow] protocol"
)
return
elif query_args["protocol"] is not None:
elif query_args["protocol"] is not None and query_args.get("ssl"):
query_args["protocol"] = "ssl-" + query_args["protocol"]

if (
Expand Down

0 comments on commit 3a48308

Please sign in to comment.