mirror of
https://github.com/jtesta/ssh-audit.git
synced 2024-11-22 02:21:40 +01:00
Now prints the reason why socket listening operations fail.
This commit is contained in:
parent
639f11a5e5
commit
e99cb0b579
@ -105,8 +105,8 @@ class SSH_Socket(ReadBuf, WriteBuf):
|
|||||||
s.bind(('0.0.0.0', self.__port))
|
s.bind(('0.0.0.0', self.__port))
|
||||||
s.listen()
|
s.listen()
|
||||||
self.__sock_map[s.fileno()] = s
|
self.__sock_map[s.fileno()] = s
|
||||||
except Exception:
|
except Exception as e:
|
||||||
print("Warning: failed to listen on any IPv4 interfaces.")
|
print("Warning: failed to listen on any IPv4 interfaces: %s" % str(e))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Socket to listen on all IPv6 addresses.
|
# Socket to listen on all IPv6 addresses.
|
||||||
@ -116,8 +116,8 @@ class SSH_Socket(ReadBuf, WriteBuf):
|
|||||||
s.bind(('::', self.__port))
|
s.bind(('::', self.__port))
|
||||||
s.listen()
|
s.listen()
|
||||||
self.__sock_map[s.fileno()] = s
|
self.__sock_map[s.fileno()] = s
|
||||||
except Exception:
|
except Exception as e:
|
||||||
print("Warning: failed to listen on any IPv6 interfaces.")
|
print("Warning: failed to listen on any IPv6 interfaces: %s" % str(e))
|
||||||
|
|
||||||
# If we failed to listen on any interfaces, terminate.
|
# If we failed to listen on any interfaces, terminate.
|
||||||
if len(self.__sock_map.keys()) == 0:
|
if len(self.__sock_map.keys()) == 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user