Skip to content

Commit 3a48308

Browse files
authored
Merge pull request #232 from calebstewart/fix/231/ssl-parsing
Fixed ssl parsing in entrypoint/connect command
2 parents a53fe8f + 7376c87 commit 3a48308

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ and simply didn't have the time to go back and retroactively create one.
99

1010
## [Unreleased]
1111

12+
### Changed
13+
- Fixed parsing of `--ssl` argument ([#231](https://github.com/calebstewart/pwncat/issues/231)).
14+
1215
## [0.5.2] - 2021-12-31
1316
Bug fixes for argument parsing and improved SSH key support thanks to
1417
`paramiko-ng`. Moved to a prettier theme for ReadTheDocs documentation.

pwncat/__main__.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,16 +233,20 @@ def main():
233233
if query_args["certfile"] is not None or query_args["keyfile"] is not None:
234234
query_args["ssl"] = True
235235

236-
if query_args["protocol"] not in [
237-
None,
238-
"bind",
239-
"connect",
240-
] and query_args.get("ssl"):
236+
if (
237+
query_args["protocol"]
238+
not in [
239+
None,
240+
"bind",
241+
"connect",
242+
]
243+
and query_args.get("ssl")
244+
):
241245
console.log(
242246
f"[red]error[/red]: --ssl is incompatible with an [yellow]{query_args['protocol']}[/yellow] protocol"
243247
)
244248
return
245-
elif query_args["protocol"] is not None:
249+
elif query_args["protocol"] is not None and query_args.get("ssl"):
246250
query_args["protocol"] = "ssl-" + query_args["protocol"]
247251

248252
if (

pwncat/commands/connect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def run(self, manager: "pwncat.manager.Manager", args):
202202
f"[red]error[/red]: --ssl is incompatible with an [yellow]{query_args['protocol']}[/yellow] protocol"
203203
)
204204
return
205-
elif query_args["protocol"] is not None:
205+
elif query_args["protocol"] is not None and query_args.get("ssl"):
206206
query_args["protocol"] = "ssl-" + query_args["protocol"]
207207

208208
if (

0 commit comments

Comments
 (0)