Skip to content

Commit

Permalink
Fixed DH rate testing on Windows. (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtesta committed Sep 28, 2024
1 parent cb6142c commit dc615ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ For convenience, a web front-end on top of the command-line tool is available at
- Fixed host key tests from only reporting a key type at most once despite multiple hosts supporting it; credit [Daniel Lenski](https://github.com/dlenskiSB).
- Fixed DHEat connection rate testing on MacOS X and BSD platforms; credit [Drew Noel](https://github.com/drewmnoel) and [Michael Osipov](https://github.com/michael-o).
- Fixed invalid JSON output when a socket error occurs while performing a client audit.
- Fixed `--conn-rate-test` feature on Windows.
- When scanning multiple targets (using `-T`/`--targets`), the `-p`/`--port` option will now be used as the default port (set to 22 if `-p`/`--port` is not given). Hosts specified in the file can override this default with an explicit port number (i.e.: "host1:1234"). For example, when using `-T targets.txt -p 222`, all hosts in `targets.txt` that do not explicitly include a port number will default to 222; when using `-T targets.txt` (without `-p`), all hosts will use a default of 22.
- Now reports ECDSA and DSS fingerprints when in verbose mode; partial credit [Daniel Lenski](https://github.com/dlenskiSB).
- Added 1 new cipher: `grasshopper-ctr128`.
Expand Down
8 changes: 1 addition & 7 deletions src/ssh_audit/dheat.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,6 @@ def _close_socket(socket_dict: Dict[socket.socket, float], s: socket.socket) ->

del socket_dict[s]

if sys.platform == "win32":
DHEat.YELLOWB = "\033[1;93m"
DHEat.CLEAR = "\033[0m"
print("\n%sUnfortunately, this feature is not currently functional under Windows.%s This should get fixed in a future release. See: <https://github.com/jtesta/ssh-audit/issues/261>" % (DHEat.YELLOWB, DHEat.CLEAR))
return ""

# Resolve the target into an IP address
out.d("Resolving target %s..." % aconf.host)
target_address_family, target_ip_address = DHEat._resolve_hostname(aconf.host, aconf.ip_version_preference)
Expand Down Expand Up @@ -443,7 +437,7 @@ def _close_socket(socket_dict: Dict[socket.socket, float], s: socket.socket) ->
# out.d("Creating socket (%u of %u already exist)..." % (len(socket_dict), concurrent_sockets), write_now=True)
ret = s.connect_ex((target_ip_address, aconf.port))
num_attempted_connections += 1
if ret in [0, errno.EINPROGRESS]:
if ret in [0, errno.EINPROGRESS, errno.EWOULDBLOCK]:
socket_dict[s] = now
else:
out.d("connect_ex() returned: %s (%d)" % (os.strerror(ret), ret), write_now=True)
Expand Down

0 comments on commit dc615ce

Please sign in to comment.