From 231c76fcda32bbfc5f44e6fcad83a6b8241dfca1 Mon Sep 17 00:00:00 2001 From: Mitul16 Date: Fri, 18 Jun 2021 18:12:28 +0530 Subject: [PATCH] Added a comment about the fix This change was not committed, possibly due to the use of testing directory --- pwncat/channel/connect.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pwncat/channel/connect.py b/pwncat/channel/connect.py index e839b4c..1efee38 100644 --- a/pwncat/channel/connect.py +++ b/pwncat/channel/connect.py @@ -42,6 +42,9 @@ class Connect(Socket): # then we capture the GAI (getaddrinfo) exception and raise it as ChannelError # so that it is handled properly by the parent methods + # We also try to catch ConnectionRefusedError after it + # this is caused when a wrong port number is used + try: client = socket.create_connection((host, port)) except socket.gaierror: