Skip to content

Commit

Permalink
Update docs dependency rexml
Browse files Browse the repository at this point in the history
  • Loading branch information
adfoster-r7 committed Dec 23, 2024
1 parent 66f6cac commit 283cb5a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
--health-retries 5
strategy:
fail-fast: true
fail-fast: false
matrix:
ruby:
- '3.1'
Expand Down
2 changes: 1 addition & 1 deletion docs/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rexml (3.3.9)
rexml (3.4.0)
rouge (4.5.1)
safe_yaml (1.0.5)
sassc (2.4.0)
Expand Down
10 changes: 8 additions & 2 deletions lib/msf/core/windows_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,12 @@ def xp_or_2003?
# @param build [Integer] The build build number reported in the NTLM handshake
# @return [String] The possible matching OS versions, or nil if no corresponding match can be found
def self.from_ntlm_os_version(major, minor, build)
puts [major, minor, build].inspect
workstation_string = self.version_string(major, minor, build, WorkstationSpecificVersions, WorkstationNameMapping)
puts ["workstation_string:", workstation_string].inspect

server_string = self.version_string(major, minor, build, ServerSpecificVersions, ServerNameMapping)
puts ["server_string:", server_string].inspect

version_strings = []
version_strings.append(workstation_string) unless workstation_string.nil?
Expand Down Expand Up @@ -292,8 +296,10 @@ def major_release_name

# Get a Windows OS version string representation for a given major, minor and build number
def self.version_string(major, minor, build, version_module, mapping)
version_module.constants.each do |version_sym|
version = version_module.const_get(version_sym)
sorted_versions = version_module.constants
.map { |version_sym| [version_sym, version_module.const_get(version_sym)] }
.sort_by { |_version_sym, version| version.segments }
sorted_versions.each do |version_sym, version|
segments = version.segments
if segments[0..2] == [major, minor, build]
return mapping[version_sym]
Expand Down

0 comments on commit 283cb5a

Please sign in to comment.