From 2b6999a985af825fd329ce0021bb3d187ea09ff8 Mon Sep 17 00:00:00 2001 From: adfoster-r7 Date: Mon, 23 Dec 2024 14:15:37 +0000 Subject: [PATCH] Update docs dependency rexml --- .github/workflows/verify.yml | 2 +- docs/Gemfile.lock | 2 +- lib/msf/core/windows_version.rb | 10 ++++++++++ spec/lib/msf/core/windows_version_spec.rb | 2 ++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index b240005d78b5..ffc6a697f32a 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -57,7 +57,7 @@ jobs: --health-retries 5 strategy: - fail-fast: true + fail-fast: false matrix: ruby: - '3.1' diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 4007ceca6738..125c702c17ac 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -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) diff --git a/lib/msf/core/windows_version.rb b/lib/msf/core/windows_version.rb index a8da2ceb9365..a0c6bd2c9a72 100644 --- a/lib/msf/core/windows_version.rb +++ b/lib/msf/core/windows_version.rb @@ -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? @@ -292,14 +296,20 @@ 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) + puts version_module.constants.inspect version_module.constants.each do |version_sym| + puts "version_sym: #{version_sym}" version = version_module.const_get(version_sym) + puts "version: #{version}" segments = version.segments + puts "segments: #{segments.inspect}" if segments[0..2] == [major, minor, build] + puts "matched: #{segments[0..2]} == #{[major, minor, build].inspect}" return mapping[version_sym] end end + puts "nil scenario" nil end end diff --git a/spec/lib/msf/core/windows_version_spec.rb b/spec/lib/msf/core/windows_version_spec.rb index 5cb7550b393a..6230f3e65672 100644 --- a/spec/lib/msf/core/windows_version_spec.rb +++ b/spec/lib/msf/core/windows_version_spec.rb @@ -45,7 +45,9 @@ major = 5 minor = 1 build = 2600 + puts "running test" version_string = described_class.from_ntlm_os_version(major, minor, build) + puts "finishing test before assertion" expect(version_string).to eq('Windows XP') end