Skip to content

Commit 9545b6e

Browse files
author
Tod Beardsley
committed
Land rapid7#4343, os_flavor reduction
2 parents 9908e0e + 9202c4f commit 9545b6e

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

lib/msf/core/exploit/remote/browser_exploit_server.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ module Exploit::Remote::BrowserExploitServer
4848
:ua_name, # Example: MSIE
4949
:ua_ver, # Example: 8.0, 9.0
5050
:os_name, # Example: Windows 7, Linux
51-
:os_flavor, # Example: Home, Enterprise
5251
:os_device, # Example: iPad, iPhone, etc
5352
:os_vendor, # Example: Microsoft, Ubuntu, Apple, etc
5453
:os_sp, # Example: SP2
@@ -214,17 +213,15 @@ def get_bad_requirements(profile)
214213
# Returns the target profile based on the tag. Each profile has the following structure:
215214
# 'cookie_name' =>
216215
# {
217-
# :os_name => 'Windows 7',
218-
# :os_flavor => 'Enterprise',
216+
# :os_name => 'Windows 7'
219217
# ...... etc ......
220218
# }
221219
# A profile should at least have info about the following:
222220
# :source : The data source. Either from 'script', or 'headers'. The 'script' source
223221
# should be more accurate in some scenarios like browser compatibility mode
224222
# :ua_name : The name of the browser
225-
# :ua_ver : The version of the browser
223+
# :ua_ver : The version of the browser (not yet implemented)
226224
# :os_name : The name of the OS ("Windows XP")
227-
# :os_flavor : The edition of the OS ("Home")
228225
# :language : The system's language
229226
# :arch : The system's arch
230227
# :proxy : Indicates whether proxy is used
@@ -383,7 +380,6 @@ def get_detection_html(user_agent)
383380
var osInfo = os_detect.getVersion();
384381
var d = {
385382
"os_name" : osInfo.os_name,
386-
"os_flavor" : osInfo.os_flavor,
387383
"os_vendor" : osInfo.os_vendor,
388384
"os_device" : osInfo.os_device,
389385
"ua_name" : osInfo.ua_name,

spec/lib/msf/core/exploit/remote/browser_exploit_server_spec.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@
3636
let(:expected_profile) do
3737
{
3838
:source=>'script',
39-
:os_name=>'Microsoft Windows',
40-
:os_flavor=>'XP',
39+
:os_name=>'Windows XP',
4140
:ua_name=>'MSIE',
4241
:ua_ver=>'8.0',
4342
:arch=>'x86',
@@ -210,13 +209,13 @@
210209

211210
describe "#extract_requirements" do
212211
it "finds all the recognizable keys" do
213-
requirements = {:os_flavor=>"XP", :ua_name=>"MSIE", :ua_ver=>"8.0"}
212+
requirements = {:os_name=>"Windows XP", :ua_name=>"MSIE", :ua_ver=>"8.0"}
214213
matches = server.extract_requirements(requirements)
215214
expect(matches).to eq(requirements)
216215
end
217216

218217
it "makes sure the keys are always symbols" do
219-
requirements = {'os_flavor'=>"XP", 'ua_name'=>"MSIE"}
218+
requirements = {'os_name'=>"Windows XP", 'ua_name'=>"MSIE"}
220219
matches = server.extract_requirements(requirements)
221220
matches.each do |k,v|
222221
expect(k.class).to eq(Symbol)

0 commit comments

Comments
 (0)