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 2b6999a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 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: 10 additions & 0 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,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
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/msf/core/windows_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2b6999a

Please sign in to comment.